• Resolved gnorf

    (@gnorf)


    hi

    first of all, thank you very much for an excellent plugin!

    I would like to add the billing address/email in addition to so that it shows up in the admin notification. This could either be in the notification text or in the table.

    What would be the best approach? It would be of great help if the mail could be made clickable (html).

    THanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author pinal.shah

    (@pinalshah)

    Hi @gnorf,

    I’m glad to know you liked the plugin ??

    Please follow the steps below to customize the email template sent to the admin:

    1. Go to WooCommerce->Settings->Emails->Request for New Quote
    2. Click on the “Copy file to theme” button present in the lower half of the page.
    3. This will copy the existing PHP template to your active theme.
    4. Go to the path specified alongside the button to open the email template file.
    5. Customize it as per your requirements.
    6. In order to ensure the email link is clickable, you can use

    <a href='mailto:{variable_containing_email_address}'>{variable_containing_email_address}</a>

    I hope this helps. Please let me know in case if you have any further queries.

    Thanks,
    Pinal

    • This reply was modified 5 years, 9 months ago by pinal.shah.
    Thread Starter gnorf

    (@gnorf)

    Hi Pinal,

    thanks, I cannot see any button for exporting the email template file.

    Assume we talk about request-new-quote.php? if copying manually (using a child theme) would root of the child-theme be the right place?

    Secondly. I tried to insert the above code but it corrupted the php. So evidently I did something wrong with the format?

    Thanks!

    Plugin Author pinal.shah

    (@pinalshah)

    Hi @gnorf,

    Yes, I am talking about the request-new-quote.php file.

    Yes, the file can be placed in the child-theme folder. Please place it as: <child theme folder>/quotes-for-wc/emails/request-new-quote.php

    The billing address and email address need to be fetched using WooCommerce functions. Assuming you wish to add the details below the product table in the email, you can add the below code after the </table> at line number 39 in the file:

    <?php 
    $billing_address = $order_obj->get_formatted_billing_address();
    $billing_email = $order_obj->get_billing_email();		
    ?>
    <div>
    	<p><strong><?php _e( 'Billing Address:', 'quote-wc' );?></strong>/br>
    	<?php echo "$billing_address";?><br>
    	<?php print( "<a href='mailto:$billing_email'>$billing_email</a>" ); ?>
    </p></div>
    

    Please note that the HTML added here is very basic. You might wish to modify it to suit your requirements.

    I hope this helps. Please let me know in case if you have any further queries.

    Thanks,
    Pinal

    Thread Starter gnorf

    (@gnorf)

    Hi Pinal

    Brilliant thanks, this did the job!

    Only one problem, the placement in the child theme did not seem to work.

    I see that the main theme has a /woocommerce/ subfolder and below it /cart, /checkout and a few others.

    Could it be that the modified php file should be under /child-theme/woocommerce/quotes-for-woocommerce/emails/ ? Not tried that yet.

    Rgds

    Plugin Author pinal.shah

    (@pinalshah)

    Hi @gnorf,

    Strange, placing it in the child theme should’ve worked. Alternately it can even be placed in the parent theme.

    Alternately, you can check the path in which the file needs to be placed here:
    WooCommerce->Settings->Emails->Request New Quote->HTML template.

    Pinal

    Thread Starter gnorf

    (@gnorf)

    Hi Pinal

    Function WooCommerce->Settings->Emails->Request New Quote->HTML template is not visible to me. The table of email notification function and this one specifically only leads to a page with fields for settings.

    on page /admin.php?page=wc-settings&tab=email I can see the quote specific entries. link or manage button leads to a config page but there’s nothing that gives me the option of inspecting the path.

    Rgds

    Plugin Author pinal.shah

    (@pinalshah)

    Going to /admin.php?page=wc-settings&tab=email&section=qwc_request_new_quote will take you to the email config page where you can change the email settings.

    Scrolling down to the bottom would show you something like: https://www.screencast.com/t/s19SEqOZJVA

    Since, the template has already been overridden in my case, it shows a message and the path where the template resides. Else it will show you the path where the file should be placed.

    Pinal

    Thread Starter gnorf

    (@gnorf)

    This function is non-existent to me on this installation.

    https://i.paste.pics/ea394a26bff971f49463a694479e31b5.png

    So it’s a hard guess, no idea why it is not showing.

    Rgds

    Plugin Author pinal.shah

    (@pinalshah)

    Is that the case for all the email templates? Even the ones from WooCommerce?

    Usually the custom templates are saved in a folder inside the active theme folder. The folder is named after the plugin to which the template belongs. In our case it would be quotes-for-wc/emails.

    Pinal

    Thread Starter gnorf

    (@gnorf)

    Pinal

    I wonder if something got stuck somewhere. Disabled and re-enabled plugins. Now paths are displayed, and the copy function works!

    Thanks very much for your support!

    Rgds

    Plugin Author pinal.shah

    (@pinalshah)

    That’s great to know @gnorf !

    Thank you for the review ??

    Pinal

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Adding billing email to request-new-quote.php’ is closed to new replies.