Add to cart Quantity reset to 0

  • Posts: 1055
  • Thank you received: 11
  • Hikashop Business
8 months 3 weeks ago #359399

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 3.10.12

Hi!

Is it possible, when a user adds to cart more quantity that is not available, the quantity to reset to 0 instead of showing the number of items available?

For example,

A product has 700 quantity, the user adds 750 to cart and they get the message "The maximum quantity possible for that product is %s" and then Hikashop adds to the cart all the available quantity. I would like for it to reset the number to 0 so the user cannot see how much stock is available.

Thank you

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 months 3 weeks ago #359403

Hi,

There is no option for that. Doing it would require developing a plugin to cancel the add to cart when the quantity requested exceeds the stock.
There are three things which might help you besides developing a custom plugin :
- in each product, you have the "quantity input" setting which allows you to restrict what the customer can choose to add to the cart if set to "show select". So that would make it impossible for someone to add a few hundred products at once.
- In each product, you can use the "quantity per order" setting to set a maximum of quantity purchasable per order. So if you set 20 in there, this limitation will kick in unless the stock is below 20. So if you have a product you have a lot of stock of and people normally don't purchase more than a few, this would allow you to prevent them from discovering the stock.
- You could change the text of the error message "The maximum quantity possible for that product is %s" with a translation override and remove the %s. For example, you could have instead the text "You tried to add too much quantity. The quantity of the product in the cart has been automatically reduced to the maximum authorized". That way, it doesn't tell the customer that the whole stock is in the cart, nor what the amount of the total stock is.

The following user(s) said Thank You: verzevoul

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

Time to create page: 0.053 seconds
Powered by Kunena Forum