Skip to main content

Bug in "Order notification" email preload

7 years 6 months ago #306040 by lousyfool
-- HikaShop version -- : 4.0.3

Hi,

Line 431 is
Code:
if(in_array($data->order->order_status, $unpaid_statuses) && !empty($data->cart->order_payment_method) && $data->cart->order_full_price > 0 && hikashop_level(1) && $config->get('allow_payment_button', 1)) {
and is throwing an error (at least in preview).

Obviously, it must be
Code:
if(in_array($data->order_status, $unpaid_statuses) && !empty($data->cart->order_payment_method) && $data->cart->order_full_price > 0 && hikashop_level(1) && $config->get('allow_payment_button', 1)) {

Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

7 years 6 months ago #306041 by nicolas
Hi,

Thanks for your feedback.
It should actually be $data->cart instead of $data->order.
We'll change that for the next version.
The following user(s) said Thank You: lousyfool

Please Log in or Create an account to join the conversation.

7 years 6 months ago - 7 years 6 months ago #306053 by lousyfool

nicolas wrote: It should actually be $data->cart instead of $data->order.


Yeah, sorry, wasn't thinking too much about it.

Though, then it's also wrong in...
- order_status_notification.preload.php, line 451
- order_creation_notification.preload.php, line 460

Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 7 years 6 months ago by lousyfool.

Please Log in or Create an account to join the conversation.

7 years 6 months ago #306106 by nicolas
Hi,

It's ok there as there is this code at the beginning of the preload:
Code:
if(!isset($data->order)) $data->order = new stdClass(); $fs = array('order_number','order_discount_tax','order_shipping_tax','order_payment_tax','order_full_price','order_shipping_price','order_payment_price','order_discount_price','order_currency_id','order_status'); foreach($fs as $f) { if(!isset($data->order->$f)){ if(isset($data->$f)) $data->order->$f = $data->$f; else $data->order->$f = ''; } }
this code fills the $data->order variable with the necessary data in these two preload but not in order_notification so that's why these are not throwing any error.

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum