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.
I try to build up a rule condition for different payment methods - in my case bank transfer and paypal. I have 2 different product-types - "normal products" and "file products". File Downloads should be paid via paypal - that means - if you have more than one "file product" in your cart only paypal as a payment is available.
Is it possible to add a rule condition to check for a specific product-type ? I could solve my problem by adding all "file products" to a "Order contains particular product" rule-condition, but that too much work if you have a lot of downloadable products..
Comments
Comment #1
joshmillerAfter seeing what's available with Rules, I would almost guarantee there is a magical combination that will make this rule possible. Less of a feature request and more of a support request. You might try the forums on drupalcommerce.org -- very helpful people hang out there.
Comment #2
SteffenR@joshmiller: thx for your advice - i was looking for such magic combination but couldn't find it - i'll looking forward to the answers i get at drupal commerce forums..
Comment #3
rphillipsfeynman CreditAttribution: rphillipsfeynman commentedHas anyone found a solution for this issue? I need to do exactly the same and I've tried pretty hard to find the "magic solution" but I've had no success so far. Any tip will be welcome. Thanks in advance!
Comment #4
elperuanito CreditAttribution: elperuanito commentedAs they say, there is a module for that. :-D
Check out Commerce Extra Rules Conditions.
Comment #5
rphillipsfeynman CreditAttribution: rphillipsfeynman commentedThanks very much @elperuanito. You're right. I wish I had found that module before I implemented my own rule. :S
Comment #6
lsolesen CreditAttribution: lsolesen commented@rphillipsfeynman Care to share your solution?
Comment #7
rphillipsfeynman CreditAttribution: rphillipsfeynman commentedOfcourse @lsolesen. I'm glad to contribute with this forum since I've taken a lot from it. First, I have to say that I haven't checked if the module Commerce Extra Rules Conditions indeed works but I installed and did check that there is a rule for doing what we want. My solution (which works for me), can be found here http://drupal.org/node/1470862#comment-6467442. I hope it works for you as well.
Comment #8
joshmillerSounds like this is all fixed :D
Comment #10
pedrorocha CreditAttribution: pedrorocha commentedActually, there isnt't a Rule Condition to enable us to do such a comparison, so this question is a Feature Request, still open, and in my opinion, the best place to address it is here, in the main Commerce module itself. The linked comment points to a hack on Commerce Order module, that shouldn't be encouraged.
I made such Condition in a project right now, that has the following code:
I guess it could be the answer or even a starting point.
Comment #11
rszrama CreditAttribution: rszrama commentedYou still could do this in Rules using components. We don't really have a line for how specific we want our conditions to be, so I'm happy to entertain proposals for helper functions, but this one may just open the door to others that can be accomplished without a specific condition. : ?
Perhaps someone can rephrase the title and summarize again what you actually want a condition to do?
Comment #12
bojanz CreditAttribution: bojanz at Centarro for Adapt commented