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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TR’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -checkout rules, -paypal

The 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.

stevengraff’s picture

Probaby, 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.

longwave’s picture

Version: 7.x-3.6 » 7.x-3.x-dev
Status: Postponed (maintainer needs more info) » Needs review
FileSize
690 bytes

The 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.

stevengraff’s picture

Thanks, 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.

longwave’s picture

What conditions do you have attached to your rule? Can you try disabling all conditions so the redirect always fires, and see if that works?

stevengraff’s picture

I will try your request... meantime, here's a screenshot:

http://screencast.com/t/HbYSSIJFV9a

stevengraff’s picture

Sorry, 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.

TR’s picture

Category: Bug report » Feature request
Status: Needs review » Needs work
TR’s picture

Component: Cart/checkout » Rules
Status: Needs work » Needs review

I 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.