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 have a rule that fires when my user clicks the Checkout button; however, a user who clicks Checkout with PayPal button circumvents this rule.
My rule checks to see that if a user has put product X in his cart, he also has product Y and, if he doesn't, he's redirected to product Y's product node so he can add it.
Can you suggest a workaround?
Comment | File | Size | Author |
---|---|---|---|
#3 | 2202913-paypal-checkout-rules.patch | 690 bytes | longwave |
|
Comments
Comment #1
TR CreditAttribution: TR commentedThe PayPal module has three distinct payment methods. Are you perhaps referring to the PayPal Express Checkout button that shows up on the /cart page? PayPal Express does bypass the Ubercart checkout page - that's the whole point of using it. Maybe you can trigger on product X being added to the cart, or even automatically add Y to the cart whenever X is added to the cart.
Comment #2
stevengraff CreditAttribution: stevengraff commentedProbaby, yes to "PayPal Express" though I didn't know, since it doesn't say PayPal Express.
It's here: http://screencast.com/t/AbTsBM9rDT
Triggering on product X being added, but the product Y is only needed once regardless of product x, a, and b all being added.
Also, can you give me a clue as to how to "automatically add Y to the cart whenever X is added to the cart?" I am doing it now with cart links, but that bypasses so-called "required" attributes. I tried using Product Kits but discounts (i.e. Coupons) don't get applied right.
Comment #3
longwaveThe attached patch fires the "Customer starts checkout" event when the PayPal Express Checkout button is clicked; please test this patch and let us know if it works for you.
Comment #4
stevengraff CreditAttribution: stevengraff commentedThanks, but... the patch did not seem to make any difference. The visitor is taken immediately to PayPal, whereas, if he were to click the normal checkout button he'd be redirected, as per the rule.
Comment #5
longwaveWhat conditions do you have attached to your rule? Can you try disabling all conditions so the redirect always fires, and see if that works?
Comment #6
stevengraff CreditAttribution: stevengraff commentedI will try your request... meantime, here's a screenshot:
http://screencast.com/t/HbYSSIJFV9a
Comment #7
stevengraff CreditAttribution: stevengraff commentedSorry, even with all the conditions removed, clicking the Checkout with Paypal button fails to fire the rule... I'm taken, instead, directly to the Paypal login screen.
Comment #8
TR CreditAttribution: TR commentedComment #9
TR CreditAttribution: TR commentedI don't see anything wrong with #3. The patch still applies and the test passes.
@stevengraff: If your conditions/actions are correct then it should work. The Event is definitely fired before the request is sent to PayPal. Perhaps your cache needed to be cleared after changing the Rule.
Regardless, moving this back to "Needs review" - if someone can test this we can put this change into Ubercart 7.x and 8.x.