Recalculate full order value

  • Posts: 171
  • Thank you received: 9
8 years 9 months ago #207661

Hi Jerome!

I've made a small modification in hikamarket/ordermarket view to easily update/modify products in the order. It seems that everything works fine, products fields and the full net price is changed to the new one correctly, but the tax and the full gross price remains the same.

How can I force the component to recalculate the full gross price and the full tax of the order as well?

Thanks for your help and patience in advance!

Best Regards,
PePe

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

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
8 years 9 months ago #207674

Hi,

Well, I don't know what modifications you made exactly and what you want to reprocess exactly but if it's just the order full price and the order taxes ; you need to call the function of the HikaShop order class.
HikaMarket is processing special stuff, but if HikaShop already have code for that, I prefer to not rewrite and just use it :)

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: 171
  • Thank you received: 9
8 years 9 months ago #207697

Yeah, I know I shouldn't overwrite it, but some parts needed to be do that unfortunately.

I tried to solve my problem with these lines, but with no luck:

$orderClass = hikamarket::get('shop.class.order');
$order = $orderClass->loadFullOrder($order_id, true, false);
$orderClass->recalculateFullPrice($order);

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

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
8 years 9 months ago #207734

Yes, and ?

That function works pretty well for me... I used it a lot of times in HikaMarket.


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: 171
  • Thank you received: 9
8 years 9 months ago #207781

Oh... My logic stopped yesterday.
I just had to add the save line, and now everything works fine! Thanks!

$orderClass->save($order);

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

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
8 years 9 months ago #207785

:)


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