recuperer dans step ou payment le product_quantity

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 4 months ago #58203

Bonjour

comment faire pour récupérer dans ./templates/TPL/html/com_hikashop/checkout/payment.php le product_quantity de chaque produit, pas la quantite de produits dans le cart mais bien le stock des produits ?

Je ne veux pas afficher toutes les méthodes de paiement si un seul produit n'est pas un stock

j'ai essaye avec

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

foreach($cart->products as $product){
... $product->product_quantity
}

mais ça ne ramène rien


merci

Last edit: 12 years 4 months ago by erickb.

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
12 years 4 months ago #58265

comme cela:

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

foreach($cart->products as $product){
$productClass = hikashop_get('class.product');
$productData = $productClass->get($product->product_id);
echo $productData->product_quantity;
}

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

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 4 months ago #58272

merci

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

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 4 months ago #58284

Undefined property: hikashopCartClass::$products in ./templates/TPL/html/com_hikashop/checkout/payment.php on line 30

ligne 30 = foreach($cart->products as $product)

Last edit: 12 years 4 months ago by erickb.

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

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 4 months ago #58285

je l'ai avec $cart = $cartClass->loadFullCart(true,false);

$stockzero = 1;

$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart(true,false);

foreach($cart->products as $product){
	if($product->product_quantity  <= 1000){
		$stockzero = 0;
		break;		
	}
}
echo $stockzero ;

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

Time to create page: 0.059 seconds
Powered by Kunena Forum