Jump to content

Order Confirmation Email - Linking Back to Product


Recommended Posts

In my prior version of prestaship 1.7.6.4 I modified the confirmation email to have the product link link to product on website in order_conf_product_list.tpl as

<a href="{$product.url}" target="_blank">{$product['name']}</a>

in version 1.7.7.5 most recent available version it does not work.

Can anyone assist with this?

 

Edited by RoadToSuccess (see edit history)
Link to comment
Share on other sites

  • RoadToSuccess changed the title to Order Confirmation Email - Linking Back to Product
  • 3 years later...

Hi,
I hope someone with good will can help me;
I added the variable {$product.url} to the order_conf_product_list.tpl file

However, the order confirmation email leaves the variable space empty, like unknow or not recognized.

Do I also have to change something in the PaymentModule.php file to make it recognized?

Thanks

below the code from an order_conf email with empy href

<td>
                    <font size="2" face="Open-sans, sans-serif" color="#555454">
                        <strong><a href="" target="_blank">CALZINI ARGENTO - ED50002 - Colore: GRIGIO VANISE' - Taglia: S-35/38</a></strong>
                    </font>

</td>

 

It seems to me that I should declare the variable in PaymentModule.php but I don't understand where (and how).

somewhere around line 423

                    // Construct order detail table for the email
                    $products_list = '';
                    $virtual_product = true;

                    $product_var_tpl_list = [];
                    foreach ($order->product_list as $product) {
                        $price = Product::getPriceStatic((int) $product['id_product'], false, ($product['id_product_attribute'] ? (int) $product['id_product_attribute'] : null), 6, null, false, true, $product['cart_quantity'], false, (int) $order->id_customer, (int) $order->id_cart, (int) $order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}, $specific_price, true, true, null, true, $product['id_customization']);
                        $price_wt = Product::getPriceStatic((int) $product['id_product'], true, ($product['id_product_attribute'] ? (int) $product['id_product_attribute'] : null), 2, null, false, true, $product['cart_quantity'], false, (int) $order->id_customer, (int) $order->id_cart, (int) $order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}, $specific_price, true, true, null, true, $product['id_customization']);

                        $product_price = Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, Context::getContext()->getComputingPrecision()) : $price_wt;

                        $product_var_tpl = [
                            'id_product' => $product['id_product'],
                            'id_product_attribute' => $product['id_product_attribute'],
                            'reference' => $product['reference'],
                            'name' => $product['name'] . (isset($product['attributes']) ? ' - ' . $product['attributes'] : ''),
                            'price' => Tools::getContextLocale($this->context)->formatPrice($product_price * $product['quantity'], $this->context->currency->iso_code),
                            'quantity' => $product['quantity'],
                            'customization' => [],
                        ];

Millethanks

Ps:  (prestashop 1.7.8)

Edited by elly63 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...