Forums
Home / Plugin: Quotes for WooCommerce / Permalinks in email
(@ricamancio)
4 years, 9 months ago
How do I add permalink to product pages in email?
(@pinalshah)
Hi Ricardo,
Thanks for using the plugin. You can customize the Quotes plugin emails like any other WooCommerce emails.
Simply use the Copy file to theme button in WooCommerce->Settings->Emails->{selected email}->Manage page.
This will copy the existing PHP email template inside the {active theme}->quotes-for-wc/emails folder.
You can then edit the template file as needed. The emails will sent using the new template file.
I hope this helps.
Thanks, Pinal
Thank you very much Pinal for the attention.
Is there a particular class that I should look at or can you give me a way to insert links to product pages by email?
You can use standard WC functions available to achieve the same.
For e.g. if $product_id contains the Product ID for which you need the permalink, you can use the below patch:
$_product = wc_get_product( $product_id ); $permalink = $_product->get_permalink();
$_product = wc_get_product( $product_id );
$permalink = $_product->get_permalink();
Pinal
4 years, 6 months ago
Hi Pinal,
Your help has been instrumental.
Your tip has worked well until today.
But now the customer has variable products and wants to receive the URL with the attributes in the email.
For the product page to open with the options of the selected attributes.
Do you have to do that?
If you have the variation ID, you can use the code I had shared earlier as is.
$_product = wc_get_product( $variation_id ); $permalink = $_product->get_permalink();
$_product = wc_get_product( $variation_id );
This will give you the link for the chosen variation.
4 years, 4 months ago
Worked perfectly.
Thank you.