Skip to content

Commit 7520979

Browse files
authored
Merge pull request #426 from siteorigin/wctb-prevent-cart-overrride
Don't Remove Cart From Checkout Page if WCTB is set to override it
2 parents 7db4b75 + 69eecd3 commit 7520979

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

inc/settings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,8 @@ function siteorigin_north_wc_settings_custom_css( $css ) {
977977
border: 1px solid ${fonts_text_dark};
978978
color: ${fonts_text_dark};
979979
}
980-
.woocommerce table.shop_table .button.checkout-button {
980+
.woocommerce table.shop_table .button.checkout-button,
981+
.woocommerce .so-panel .wc-proceed-to-checkout .checkout-button.button {
981982
background: ${branding_accent};
982983
border: 1px solid ${branding_accent};
983984
}

sass/woocommerce/_cart.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,21 @@
246246
}
247247
}
248248
}
249+
250+
.so-panel .wc-proceed-to-checkout .checkout-button {
251+
background: #c75d5d;
252+
border: 1px solid #c75d5d;
253+
color: #fff;
254+
text-transform: uppercase;
255+
256+
&:focus,
257+
&:hover {
258+
background: #a94346;
259+
border-color: #a94346;
260+
box-shadow: none;
261+
color: #fff;
262+
}
263+
}
249264
}
250265

251266
#mobile-navigation {

woocommerce.css

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

woocommerce/functions.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@ function siteorigin_north_woocommerce_change_hooks(){
1919

2020
// Remove actions in the cart.
2121
remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10 );
22-
remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
22+
if ( class_exists( 'SiteOrigin_Premium_Plugin_WooCommerce_Templates' ) ) {
23+
$so_wc_templates = get_option( 'so-wc-templates' );
24+
if (
25+
! empty( $so_wc_templates['cart'] ) &&
26+
! empty( $so_wc_templates['cart']['active'] )
27+
) {
28+
$prevent_override = true;
29+
}
30+
}
31+
32+
if ( empty( $prevent_override ) ) {
33+
remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
34+
}
2335

2436
// Product archive buttons.
2537
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );

0 commit comments

Comments
 (0)