RoadToSuccess Posted June 22, 2021 Share Posted June 22, 2021 (edited) 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 June 22, 2021 by RoadToSuccess (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted June 23, 2021 Share Posted June 23, 2021 (edited) You have to look at the variables. You are requesting {$product.url} which is a correct smarty variable and {$product['name']} this is a variable used inPHP. So to make your template work you need to change {$product['name']} to {$product.name} Kind regards, Jaimy Edited June 23, 2021 by Crezzur (see edit history) Link to comment Share on other sites More sharing options...
RoadToSuccess Posted June 23, 2021 Author Share Posted June 23, 2021 (edited) Thank you. It worked. Edited June 23, 2021 by RoadToSuccess (see edit history) 1 Link to comment Share on other sites More sharing options...
delete-account-pleas Posted June 23, 2021 Share Posted June 23, 2021 No problem @RoadToSuccess glad it worked. For education purpose you can always see what values a variable has using |@var_dump so for example: {$product|@var_dump} Will show you all data inside this specific variable to see if your requested data is in there and what the name is that is used. Link to comment Share on other sites More sharing options...
elly63 Posted October 14 Share Posted October 14 (edited) 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 October 14 by elly63 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now