Jump to content

Multistore - Price is zero in mail alert - order confirmation


grigo

Recommended Posts

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 by Scully (see edit history)
Link to comment
Share on other sites

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

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

:( 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

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

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 by grigo (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...