[Skip to main content](#vessel-content)

#   Send email to user when status changes

##

- **[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")**
- [![pepecortez's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31475-pepecortez "View pepecortez's Profile") Topic Author
- [ Offline](/forum/user/31475-pepecortez)

Less More

- Posts: 171
- Thank you received: 9
-
-

12 years 4 months ago [\#164310](#164310) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  *[Send email to user when status changes](/forum/19-hikamarket/869744-send-email-to-user-when-status-changes#164310 "Hi!  When editing an order on frontend, I wanted to let the subvendor to notify the user, but email was not sent out.  I've found , and just noticed there's this notify checkbox in the code. But this just shown to the main vendor, for subvendors not. I've modified this:  to this  Also modified:  to:  Now the fields are shown, but system is just sending out the email if I'm the main vendor, for subvendor no emails arriving. Any option to get this work for subvendors (and subvendor users) as well?  Thanks for your help in advance.")* was created by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")*

Hi!

When editing an order on frontend, I wanted to let the subvendor to notify the user, but email was not sent out.

I've found [ this thread](https://www.hikashop.com/forum/orders-management/868749-send-an-e-mail-receipt-once-an-order-is-confirmed/164306.html), and just noticed there's this notify checkbox in the code. But this just shown to the main vendor, for subvendors not. I've modified this: Code:

if(isset($this-&gt;edit) &amp;&amp; $this-&gt;edit === true &amp;&amp; ($this-&gt;vendor-&gt;vendor_id == 0 &#124;&#124; $this-&gt;vendor-&gt;vendor_id == 1) &amp;&amp; hikamarket::acl('order_edit_notify')) {

to this
Code:

if(isset($this-&gt;edit) &amp;&amp; $this-&gt;edit === true &amp;&amp; hikamarket::acl('order_edit_notify')) {

Also modified:
Code:

&lt;input type="checkbox" id="data[notify]" name="data[notify]"/&gt;

to: Code:

&lt;input type="checkbox" id="data[notify]" name="data[notify]" checked="checked"/&gt;

Now the fields are shown, but system is just sending out the email if I'm the main vendor, for subvendor no emails arriving. Any option to get this work for subvendors (and subvendor users) as well?

Thanks for your help in advance.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODY5NzQ0LXNlbmQtZW1haWwtdG8tdXNlci13aGVuLXN0YXR1cy1jaGFuZ2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 4 months ago [\#164311](#164311) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Send email to user when status changes](/forum/19-hikamarket/869744-send-email-to-user-when-status-changes#164311 "Hi!  When editing an order on frontend, I wanted to let the subvendor to notify the user, but email was not sent out.  I've found , and just noticed there's this notify checkbox in the code. But this just shown to the main vendor, for subvendors not. I've modified this:  to this  Also modified:  to:  Now the fields are shown, but system is just sending out the email if I'm the main vendor, for subvendor no emails arriving. Any option to get this work for subvendors (and subvendor users) as well?  Thanks for your help in advance.")*

Hi,

HikaMarket was not design to let the vendors send automatic notifications to the user.
The reason is that the vendor might not be the only vendor in the order.
So, even if the checkbox is there, HikaMarket won't read it to send the order notification.

The fact is that I want to improve some elements in HikaShop/HikaMarket in order to support partial statuses.
So vendors would be able to notify the user that a part of the order status changed (for some products).
But I guess that we can authorize the order notification is the vendor is the only vendor in the order (and there is no main vendor products too).

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODY5NzQ0LXNlbmQtZW1haWwtdG8tdXNlci13aGVuLXN0YXR1cy1jaGFuZ2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")**
- [![pepecortez's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31475-pepecortez "View pepecortez's Profile") Topic Author
- [ Offline](/forum/user/31475-pepecortez)

Less More

- Posts: 171
- Thank you received: 9
-
-

12 years 4 months ago [\#164360](#164360) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Send email to user when status changes](/forum/19-hikamarket/869744-send-email-to-user-when-status-changes#164360 "Hi!  When editing an order on frontend, I wanted to let the subvendor to notify the user, but email was not sent out.  I've found , and just noticed there's this notify checkbox in the code. But this just shown to the main vendor, for subvendors not. I've modified this:  to this  Also modified:  to:  Now the fields are shown, but system is just sending out the email if I'm the main vendor, for subvendor no emails arriving. Any option to get this work for subvendors (and subvendor users) as well?  Thanks for your help in advance.")*

I understand the usual case, but in our case all the items are orderable from all vendors, so on our side it won't happen/it's not a problem.

Could you give me an advice, **what and in which file should I modify** to let subvendors as well to modify the orders (status, notification, ordered items deletion/modification)? As I see of course that would be a "hack", which should be overwritten every time after re-installing a new version, but now it's a must have for us. :S

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODY5NzQ0LXNlbmQtZW1haWwtdG8tdXNlci13aGVuLXN0YXR1cy1jaGFuZ2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 4 months ago [\#164361](#164361) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Send email to user when status changes](/forum/19-hikamarket/869744-send-email-to-user-when-status-changes#164361 "Hi!  When editing an order on frontend, I wanted to let the subvendor to notify the user, but email was not sent out.  I've found , and just noticed there's this notify checkbox in the code. But this just shown to the main vendor, for subvendors not. I've modified this:  to this  Also modified:  to:  Now the fields are shown, but system is just sending out the email if I'm the main vendor, for subvendor no emails arriving. Any option to get this work for subvendors (and subvendor users) as well?  Thanks for your help in advance.")*

Hi,

So you will have to edit two classes.
The first one : order (adminstrator/components/com_hikamarket/classes/order.php)
In order to replace : Code:

if($vendor_id == 0 &amp;&amp; !empty($data['notify']) &amp;&amp; hikamarket::acl('order_edit_notify')) { if(empty($order-&gt;history)) $order-&gt;history = new stdClass(); $order-&gt;history-&gt;history_notified = true; }

By: Code:

if(!empty($data['notify']) &amp;&amp; hikamarket::acl('order_edit_notify')) { if(empty($order-&gt;history)) $order-&gt;history = new stdClass(); $order-&gt;history-&gt;history_notified = true; if(empty($order-&gt;hikamarket)) $order-&gt;hikamarket = new stdClass(); $order-&gt;hikamarket-&gt;force_email = true; }

The second one : mail (adminstrator/components/com_hikamarket/classes/mail.php)
The idea is to authorize the notification for a sub order when you have the variable which says so.
So in the function processOrderEmail. Code:

if($subsaleEmail) { $do = false; return; }

By: Code:

if($subsaleEmail &amp;&amp; empty($mail-&gt;data-&gt;hikamarket-&gt;force_email)) { $do = false; return; }

It should authorize the vendor to send order notifications for their sub orders.

Regards,

---

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

The following user(s) said Thank You: [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODY5NzQ0LXNlbmQtZW1haWwtdG8tdXNlci13aGVuLXN0YXR1cy1jaGFuZ2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")**
- [![pepecortez's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31475-pepecortez "View pepecortez's Profile") Topic Author
- [ Offline](/forum/user/31475-pepecortez)

Less More

- Posts: 171
- Thank you received: 9
-
-

12 years 4 months ago [\#164410](#164410) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Send email to user when status changes](/forum/19-hikamarket/869744-send-email-to-user-when-status-changes#164410 "Hi!  When editing an order on frontend, I wanted to let the subvendor to notify the user, but email was not sent out.  I've found , and just noticed there's this notify checkbox in the code. But this just shown to the main vendor, for subvendors not. I've modified this:  to this  Also modified:  to:  Now the fields are shown, but system is just sending out the email if I'm the main vendor, for subvendor no emails arriving. Any option to get this work for subvendors (and subvendor users) as well?  Thanks for your help in advance.")*

The code is perfect, working now like a charm. I should push "Thank you" button a hundred times, if system would let it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODY5NzQ0LXNlbmQtZW1haWwtdG8tdXNlci13aGVuLXN0YXR1cy1jaGFuZ2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.056 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
