Product price minimum quantity

  • Posts: 112
  • Thank you received: 0
13 years 5 months ago #19890

Hi,

I can't set minimum quantity for a price to 1 - upon saving it gets set to 0. Is this as per design? What should I do if I need to set min qty to 1?

Thank you.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 5 months ago #19908

The min quantity is indeed 0.
The min quantity 0 and 1 have the same meaning because you cannot have a quantity of 0 for a product in the cart. When you set a quantity of 0 for a product the product is removed from the cart automatically.
That's why you don't need to set a minimum quantity of 1.

Last edit: 13 years 5 months ago by nicolas.

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

  • Posts: 112
  • Thank you received: 0
13 years 4 months ago #19949

Sorry, I don't get it why there minimum quantity can't set to 1. It doesn't make sense to me that I can either have 0 or 2 as minimum. Could you tell me where in the code I can change it? I need to be able to set minimum quantity to 1.

Thank you!

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #19965

If you put 0 in the minimum quantity, HikaShop considers that you put 1. That's why, when you put 1 it changes it to 0. There is nothing to change. It works as you want already.

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

  • Posts: 112
  • Thank you received: 0
13 years 4 months ago #19970

Sorry, I find it very confusing. IMO, zero should mean zero or unlimited, but 1 should mean 1. What does 0 mean in hikashop? I actually need to modify the code where I need to verify if minimum quantity is greater than 0. Any suggestion how I can do this? Thanks.

Last edit: 13 years 4 months ago by lrazov.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #19972

0 can't mean unlimited. How would you have a minimum unlimited quantity ? That would mean that you wouldn't be able to buy the product because you would have to buy an unlimited quantity of it for that, which is not possible since unlimited doesn't have a value and cannot be compared.

There is already a check on the minimum quantity. You cannot have a product with a quantity lower to 1 in the cart in HikaShop. If the user try to set a negative quantity or 0, the product is removed from the cart.

That check is done in the _checkQuantity function of the file administrator/components/com_hikashop/classes/cart.php

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

  • Posts: 112
  • Thank you received: 0
13 years 4 months ago #19974

0 to be unlimited was just a suggestion. 0 to mean 1 like you described is not right either. I needed to do a different type of validation, not in the cart.

I will have to find a way of introducing 1 as minimum quantity. If you could I would suggest reviewing your design and introduce all numbers except negative (0,1,2+) as minimum quantities.

Sorry, love your product, however disagree with this design.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #19976

I don't understand your suggestion. Having a product with a quantity of 0 in the cart makes no sense to me. If the customer wants 0 times a product, it means that it doesn't want it. Thus, the product is removed from the cart.
If you would explain what you're trying to do, maybe I could understand why you would want someone to be able to order 0 times a product...

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

  • Posts: 112
  • Thank you received: 0
13 years 4 months ago #19980

I am not talking about cart. I am talking about back end when you define product price and minimum quantity. I find it strange that I can't set minimum quantity to 1 and when I put 1 it changes to 0. That's all I suggest, allow 1 for minimum quantity, not in cart. The way it works (per your description: If you put 0 in the minimum quantity, HikaShop considers that you put 1. That's why, when you put 1 it changes it to 0. ) is confusing. I just make a suggestion to change so we can put any number including 1 into minimum quantity except negative numbers of course. I hope it makes sense now.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #19984

Ah ok. If it's just that you don't like to see 0 instead of 1 in the listing of prices of a product I understand. It's easy to change.
Just edit the file price of the view product via the menu Display->Views and add the line:
if(empty($row->price_min_quantity)) $row->price_min_quantity = 1;
after the line:
$row =& $this->element->prices[$i];

And you will have 1 instead of 0. The rest of the system will be the same.

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

  • Posts: 112
  • Thank you received: 0
13 years 4 months ago #19988

That's right! Thank you! Glad we understood each other :-)

One more question - how does the system count product availability - quantity? Does take into account order statuses, like created, confirmed, cancelled? Does it add back a quantity to a product if an order gets cancelled?

I also noticed that product quantity is adjusted when an order is created. Is it possible to change that quantity is adjusted when order status is set to confirmed?

Last edit: 13 years 4 months ago by lrazov.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #19989

Yes. The quantity is decremented when the order is created. That's to avoid that two persons order the same product and that you run out of stock for an order with the payment is not immediate like with checks or wire transfers or even with echecks on paypal. When the order is cancelled, the stock is incremented so that other customers can buy again the products. There is also a plugin in the commercial editions to cancel automatically orders not confirmed or shipped after a certain period of time.

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

  • Posts: 112
  • Thank you received: 0
13 years 4 months ago #19990

Excellent! Is that plugin available for essential package or only for business?

Is it possible to change that quantity is adjusted when order status is set to confirmed?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #19991

It's for both editions.

There is no option to change the quantity only when the order is confirmed.

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

  • Posts: 112
  • Thank you received: 0
13 years 4 months ago #19992

Thanks a lot!

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

Time to create page: 0.084 seconds
Powered by Kunena Forum