Bug in "Order notification" email preload

  • Posts: 2143
  • Thank you received: 747
5 years 6 months ago #306040

-- HikaShop version -- : 4.0.3

Hi,

Line 431 is

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
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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 6 months ago #306041

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.

  • Posts: 2143
  • Thank you received: 747
5 years 6 months ago #306053

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: 5 years 6 months ago by lousyfool.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 6 months ago #306106

Hi,

It's ok there as there is this code at the beginning of the preload:

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.044 seconds
Powered by Kunena Forum