LoadFullCart function not working

  • Posts: 23
  • Thank you received: 0
7 years 7 months ago #266405

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.9

Hi Nicolas

I need to get a order total amount in needCC function.

function needCC(&$method) {
$cartClass = hikashop_get('class.cart');
$fullcart = $cartClass->loadFullCart(false, true, true);
$currencyClass = hikashop_get('class.currency');
$currency = $currencyClass->get($cart->full_total->prices[0]->price_currency_id);
}
LoadFullCart is not working
If any other possibility to get a order total in needCC function.

Last edit: 7 years 7 months ago by nicolas.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 7 months ago #266420

Hi,

So what do you mean by "it's not working" ?
The code looks good to me.
Do you get an error ?
Is $cart not filled with all the data of the cart ?

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

  • Posts: 23
  • Thank you received: 0
7 years 7 months ago #266612

Thank for ur info, Nicolas.

I am not getting any error but Load the full cart time system hanged. If any other possibility to get the order amount in Checkout page. on before order creation.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 7 months ago #266616

Hello,

The function needCC is called by "onPaymentDisplay".
That method receive the cart in his parameters.

So, in your override of the function "onPaymentDisplay", you can simply store the $order in reference within the plugin variables before the call of the parent method.
Then in your "needCC" you will have the order.
And about the currency (and currency_id), you already have it in the plugin variables.

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.

Time to create page: 0.043 seconds
Powered by Kunena Forum