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 attached patch hopes to address the @todo "Rework this function to support any number of Express Checkout rules."
Currently the module looks at/for the explicit default Commerce PayPal EC Rule named "commerce_payment_paypal_ec" to determine if the module is enabled (via commerce_paypal_ec_enabled()).
In my use case, this prevents the display of the "Checkout with PayPal" button on the cart page when some orders (non-default currency, non-default country) need to use an alternate PayPal account (a custom PayPal EC rule).
Thanks!
Comment | File | Size | Author |
---|---|---|---|
commerce_paypal_ec-multiple_rules.patch | 1.57 KB | krlucas | |
Comments
Comment #1
chrisrockwell CreditAttribution: chrisrockwell commentedHey krlucas, have you implemented this in production at all? Especially with Domain, this is pretty critical functionality.
Comment #2
chrisrockwell CreditAttribution: chrisrockwell commentedJust a quick heads-up. This patch addresses your issue, but I think another issue is when someone is using a multi-site setup and different sites need to use different Paypal Express accounts.
So, in addition to your modifications to `commerce_paypal_ec_enabled()` some changes to `commerce_paypal_ec_form_alter()` are necessary as the rule is hardcoded there as well.
The rough fix is:
I'll clean this up and submit a proper patch and, combined, they should address the major use cases.