If you need to check individual product to check whether the product is qty is 10 on cat or not. as below code
controller/product.php
$cart_product_detail=$this->cart->getProducts();
//print_r($cart_product_detail);
$data['cart_product_info']=array();
foreach($cart_product_detail as $cart_info){
//print_r($cart_info);
$data['cart_product_info'][] = array(
'cart_product_id' => $cart_info['product_id'],
'cart_product_qty' => $cart_info['quantity']
);
on product.tpl
<?php //print_r($cart_product_info);
$current_product=$product_id;
$cart_quantity=0;
foreach($cart_product_info as $cart_prod):
if($current_product==$cart_prod['cart_product_id']){
$cart_quantity=$cart_prod['cart_product_qty'];
}else{
$cart_quantity=0;
}
endforeach;
//$product_qty=$product_qty-$cart_quantity;
?>
<?php if($cart_quantity<10):?>
<button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $button_cart; ?></button>
<?php endif;?>
나는 이미 장바구니에 항목을 계산하는 방법을 알고 가정
if you need to check total quantity of car no mather the which prodcuct then
product.php
$data['total_product_cart']=$this->cart->countProducts();
product.tpl
<?php if($total_product_cart>10):?>
<button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $button_cart; ?></button>
<?php else:?>
<button type="button" ><?php echo $button_cart; ?></button>
<?php endif;?>
or you can use in any page where you like to disable the add to cart button. once you get the total product in cart you can disable add to cart button in various way
yous on product.php and where you need then you will get total product and make the decision
같은 자바 스크립트 문이 확실히 가능하다 할 경우 는 .. : –
@AliZia 당신은, 그것을 어떻게 제발 말할 수 있습니까? 고맙습니다. – Nancy