Page 1 of 1

Limit number of downloadable products to 1 each

Posted: Thu Oct 21, 2021 1:36 pm
by 14Steve14
I sell lots of downloads and at times customers seem to order more than one of each product even though there is a box on the product page that gives simple instructions like 'Please ensure that all downloadable kits and texture sheets are set to '1' in the 'Quantity' column in your shopping cart.' I then have to mess about and refund customers for the extra files they paid for, even though I don't think I should.

I know some customers are in a hurry to buy something and don't take the time to read what is on the product pages, so I was wondering if there is a simple and easy way to limit the number of downloadable products that can be added to a cart to one of each download. This may not be so simple as several pages could be affected, and there may be a need to remove the product quantity box from the download pages.

Any ideas on the best and easiest way to achieve something.

Re: Limit number of downloadable products to 1 each

Posted: Thu Oct 21, 2021 2:05 pm
by ecartz
Hook on the checkout page that checks if the order is virtual or mixed content type. If so, iterate through the products to find which are downloadable. If any of those have a quantity greater than one, redirect to the shopping cart page with a message that the quantity is wrong. And/or update the quantity.

It would be possible to only update the quantity, but I would think that you'd want to message the change. So update the quantity and add a messageStack about the change in quantity.

Just messaging would be a little easier to implement but might lead to buyer frustration. And it wouldn't be that much easier.

That would be the easiest to implement. More complicated would be to add a hook prior to the cart update actions that validates the quantity. That would be better in that it would catch problems earlier, but you probably still need the checkout validation just in case.

Re: Limit number of downloadable products to 1 each

Posted: Thu Oct 21, 2021 2:25 pm
by LeeFoster
@14Steve14

I created a hook that hides the qty input box on items based on a check box on the admin/product page since a lot of my items are 1 offs.

Re: Limit number of downloadable products to 1 each

Posted: Thu Oct 21, 2021 4:24 pm
by raiwa
LeeFoster wrote: Thu Oct 21, 2021 2:25 pm @14Steve14

I created a hook that hides the qty input box on items based on a check box on the admin/product page since a lot of my items are 1 offs.
Then they can still add the same product twice (or more) which will also result in Qty. = 2 (or more)

Re: Limit number of downloadable products to 1 each

Posted: Fri Oct 22, 2021 2:32 pm
by 14Steve14
LeeFoster wrote: Thu Oct 21, 2021 2:25 pm @14Steve14

I created a hook that hides the qty input box on items based on a check box on the admin/product page since a lot of my items are 1 offs.
How do you then stop them adding further items when they are in the shopping cart page?

Re: Limit number of downloadable products to 1 each

Posted: Fri Oct 22, 2021 3:20 pm
by LeeFoster
14Steve14 wrote: Fri Oct 22, 2021 2:32 pm
LeeFoster wrote: Thu Oct 21, 2021 2:25 pm @14Steve14

I created a hook that hides the qty input box on items based on a check box on the admin/product page since a lot of my items are 1 offs.
How do you then stop them adding further items when they are in the shopping cart page?
Not gotten that far with it yet. I had planned to hide it there too but had to switch focus.

Re: Limit number of downloadable products to 1 each

Posted: Sun Oct 24, 2021 12:58 am
by Nigel
Would it be possible to have the items set to one per customer per session ?
Once ordered, the item becomes out of stock for them. The only way to bring it back would be to delete it from the cart.