Closed lamdd1345 closed 4 years ago
Hi @lamdd1345!
Thanks for reaching out. We don't currently have a setting or option that would allow you to do this.
To achieve this, you could write some custom PHP or JavaScript code. While we don't provide support for customizations, if you're comfortable editing your theme's functions.php
file or adding custom code to your site, something along the following lines should do the trick:
<?php
add_action( 'woocommerce_proceed_to_checkout', function() {
if ( ! function_exists( 'wc_gateway_ppec' ) || ! has_action( current_action(), 'woocommerce_button_proceed_to_checkout' ) ) {
return;
}
remove_action( current_action(), 'woocommerce_button_proceed_to_checkout', 20 );
remove_action( current_action(), array( wc_gateway_ppec()->cart, 'display_paypal_button' ), 20 );
wc_gateway_ppec()->cart->display_paypal_button();
add_action( current_action(), 'woocommerce_button_proceed_to_checkout', 20 );
}, 10 );
Use at your own risk.
Thanks! It really works!!
I want to place the smart paypal button top of the proceed to checkout button on cart page, how can I change the code to make it possible? It's now on the bottom of the "proceed to checkout" button.