Limiting a sale to 1, 2, 3, 6 and 12 quantities...

  • Posts: 108
  • Thank you received: 0
11 years 8 months ago #92732

Salut/Hello,

I have a new customer that is requiring that customers be able to order their product only in the quantities of: 1, 2, 3, 6, and 12.
[meaning NOT 4, 5, 7, 8, 9, 10, or 11, or 13+]

So, how would one do that exactly...

I'm figuring I can do that via shipping rules and modifying the string
'The cart items combined weight is too big for all the possible shipping methods' to say something like:
'Our products can only be ordered in the quantity of 1, 2, 3, 6, and 12 jars'

BUT to make things a 'bit' more fun/interesting, she wants special pricing that goes like this:

1 and 2 jars - $ 15 a piece
3 jars - $ 14 a piece
6 jars - $ 13 a piece
12 jars - $ 12 a piece...

So how do I set it up so that the customer can do a mix match to satisfy the above requirements?

[auto-loaded coupon codes perhaps?]

Thanks, Merci,

Cheers,

Emmanuel.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #92838

Hi,

You can see some documentation on how to edit the quantity button here:
www.hikashop.com/fr/support/documentatio...tation.html#override

For the quantity input:

You need to create the file templates/YOUR_TEMPLATE/html/hikashop_button.php. We invite you to look at the file administrator/components/com_hikashop/helpers/cart.php for the default code of the function you will define in it. In that file, you will be able to define the function:

hikashop_quantity_render($html,$i,$max_quantity,$min_quantity) => The $html variable will contain the HTML of the "add to cart" button, the $i variable will contain a unique int which will be different for each quantity input on the page, the $max_quantity and $min_quantity will contain the min and max quantity possible for the product. You need to return the whole HTML at the end of your function.

Also, please note that it only works if the option for "Display the quantity field on the product page" is set to "Ajax Input" in the configuration of HikaShop.


You have to create an override, in this override change the input quantity field to a dropdown with the desired values.
The same modification is required in the view "checkout / cart" too.

Then on the product edition page, you can add many prices and set a minimum quantity for these prices. This should match with your customer requests.

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

  • Posts: 108
  • Thank you received: 0
11 years 8 months ago #92930

Salut Xavier,

I appreciate the answer but isn't there any way to do this w/o having to use overrides/modify the standard Hikashop installation?

Using a combination of shipping method trickery and auto-loading coupons?

Cheers,

Emmanuel.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #93042

Salut,

To set a different price, it can be possible. But to restrict the number of items.. I don't really see a solution.
And if it's possible it's not user friendly, the customer will have to go to the checkout to see that he can't purchase this number of products, so go back to product page to change, etc ..

I really think that this little override is the best solution.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum