Recuperer le total et les produits dans un module

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 1 month ago #76630

Bonjour

Comment je recupere le total du panier TTC ( hors transport) dans un module ? ainsi que l'id des produits deja dans le panier ?

$class = hikashop_get('class.cart');
ou
$class = hikashop_get('class.order');

ensuite
$total = $class->get($this->element->???);



Il me faut aussi dans le cart savoir le category_id des produits


merci

Last edit: 12 years 1 month ago by erickb.

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

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
12 years 1 month ago #76787

Bonsoir,

$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart(true);
// $cart->products
// $cart->total

Cordialement,


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: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 1 month ago #76799

echo $cart->total; je plante

je le recupere avec

$cartClass = hikashop_get('class.cart');
 $cart = $cartClass->loadFullCart(true);
$fulltotal = $cart->full_total;
 $prices = $fulltotal->prices[0]->price_value;

il n'y a pas plus simple ?

merci

Last edit: 12 years 1 month ago by erickb.

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

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
12 years 1 month ago #76842

Bonsoir,

Il y a une variable "total" dans la fonction loadFullCart, je me suis basé rapidement sur le code de la fonction sans faire de test.
La récupération ne peut pas passer en dessous des 3 étapes suivantes :

$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart(true);
$price = $cart->full_total->prices[0]->price_value;

Cordialement,


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: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 1 month ago #76875

merci

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

Time to create page: 0.061 seconds
Powered by Kunena Forum