-
-
Save InpsydeNiklas/202837609318f9c0e827c382787147b0 to your computer and use it in GitHub Desktop.
add_filter('woocommerce_paypal_payments_single_product_renderer_hook', function() { | |
return 'woocommerce_after_add_to_cart_form'; | |
}); |
Thanks @InpsydeNiklas for the detailed explanation, maybe a workaround in the future is to add an optional shortcode that can be inserted easily with Elementor or other page builders. Just a suggestion.
The snippet works well for me and all is good. Thanks for the great work provided to this great plugin, it has improved a lot.
In version 2.1.0 and newer, this filter was implemented in the core plugin and activates automatically either when Divi is the active (parent) theme or the Elementor Pro plugin is active: woocommerce/woocommerce-paypal-payments#1254
So there may be a small number of users that suddenly notice a slight change in the button placement on the single product page if they have the Elementor Pro plugin active, but don't actually use it to build a custom single product page.
There may still be other page builders or custom themes which would still benefit from manually adding the filter. But the majority of reports about incorrect button placement on single product should ideally be resolved by this.
But the majority of reports about incorrect button placement on single product should ideally be resolved by this.
Majority is #1 Gutenberg + FSE and it isn't show properly ;/ Add option to enable this in panel as placement adjust so anybody can easily use that change
For reasons I can't disclose, originally, the decision was made to use the
woocommerce_single_product_summary hook
. This is different from the previously popular PayPal integration and while it works in most cases, there can be issues with certain page builders or themes as the feedback on this gist suggests.There are other ways to work around this from the Elementor plugin point of view, but the PayPal Payments render hooks were introduced, in part, to provide an easy-to-apply solution for problems of this kind.
Changing defaults can be a dicey topic as these impact (almost) all users, and this item is fairly low on the to-do list, but I wouldn't rule it out. Please don't get me wrong, but I'd also like to point out that I'm not seeing anything that prevents Elementor from providing dedicated compatibility with PayPal Payments 😇 @ahmedzeidan