Skip to main content

Limit order of a product to 1

More
14 years 5 months ago #47356 by actlas
I would like to limit the maximum amount of certain products ordered to 1.

How can I remove the quantity selection box from those products.
It shouldn't be displayed as they can only order 1 piece...

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

More
14 years 5 months ago #47602 by Xavier
Hi actlas,


Edit the view: HikaShop > Display > Views, "Product / quantity.php".

And replace the lines:
Code:
<div class="hikashop_product_stock"> <?php echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'ok',$this->params,$url,$this->ajax,'',$this->row->product_max_per_order,$this->row->product_min_per_order);
By:
Code:
<div class="hikashop_product_stock"> <?php if($this->element->main->product_max_per_order == '1'){ echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'ok',$this->params,$url,$this->ajax,'',$this->row->product_max_per_order,$this->row->product_min_per_order); }else{ echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$this->row->product_max_per_order,$this->row->product_min_per_order); }
The following user(s) said Thank You: actlas

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

More
14 years 5 months ago #47823 by actlas
The add to cart button also disappears this way.
It also says there are no products in stock anymore although there are 3.

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

More
14 years 5 months ago #47943 by nicolas
In each product, you will find an option called "Maximum quantity per order" that you can use for what you want to do.

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

Time to create page: 0.218 seconds
Powered by Kunena Forum