- Posts: 128
- Thank you received: 2
Order Custom Fields in Vendor Order Status email notification
9 years 5 months ago #267779
by sabroso
-- 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
-- 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.
9 years 5 months ago #267798
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Order Custom Fields in Vendor Order Status email notification
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,
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.
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267830
by sabroso
Replied by sabroso on topic Order Custom Fields in Vendor Order Status email notification
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 let me know if you need more info
Thanks!
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267845
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Order Custom Fields in Vendor Order Status email notification
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:
By
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,
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:
Code:
$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 />';
}
Code:
$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.
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267866
by sabroso
Replied by sabroso on topic Order Custom Fields in Vendor Order Status email notification
That works, thank you very much!
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.165 seconds