Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I'm using Ubercart (new user) to sell memberships. I want to limit the quantity of «product» to 1. Moreover, when a user adds a new product, I would like any previous product in the cart to be removed, so even if the user makes a mistake, he/she ends up with only one role.
There the restrict_qty module does not seem to work (WSOD). Can this be achieved with Rules? If so, how?
Thanks for your help.
NG
Comments
Comment #1
TR CreditAttribution: TR commentedNo, Rules are not a good way, because quantity can be set/changed in several places. The best way to do this is with code like uc_restrict_qty. If that module doesn't work for you, please help out in the issue queue for that module.
Comment #2
longwaveHowever, this is certainly possible with Rules, but may not work with all contrib modules (those that do not handle cart items using the Entity API)
You can restrict the quantity for one specific product by adding a condition to compare the node ID property.
Comment #3
Northern_Girl CreditAttribution: Northern_Girl commentedThanks!
But I have missed something because items keeps piling up in the cart.
And what will happen if a user adds a different role say one week before the end of a membership? Is this managed by uc_roles or should Rules be used?
Sorry for these "ubercart newbe questions"
NG