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.
The "Shipping line item exists" rule currently allows checking to see if the shipping line item is for a single selected shipping service. This can get cumbersome if you want a rule that works for some (more than one, but not all) of the shipping services as you currently have to add this rules condition multiple times and wrap the conditions in an Or.
Comment | File | Size | Author |
---|---|---|---|
#2 | rules_shipping_exists_allow_multiple_provider_comparison-2801553-2.patch | 1.7 KB | anemirovsky |
Comments
Comment #2
anemirovsky CreditAttribution: anemirovsky at Giant Rabbit, LLC commentedThis patch adds the ability to compare to multiple shipping services in one "Shipping line item exists" rules condition.
Comment #3
das-peter CreditAttribution: das-peter at Cando commentedI like the idea, but what about existing rules? Did you check if existing rules continue to work or if a re-save or something similar is needed?
We could use a parameter check like following to make it backward compatible:
$services = (is_array($services)) ? $services : array($services);
.But I'm not sure how rules behaves if you just change the parameter type.