Maybe it is a very specific use case, but I want to use the condition "Order contains specific products", but add extra requirements concerning quantity. So you can define that for example a payment option or shipment option is only available for a specific product, and only for a specific quantity. So three fields are added:
- operator (<, <=, ==, >=, >)
- quantity
- hide if other products are added
(This last option you can use for example: provide a payment option free shipping, that is only available for specific products, and is not available if other products are added to the basket.)
I can understand if this is rejected, but I thought to throw the patch out here so if someone needs it, it is available.
The extra option will alter the original behavior, they are supplemental.
I have not modified the tests to check this behavior.
Comment | File | Size | Author |
---|---|---|---|
#7 | commerce-specific_product_max_quantity_condition-3098889-7.patch | 3.99 KB | JoshaHubbers |
Comments
Comment #2
JoshaHubbers CreditAttribution: JoshaHubbers at iO commentedComment #3
JoshaHubbers CreditAttribution: JoshaHubbers at iO commentedHm, even more rare maybe... I also added the option to evaluate to FALSE if other products besides the selected product are ordered.
Comment #4
JoshaHubbers CreditAttribution: JoshaHubbers at iO commentedComment #5
JoshaHubbers CreditAttribution: JoshaHubbers at iO commentedA new patch. This patch adds an operator options. So you can choose not only a max quantity, but can also choose other operators (<, <=, ==, >=, >).
Comment #6
JoshaHubbers CreditAttribution: JoshaHubbers at iO commentedComment #7
JoshaHubbers CreditAttribution: JoshaHubbers at iO commentedHm, added default setting for the form elements so they don't throw errors if not used.
Comment #10
4kant CreditAttribution: 4kant commentedHi Joshua,
your patch helps me for my usecase - a promotion.
Customers should get a gratuated discount in kind:
The extra items should be listed in the cart, like "normal" purchased items with price 0,- €.
Unfortunately the 3 discount rules overlaped (20 items triggered rule 10 two times + rule 20) - and that gave me a buggy price (e.g. one third of the original price).
With your patch it is possible to trigger the rules distinctly and threrefore get the price as expected.
The patch applied cleanly.
It would be very good to have the same condition to the product variation.
Thanks!
Wiegand