email Template

  • Posts: 11
  • Thank you received: 1
3 years 4 months ago #326670

-- HikaShop version -- : 4.4.0
-- HikaMarket version -- : 3.1.1
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.3

Hi there I would like to customise the order emails that go out to the customer to make them more Vendor focused rather than marketplace focused.
Is this possible.
Specifically the lines

Thank you for your order at https://
Would love to put the vendors name in there

Similarly in the footer of the mail
Once again, thank you for your order at https://
We hope to see you again soon.
Best Regards
xxxxxxxx

Again I would love to put the vendors name in there.

Thanks
Kenny

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
3 years 4 months ago #326707

Hello,

To be able to display the vendor name in the customer email, it requires that you have just one vendor for the order.
If you have two vendors (or potentially your "main vendor'), the information cannot be retrieved by an algorithm.
When everything is in the right configuration, we can imagine a little PHP code to paste in the email in order to populate a variable with the vendor name, variable which could be used in the "email templating" system.
Regarding the subject, that requires a similar modification but you would need to re-define the subject of the email "code" itself.

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: 11
  • Thank you received: 1
3 years 4 months ago #327012

That sounds great.
I have set up one vendor per order and have no plans to change that.
I have also upgraded to the business edition so I have the email customisation system.

Do you happen to have any sample code I can use?

Kenny

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
3 years 4 months ago #327092

Hello,

In the email "preload" part you will see a loop on the cart products.

foreach($data->cart->products as $item) {
You have access to "all products" (content from the HikaShop product table) in the variable
$productClass->all_products

The idea is to get the vendor_id from the products (best is to take the first $item and get the content from all_products).
Once you have your vendor id (in "product_vendor_id" field) you can load the object object via
$vendorClass = hikamarket::get('class.vendor');
$vendor = $vendorClass->get($vendor_id);
And access the various fields such as "vendor_name", etc.

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.

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