Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Apple Pay is enabled, variable products add to cart issue #195

Closed
roykho opened this issue Mar 19, 2017 · 3 comments
Closed

When Apple Pay is enabled, variable products add to cart issue #195

roykho opened this issue Mar 19, 2017 · 3 comments
Assignees
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Milestone

Comments

@roykho
Copy link
Member

roykho commented Mar 19, 2017

Reported here: https://wordpress.org/support/topic/safari-issue-on-macosx-when-adding-a-variable-product-to-cart/

The quantity of the variable product seems to double when adding to the cart if "Enable redirect to cart when items added" is enabled.

@roykho roykho added priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug. labels Mar 19, 2017
@roykho
Copy link
Member Author

roykho commented Mar 19, 2017

Some notes here: It is quite difficult to have Apple Pay button on the product detail page because upon click of the Apple Pay button, it doesn't allow us to run off to perform some logic before the Apple Pay payment sheet appears. With that being the issue, it forces us to do the logic when Apple Pay is present and when the page loads. Because it creates this cart object in session when page loads, it also simulates the adding of the cart for that item. Otherwise if you click Apple Pay, there would be nothing to pay for.

Recommended resolution for this is to remove Apple Pay completely from product detail page and just have it live on cart/checkout pages. However I will try to see if I can find another way. Perhaps try to create an alternative cart object/session that does not alter the main session.

@roykho roykho added this to the 3.1.4 milestone Mar 19, 2017
@roykho roykho self-assigned this Mar 19, 2017
@jaydisc
Copy link

jaydisc commented Mar 20, 2017

I've tried hooking in to remove the Buy with Apple Pay button on the product detail page with:

remove_action( 'woocommerce_after_add_to_cart_quantity', 'display_apple_pay_button' );
remove_action( 'woocommerce_after_add_to_cart_button', 'display_apple_pay_button' );

Alas, this doesn't work. It seems that the hook is given a custom index on each page load. Is there a workaround we can use in functions.php to hide the button from the product detail page?

@roykho
Copy link
Member Author

roykho commented Mar 20, 2017

Try

remove_action( 'woocommerce_after_add_to_cart_quantity', array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_button' ) );
remove_action( 'woocommerce_after_add_to_cart_button', array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_button' ) );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants