The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Using quantity with quantity_min

dariodario Member
in General edited October 2014
Hello
Apparently I can set the quantity of the product in the cart if it has a parent and a quantity_min set.
So for instance a call like

..&name=child&price=10&parent_code=1&quantity=2..

will add in the cart 2 items "child" with the exact quantity (2).

If in the same call I specify quantity_min, the quantity is send correctly but the cart shows always quantity=1

..&name=child&price=10&parent_code=1&quantity=2&quantity_min=1

I need to specifiy the min_quantity so that the child product can't be removed from the cart (one would have to remove its parent)
Any help?

Thanks



Comments
  • fc_adamfc_adam FoxyCart Team
    @dario,

    That's correct. Currently when you lock a child product to a parent - by setting "quantity_min=1", the child product will be locked to having the same quantity as the parent. Something our documentation didn't mention - and I've just updated it to show more detail - but you can set "quantity_min" to be any number you need for that child product to be.

    So for your example, for every parent product, if you need to have 2 of the child product, you can set "quantity_min=2". That will make it that if someone orders 2 of the parent product, the quantity of the child product will be 4.

    At this stage it's currently not possible to have a child locked (and not removable), but still have an editable quantity value.

    You can see the updated documentation here: https://wiki.foxycart.com/v/2.0/products?&#product_grouping_bundling_ensembles
  • I ended up in passing the same value for quantity and quantity_min everytime I add a children element to the shop.
    Thanks
Sign In or Register to comment.