Limit order of a product to 1

  • Posts: 18
  • Thank you received: 0
12 years 1 month ago #47356

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.

  • Posts: 13201
  • Thank you received: 2322
12 years 4 weeks ago #47602

Hi actlas,


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

And replace the lines:

<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:
<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.

  • Posts: 18
  • Thank you received: 0
12 years 3 weeks ago #47823

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.

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
12 years 3 weeks ago #47943

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.068 seconds
Powered by Kunena Forum