Skip to content

Commit c97f908

Browse files
authored
Update ECE deafult button and button position in shortcode cart page (#3586)
* set the default Express Checkout button label to 'Icon only' * correct placement for ECE buttons on shortcode cart page * add changelog
1 parent c6de842 commit c97f908

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Tweak - Do not load ECE button if the total amount is 0.
2020
* Add - Show ECE button preview on settings page.
2121
* Tweak - Remove the subscription order notes added each time a source wasn't migrated.
22+
* Tweak - Update ECE default button type.
23+
* Fix - Fix position of ECE button on shortcode cart page.
2224

2325
= 8.8.2 - 2024-11-07 =
2426
* Fix - Prevent marking renewal orders as processing/completed multiple times due to handling the Stripe webhook in parallel.

includes/admin/stripe-settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
'label' => __( 'Button Type', 'woocommerce-gateway-stripe' ),
139139
'type' => 'select',
140140
'description' => __( 'Select the button type you would like to show.', 'woocommerce-gateway-stripe' ),
141-
'default' => 'buy',
141+
'default' => 'default',
142142
'desc_tip' => true,
143143
'options' => [
144144
'default' => __( 'Default', 'woocommerce-gateway-stripe' ),

includes/payment-methods/class-wc-stripe-express-checkout-element.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function init() {
9191
add_action( 'wp_enqueue_scripts', [ $this, 'scripts' ] );
9292

9393
add_action( 'woocommerce_after_add_to_cart_form', [ $this, 'display_express_checkout_button_html' ], 1 );
94-
add_action( 'woocommerce_proceed_to_checkout', [ $this, 'display_express_checkout_button_html' ] );
94+
add_action( 'woocommerce_proceed_to_checkout', [ $this, 'display_express_checkout_button_html' ], 20 );
9595
add_action( 'woocommerce_checkout_before_customer_details', [ $this, 'display_express_checkout_button_html' ], 1 );
9696
add_action( 'woocommerce_pay_order_before_payment', [ $this, 'display_express_checkout_button_html' ], 1 );
9797

@@ -403,18 +403,14 @@ public function display_express_checkout_button_html() {
403403
* Display express checkout button separator.
404404
*/
405405
public function display_express_checkout_button_separator_html() {
406-
if ( ! is_checkout() && ! is_cart() && ! is_wc_endpoint_url( 'order-pay' ) ) {
406+
if ( ! is_checkout() && ! is_wc_endpoint_url( 'order-pay' ) ) {
407407
return;
408408
}
409409

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

414-
if ( is_cart() && ! in_array( 'cart', $this->express_checkout_helper->get_button_locations(), true ) ) {
415-
return;
416-
}
417-
418414
?>
419415
<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>
420416
<?php

readme.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
129129
* Tweak - Do not load ECE button if the total amount is 0.
130130
* Add - Show ECE button preview on settings page.
131131
* Tweak - Remove the subscription order notes added each time a source wasn't migrated.
132+
* Tweak - Update ECE default button type.
133+
* Fix - Fix position of ECE button on shortcode cart page.
132134

133135
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)