If someone orders 1x a product at some point between “checkout” and “order_info” in the sample files with CTv2.2 the inventory of the item gets reduced by double (in this case 2).

Why does it think it needs to reduce the inventory by 2x the ordered amount?


EE 2.5.3 CT 2.2.2

  • Has this only just started happening since 2.2? Is there any more information you can give us as to when this started happening? What have you tried so far to resolve the issue? – Adrian Macneil Nov 23 '12 at 6:51
  • Can you show us the code you are using to generate the checkout form(s). – foamcow Nov 23 '12 at 9:07
  • @adrian » This is our first use of CT so we have no comparison to prior versions. – Mike Dexter Nov 23 '12 at 10:24
  • @foamcow » not sure how to post sample code. Seems to be character limits on posts. – Mike Dexter Nov 23 '12 at 10:28
  • Could you use pastebin.com and post the link to you paste here? – foamcow Nov 23 '12 at 11:09

It would appear that there is a bug in CartThrob 2.2 with regards to managing inventory: http://cartthrob.com/forums/viewthread/7374/

how to reproduce the error


I think you need to look at the code you are using for the add to cart bit.

Normally, with CartThrob, you would use {exp:cartthrob:add_to_cart_form} to do the "buy now" bit.

If you look at the docs for this tag pair...


You will see that you can specify a quantity parameter in the tag pair. However, you can also add a form field to allow for custom quantities - i.e. you can add more than 1 product at a time to your cart.

I may well be wrong, but I have a feeling you have both the quantity parameter AND a quantity field. Just a hunch. To be honest I don't know what would happen if you did but it's my best guess with the info so far.

  • I have stripped my add to cart page down to nothing, and only used the CT sample code from the docs (pastebin.com/YdVsb1g5). It still updates the inventory by double what was actually bought. – Mike Dexter Nov 23 '12 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.