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

Update ECE deafult button and button position in shortcode cart page #3586

Merged
merged 5 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/admin/stripe-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
'label' => __( 'Button Type', 'woocommerce-gateway-stripe' ),
'type' => 'select',
'description' => __( 'Select the button type you would like to show.', 'woocommerce-gateway-stripe' ),
'default' => 'buy',
'default' => 'default',
'desc_tip' => true,
'options' => [
'default' => __( 'Default', 'woocommerce-gateway-stripe' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function init() {
add_action( 'wp_enqueue_scripts', [ $this, 'scripts' ] );

add_action( 'woocommerce_after_add_to_cart_form', [ $this, 'display_express_checkout_button_html' ], 1 );
add_action( 'woocommerce_proceed_to_checkout', [ $this, 'display_express_checkout_button_html' ] );
add_action( 'woocommerce_proceed_to_checkout', [ $this, 'display_express_checkout_button_html' ], 20 );
add_action( 'woocommerce_checkout_before_customer_details', [ $this, 'display_express_checkout_button_html' ], 1 );
add_action( 'woocommerce_pay_order_before_payment', [ $this, 'display_express_checkout_button_html' ], 1 );

Expand Down Expand Up @@ -403,18 +403,14 @@ public function display_express_checkout_button_html() {
* Display express checkout button separator.
*/
public function display_express_checkout_button_separator_html() {
if ( ! is_checkout() && ! is_cart() && ! is_wc_endpoint_url( 'order-pay' ) ) {
if ( ! is_checkout() && ! is_wc_endpoint_url( 'order-pay' ) ) {
return;
}

if ( is_checkout() && ! in_array( 'checkout', $this->express_checkout_helper->get_button_locations(), true ) ) {
return;
}

if ( is_cart() && ! in_array( 'cart', $this->express_checkout_helper->get_button_locations(), true ) ) {
return;
}

?>
<p id="wc-stripe-express-checkout-button-separator" style="margin-top:1.5em;text-align:center;display:none;">&mdash; <?php esc_html_e( 'OR', 'woocommerce-gateway-stripe' ); ?> &mdash;</p>
<?php
Expand Down
Loading