Minimal quantity

  • Posts: 113
  • Thank you received: 18
9 years 2 weeks ago #243860

I've been monitoring this post as I have the same need - to sell in specific quantities and disallow the user to bypass enforced quantities at the shopping cart.

I think it's very close, but in my case, the modification to "product / show_quantity" posted above makes it so that only a single item appears in the quantity selector in the categories listing - that quantity being the maximum of 10,000, and clicking "Add to cart" only adds 100 to the cart. Perhaps I missed another fix made to raphaelr's site on the back-end. Would it be possible to get the entire content of the current "product / show quantity" as it should be?

I've applied the latest two views posted above, and again only a single quantity appears selector in the cart - which I could actually live with...or perhaps this is related to the above "show_quantity", maybe I don't have the latest.

However, in early testing, it appears that customers can still bypass specified quantities when the cart line items are combined.
For example, I may allow quantities of 100, 250, and 500.
It looks like the customer can order 100, then go back and order 250 of the same item to yield a total of 350 (when these are combined in the cart) - which is not a valid option.

Since specific quantity breaks affect pricing, these items should not be combined in the cart even though they're the same item.

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

  • Posts: 26255
  • Thank you received: 4041
  • MODERATOR
9 years 2 weeks ago #243919

Hi,

In that case, you need to use a custom plugin in order to authorize/modify the product quantity.
In the cart class, you will find a function _checkQuantity and a trigger near the end of that function

$dispatcher->trigger('onAfterProductQuantityCheck', array(&$product, &$wantedQuantity,&$quantity, &$cartContent, &$cart_product_id_for_product, &$displayErrors) );
That trigger allow you to dynamically adapt the product quantity ; you have access to the product (which is currently modified), the request quantity, the final quantity and also the full content of the current cart.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 113
  • Thank you received: 18
9 years 2 weeks ago #243958

Thanks Jerome.

There is still an issue with getting the SELECT PRICE to display correctly in the cart.
As mentioned, only a single item displays in the quantity selector in the cart, and it doesn't necessarily match what was ordered.

Attached is a screenshot of the product page which correctly shows the available quantity breaks, and a screenshot of the cart, which only displays one quantity option in the combobox selector.

Attachments:

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

  • Posts: 84050
  • Thank you received: 13624
  • MODERATOR
9 years 2 weeks ago #243983

Hi,

This looks like a problem with the "cart" file of the "checkout" view.
Do you have the latest version of HikaShop ? If not, you should update.
If you do, try removing the view override for that checkout/cart view file via the menu Display>Views and that should fix the problem.

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

  • Posts: 113
  • Thank you received: 18
9 years 2 weeks ago #243998

I had downloaded and installed the latest yesterday before posting.

When the cart / checkout override is deleted, any value can be entered in a textbox rather than selecting from valid quantities.
The content of this override was from post #243809 above posted by Xavier.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 1 week ago #244192

Hi,

If the customer order a quantity of "100" and then another quantity of "250" for the same product, so by default HikaShop will combine the quantities to have "350" and this is not a valid value for the dropdown.

So the solution would be to have a custom item field for the products, let it hidden but file a random value in it in order to have a different product added to the cart, so you will have one product with a "100" quantity and another with a "250" quantity which are two correct values.

Else you can still remove my code for the view "checkout / cart" and set the input field as not editable thanks to a HTML attribute. That way the product quantity will be "350" and the customer will not be able to change it from the cart of the checkout.

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

  • Posts: 113
  • Thank you received: 18
9 years 1 week ago #244222

I am using a custom field for the customer to upload their artwork that will be used to make the product.
Though the items are not combined in the cart, both have the unit price of the higher quantity.

I added quantity 500 of the product at .46 each, then added 10,000 at .24 each.
In the cart, both items show the unit price of .24

To date, the only solution I've found is to create individual products (or variants) with "Package Size" or "Run Size".
The customer adds quantity 1 of the desired package size (e.g. package of 10,000).
Though this works, it's far from ideal, difficult for the customer to determine the cost each for a given quantity. I can include a table in the product details that has this breakdown, but maintenance when prices change would be very time consuming.

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

  • Posts: 12
  • Thank you received: 0
9 years 1 week ago #244566

Hi,
sorry for the long time without response.

I've made the changes but now i've got a select file with blank lines... and the number of lines seems higher then expected.
Thanks for you help.

Attachments:

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

  • Posts: 84050
  • Thank you received: 13624
  • MODERATOR
9 years 1 week ago #244609

Hi,

The link you had provided before doesn't work: take.ms/S2ze7
And if I add another product to the cart to look at your checkout, I don't have the problem:
take.ms/fBbH2
Could you provide the steps to reproduce the problem ?

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

  • Posts: 12
  • Thank you received: 0
8 years 11 months ago #245295

Hello, thanks for your answer.
Step 1: reach the url : www.avitour.travel/avit-rtk/index.php?Itemid=164&lang=fr
Step 2: enter the credentials i've sent by mail days ago.
Step 3: Click on Avishop - Pochettes plastiques (right menu)
Step 4: add 'Pochette Double' to cart,
Step 5: try to change quantity on checkout page -> Problem the field is not as wanted
Step 6: try to end the order -> Error 500

Thanks.
PS : another problem I can't find how to set different shipping method for a product. For example the pochettes can be sent with 3 different shipping method : Quick & fast / Standard / Cheap and slow
But these 3 solutions are available only for this product and not for the other... I've trie the "shipping method by product" plugin but can't figure how it works...

Last edit: 8 years 11 months ago by raphaelr@alkaonline.be.

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

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

Hi,

For the quantity, please remove the dropdown, in order to have only a non-editable field in the chckout page.
We are currently improving that part and this should be available in the next release.
I can't add the modifications or give you them for now as it involve to many files.

Regarding the 500 error, I don't think it is related, could you post a screenshot of your checkout workflow settings ?

For the shipping methods, does your products have a weight or do you have enabled the option "Force shipping regardless of weight" in Configuration > Checkout > Shipping ?

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

Time to create page: 0.095 seconds
Powered by Kunena Forum