Order Custom Fields in Vendor Order Status email notification

  • Posts: 128
  • Thank you received: 2
6 years 11 months ago #267779

-- HikaShop version -- : 3.0.1
-- HikaMarket version -- : 1.7.3
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6

Hi there,

I'm talking about the notification email: Market:Order Status Notification

When the email is sent to the Vendor to notify that an order is created the Order Custom Fields are included in the email - that's good.

However when the email is sent again to the Vendor once payment goes through to notify for order confirmation the Order Customs Fields are not there.

Can you see the same issue?

Thanks

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 11 months ago #267798

Hello,

Can you please give a more detailed context in order to reproduce the issue.
How exactly that second email is being sent ? (how the order being confirmed exactly)

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 128
  • Thank you received: 2
6 years 11 months ago #267830

OK sorry, I'm seeing this issue when using Stripe or MangoPay for Payment and hence as confirmation.

Please let me know if you need more info

Thanks!

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 11 months ago #267845

Hello,

Okay.
So the best would be to follow what HikaShop has also modified in his order notification email.
You can replace the in HikaMarket order notification preload:

	$fields = $fieldsClass->getFields('frontcomp',$data,'order','');
	foreach($fields as $fieldName => $oneExtraField) {
		if(isset($data->$fieldName) && !isset($data->order->$fieldName))
			$data->order->$fieldName = $data->$fieldName;
		if(empty($data->order->$fieldName))
			continue;
		echo $sep . $fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField, $data->order->$fieldName,'user_email');
		$sep = '<br />';
	}
By
	$fields = $fieldsClass->getFields('display:mail_status_notif=1',$data,'order','');
	foreach($fields as $fieldName => $oneExtraField) {
		if(isset($data->$fieldName) && !isset($data->cart->$fieldName))
			$data->cart->$fieldName = $data->$fieldName;
		if(empty($data->cart->$fieldName))
			continue;
		echo $sep . $fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField, $data->cart->$fieldName,'user_email');
		$sep = '<br />';
	}

Thanks to these modifications, the email will use the same filters for the custom fields and will use the data from "data->cart" instead of "data->order".
Because "data->order" is based on what is available during the trigger, the custom fields might not be all loaded ; and the modification in HikaShop (via le mass-action system) have reduced the data in the triggers (to reduce the loading and optimize the content).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 128
  • Thank you received: 2
6 years 11 months ago #267866

That works, thank you very much!

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

Moderators: Obsidev
Time to create page: 0.063 seconds
Powered by Kunena Forum