grigo Posted August 11, 2017 Share Posted August 11, 2017 (edited) When i receive mail order confirmation, price is zero for main store products. (www.example.com Price are visible only for second store (www.example.com/shopb) Any ideas? Edited August 11, 2017 by grigo (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted August 11, 2017 Share Posted August 11, 2017 Always mention the prestashop version in use. We are not very good in guessing. Link to comment Share on other sites More sharing options...
grigo Posted August 11, 2017 Author Share Posted August 11, 2017 1.6.1.2 thank u! Link to comment Share on other sites More sharing options...
Scully Posted August 11, 2017 Share Posted August 11, 2017 (edited) Your ps version is very old. I would update to 1.6.1.10 or higher. We don't have this issue with 1.6.1.13. And by the way: if you place an order with your own mail address - does the prices appear then? I guess not and then it wouldn't be a mail alert issue. Edited August 11, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
grigo Posted August 13, 2017 Author Share Posted August 13, 2017 Hello I have updated prestashop to 1.6.1.16 but still not working. I have placed orders for different accounts and still same error. Any other solutions? Link to comment Share on other sites More sharing options...
Scully Posted August 13, 2017 Share Posted August 13, 2017 And have you placed an order with your own mailaddress to make sure the problem is not caused by mail alert module? If is still does not work I'd look at the server error logfile. It might give an hint if there is an error logged. Link to comment Share on other sites More sharing options...
grigo Posted August 13, 2017 Author Share Posted August 13, 2017 The problem is from {products} order_conf mail. The error appears only when i select products from both shops. When i buy products only from one shop it works perfectly Link to comment Share on other sites More sharing options...
Scully Posted August 13, 2017 Share Posted August 13, 2017 In classes / PaymentModule.php you find this: if (count($product_var_tpl_list) > 0) { $product_list_txt = $this->getEmailTemplateContent('order_conf_product_list.txt', Mail::TYPE_TEXT, $product_var_tpl_list); $product_list_html = $this->getEmailTemplateContent('order_conf_product_list.tpl', Mail::TYPE_HTML, $product_var_tpl_list); } You could try to add debug statements (var_dump, print_r) after the the tpl vars have been filled. I would point to some missing or wrong .tpl - but I might be wrong. Link to comment Share on other sites More sharing options...
grigo Posted August 14, 2017 Author Share Posted August 14, 2017 i cant find anything. Mail Alerts module works fine but is a different parameter {items}. Order conf from prestashop is {products}. Maybe a solution to change {products} with {items}. If i change it from order conf template with {items} nothing happens Link to comment Share on other sites More sharing options...
Scully Posted August 14, 2017 Share Posted August 14, 2017 Your inital post an title led to the direction, the mails from mail alert having zero values. As per now, you confirm Mail Alerts works fine and the problem is with the original order confirmation which is sent to your customers? Is this correct? If so, you could look into the Mail Alerts module how items is assigned. It doesn't help if you just change the variable from products to items since the latter is not assigend by the PaymentModule.php. You had to figure out the differences in the codes from Mail Alert and PaymentModule.php. Link to comment Share on other sites More sharing options...
grigo Posted August 14, 2017 Author Share Posted August 14, 2017 Yes..all u said is correct...I will try to figure the differences Link to comment Share on other sites More sharing options...
grigo Posted August 14, 2017 Author Share Posted August 14, 2017 (edited) I ve changed PaymentModule.php like this and is working now: $product_var_tpl_list = array(); foreach ($order->product_list as $product) { $unit_price = Product::getTaxCalculationMethod($customer->id) == PS_TAX_EXC ? $product['price'] : $product['price_wt']; $product_var_tpl = array( 'reference' => $product['reference'], 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($unit_price, $currency, false), 'price' => Tools::displayPrice(($unit_price * $product['quantity']), $currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); $customized_datas = Product::getAllCustomizedDatas((int)$order->id_cart); if (isset($customized_datas[$product['id_product']][$product['id_product_attribute']])) { $product_var_tpl['customization'] = array(); foreach ($customized_datas[$product['id_product']][$product['id_product_attribute']][$order->id_address_delivery] as $customization) { $customization_text = ''; if (isset($customization['datas'][Product::CUSTOMIZE_TEXTFIELD])) { foreach ($customization['datas'][Product::CUSTOMIZE_TEXTFIELD] as $text) { $customization_text .= $text['name'].': '.$text['value'].'<br />'; } } Edited August 14, 2017 by grigo (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted August 14, 2017 Share Posted August 14, 2017 Very cool. Congratulations. 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