Fixing bug on Vendor email notification

  • Posts: 128
  • Thank you received: 2
7 years 4 weeks ago #266001

-- HikaShop version -- : 2.6.4
-- HikaMarket version -- : 1.7.2
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6

Hi there,

I have noticed a small bug on the Vendor notification email when a coupon is applied to the purchase. When the Vendor is notified about order being created the value of the coupon applied shown in the email is correct. However once the order is confirmed (after payment) the Vendor notification shows a coupon value of 0 which is not correct.

I can see in the HikaMarket change log there was a bug fix in version 1.7.3 for "email notification", so I wonder how can I apply this fix to HikaMarket 1.7.2 without upgrading to 1.7.3

I'm still not ready to upgrade to HIkashop 3 so I'm still using Hikashop 2.6.4. For that reason I cannot upgrade either to Hikamarket 1.7.3 since it requires Hikashop 3.

But if you let me know in which file you applied the Hikamarket bug fix for "email notification" I can have a look and try to apply it to my hikamarket.

Many thanks!

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
7 years 3 weeks ago #266005

Hello,

The modifications in the email notification where about the loading of the "order number" and some other elements from the database when that data is not available in the order object passed in the trigger.
So yes, it is possible that the patch fix your issue for the coupon.

Now because the patch is composed of a lot different modifications in several files ; it will be very complicated for me to give you a full patch like that.
But you might be able to fix your specific problem with a modification in the order preload.
Replacing

foreach($fs as $f) {
	if(isset($data->$f) && !isset($data->order->$f))
		$data->order->$f = $data->$f;
}
By
foreach($fs as $f) {
	if(isset($data->$f) && !isset($data->order->$f))
		$data->order->$f = $data->$f;
	if(isset($data->old->$f) && !isset($data->order->$f))
		$data->order->$f = $data->old->$f;
}

Because HikaMarket 1.7.3 includes the support of product bundles ; it needs HikaShop 3 otherwise it could generate unwanted side effects.

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
7 years 3 weeks ago #266073

Thank you Jerome.

I already have the code you proposed in the preload section of the "Market: Order Status Notification" email. So there is nothing to change.

What else could be tried to fix this problem?

Many thanks!

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
7 years 3 weeks ago #266080

Hello,

I'm afraid that I can't pickup like that the other patches:

Now because the patch is composed of a lot different modifications in several files ; it will be very complicated for me to give you a full patch like that.


But you should first check the vendor order and verify that the coupon is right copy in the "subsale".

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
7 years 3 weeks ago #266151

Hi Jerome,

The coupon is copied OK in the vendor order (subsale), all the numbers are fine and the discount is applied OK. The problem is that the value of the coupon is printed as zero on the vendor notification email when the order is confirmed. When the order is created, the vendor notification email prints the value of the coupon OK.

OK fine, I understand it is difficult to apply all the modifications you did for Hikamarket 1.7.3 but, would it be possible to find a solution for Hikamarket 1.7.2? How can I help you with this?

Thanks!

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
7 years 3 weeks ago #266180

Hello,

Try to modify your email to use that code for the coupon part

if($shopConfig->get('price_with_tax'))
	$t = $currencyHelper->format($data->order->order_discount_price * -1, $data->order->order_currency_id);
else
	$t = $currencyHelper->format(($data->order->order_discount_price - @$data->order->order_discount_tax) * -1, $data->order->order_currency_id);
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
7 years 3 weeks ago #266214

Jerome you're a star!

That fixed the issue, thanks a lot!

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
7 years 3 weeks ago #266221

Great :cheer:

The patch will be in the next packages.

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