Minimal quantity of product to order

  • Posts: 141
  • Thank you received: 1
  • Hikashop Business
2 weeks 4 days ago #309473

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.10
-- PHP version -- : 7

Hi,

How to enable the setting to add products to the cart not by one thing, but by how much you install in the product?

For example, it has product, the price is indicated per piece, while it is sold in packages of only 100 pieces.
Moreover, if people add this product to the basket, they will add 100, 200, 300, and so on.

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

  • Posts: 12090
  • Thank you received: 1666
  • MODERATOR
2 weeks 3 days ago #309478

Hello,

You'll probably find a solution through that thread :

There is now a "show select price" choice for the "quantity input" setting of the products so that the dropdown can be based on the minimum quantities of your product prices.
So enter the different unit prices (which can be the same) and their respective minimum quantities in the Prices section and the system will base itself on them to display the quantity dropdown.


www.hikashop.com/forum/product-category-...-listing.html#243656

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

  • Posts: 141
  • Thank you received: 1
  • Hikashop Business
2 weeks 3 days ago #309513

this theme is too dificult

is any solution like <input type="number" step="step_number"> there i can choose step_number in
product page backoffice ?

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

  • Posts: 12090
  • Thank you received: 1666
  • MODERATOR
2 weeks 2 days ago #309516

Hello,

That kind of solution will require custom development, can you give us more information about what you want and why ? So that we can properly advise you ? Thank you.

Kind regards,
Mohamed Thelji.

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

  • Posts: 141
  • Thank you received: 1
  • Hikashop Business
2 weeks 1 day ago #309649

Mohamed Thelji wrote: Hello,

That kind of solution will require custom development, can you give us more information about what you want and why ? So that we can properly advise you ? Thank you.

Kind regards,
Mohamed Thelji.


I want to make sure that the basket is added immediately
the quantity of goods is a multiple of how much will be indicated in the product settings. for example, immediately 20, 50, 200, 1000 pieces, etc.
and if you set 20 pc per step only 20, 40, 60, 80 etc will be added in to basket.

This is necessary cauz some goods are sold only in packages, but from the data source information about them is stored in pieces and the price is indicated for a piece, not for a package. But a package may include more than 1 pc, for ex. 100 pcs, so it have to be
100, 200, 300 , 400 etc pcs to cart , but user (buyer) may not understand about it, i mean you cant add 102 pcs of such product into cart.

in other words, we sell some goods only in bulk, do not sell at retail.

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

  • Posts: 66619
  • Thank you received: 9806
  • MODERATOR
2 weeks 1 day ago #309655

Hi,

If you use "show select" in the "quantity input method" setting and enter the minimum quantity per order to 100, then the quantity input field will automatically be 100,200,300,400,etc
This should do what you need I think.

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

  • Posts: 141
  • Thank you received: 1
  • Hikashop Business
2 weeks 20 hours ago #309677

nicolas wrote: Hi,

If you use "show select" in the "quantity input method" setting and enter the minimum quantity per order to 100, then the quantity input field will automatically be 100,200,300,400,etc
This should do what you need I think.


it is inconvenient, caus "show select" in the "quantity input method" change all web site view
from html5 input to select input.

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

  • Posts: 66619
  • Thank you received: 9806
  • MODERATOR
2 weeks 11 hours ago #309691

In that case, you want to edit the file "quantity" of the view "layouts" via the menu Display>Views and customize the display of the quantity input to meet your needs.

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

  • Posts: 141
  • Thank you received: 1
  • Hikashop Business
1 week 4 days ago #309753

nicolas wrote: In that case, you want to edit the file "quantity" of the view "layouts" via the menu Display>Views and customize the display of the quantity input to meet your needs.


do you mean like i may try to make custom field and after include into quantity.php like if this custom field is like i need
show input with step ?

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

  • Posts: 12090
  • Thank you received: 1666
  • MODERATOR
1 week 3 days ago #309765

Hello,

I'm sorry but I didn't fully understand what you meant through your last message.
Nicolas only advised your to edit the code of the "quantity" file of the "layouts" view of your front-end template, through the page "Hikashop->Display->Views", so that you could change the displaying of the dropdown according to your needs.

Editing these line will do the job :

	case 'show_select':
		if(empty($max_quantity))
			$max_quantity = (int)$min_quantity * 15;
?>
		<div class="hikashop_product_quantity_div hikashop_product_quantity_input_div_select"><?php
			$r = range($min_quantity, $max_quantity, $min_quantity);
			if(!in_array($current_quantity, $r))
				$r[] = $current_quantity;
			if(!in_array($max_quantity, $r))
				$r[] = $max_quantity;
			$values = array_combine($r, $r);
			ksort($values);
			echo JHTML::_('select.genericlist', $values, '', 'style="width:auto;" class="no-chzn" onchange="var el = document.getElementById(\''.$id.'\'); el.value = this.value; el.onchange();"', 'value', 'text', $current_quantity, $id.'_select');
			?>
			<input id="<?php echo $id; ?>" type="hidden" value="<?php echo $current_quantity; ?>" class="hikashop_product_quantity_field" name="<?php echo $quantity_fieldname; ?>" data-hk-qty-old="<?php echo $current_quantity; ?>" data-hk-qty-min="<?php echo $min_quantity; ?>" data-hk-qty-max="<?php echo $max_quantity; ?>" onchange="<?php echo $script; ?>" <?php echo $extra_data; ?> />
		</div>
<?php
		break;
We wish you a nice day !
Kind regards,
Mohamed Thelji.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum