From 396d8836060c3b30e56951abdafab7ddb8369e58 Mon Sep 17 00:00:00 2001 From: Sylvain Tissot Date: Mon, 13 Jun 2022 14:11:59 +0200 Subject: [PATCH 1/5] Fix undefined variable $woocommerce in functions.php Missing global to access a global variable raises a warning (tested with PHP 8) --- woocommerce/functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/woocommerce/functions.php b/woocommerce/functions.php index 19df2f6..851352e 100644 --- a/woocommerce/functions.php +++ b/woocommerce/functions.php @@ -180,6 +180,8 @@ function siteorigin_north_woocommerce_update_cart_count( $fragments ) { return $fragments; } endif; + +global $woocommerce; if ( version_compare( $woocommerce->version, '3', '<' ) ) { add_filter( 'add_to_cart_fragments', 'siteorigin_north_woocommerce_update_cart_count' ); } else { From efa6d058656efe050d1f198f5cdc7f8197a47b94 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Tue, 14 Jun 2022 04:24:56 +1200 Subject: [PATCH 2/5] Don't Remove Cart From Checkout Page if WCTB is set to override it --- woocommerce/functions.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/woocommerce/functions.php b/woocommerce/functions.php index 19df2f6..8e95c0e 100644 --- a/woocommerce/functions.php +++ b/woocommerce/functions.php @@ -19,7 +19,19 @@ function siteorigin_north_woocommerce_change_hooks(){ // Remove actions in the cart. remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10 ); - remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 ); + if ( class_exists( 'SiteOrigin_Premium_Plugin_WooCommerce_Templates' ) ) { + $so_wc_templates = get_option( 'so-wc-templates' ); + if ( + ! empty( $so_wc_templates['cart'] ) && + ! empty( $so_wc_templates['cart']['active'] ) + ) { + $prevent_override = true; + } + } + + if ( empty( $prevent_override ) ) { + remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 ); + } // Product archive buttons. remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' ); From 2b1c0e7ad62c35f1bbb0f95c02b5651036bead08 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Thu, 16 Jun 2022 04:15:54 +1200 Subject: [PATCH 3/5] WCTB: Style Checkout Button --- inc/settings.php | 3 ++- sass/woocommerce/_cart.scss | 15 +++++++++++++++ woocommerce.css | 11 +++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/inc/settings.php b/inc/settings.php index a51e3e8..3b0e722 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -977,7 +977,8 @@ function siteorigin_north_wc_settings_custom_css( $css ) { border: 1px solid ${fonts_text_dark}; color: ${fonts_text_dark}; } - .woocommerce table.shop_table .button.checkout-button { + .woocommerce table.shop_table .button.checkout-button, + .woocommerce .so-panel .wc-proceed-to-checkout .checkout-button.button { background: ${branding_accent}; border: 1px solid ${branding_accent}; } diff --git a/sass/woocommerce/_cart.scss b/sass/woocommerce/_cart.scss index 40509aa..2927fd0 100644 --- a/sass/woocommerce/_cart.scss +++ b/sass/woocommerce/_cart.scss @@ -246,6 +246,21 @@ } } } + + .so-panel .wc-proceed-to-checkout .checkout-button { + background: #c75d5d; + border: 1px solid #c75d5d; + color: #fff; + text-transform: uppercase; + + &:focus, + &:hover { + background: #a94346; + color: #fff; + border-color: #a94346; + box-shadow: none; + } + } } #mobile-navigation { diff --git a/woocommerce.css b/woocommerce.css index 565699a..6e28e4c 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -518,6 +518,17 @@ margin-top: 0.5em; width: 100% !important; } } +.woocommerce .so-panel .wc-proceed-to-checkout .checkout-button { + background: #c75d5d; + border: 1px solid #c75d5d; + color: #fff; + text-transform: uppercase; } + .woocommerce .so-panel .wc-proceed-to-checkout .checkout-button:focus, .woocommerce .so-panel .wc-proceed-to-checkout .checkout-button:hover { + background: #a94346; + color: #fff; + border-color: #a94346; + box-shadow: none; } + #mobile-navigation .shopping-cart-link { margin-top: 1em; text-decoration: none; From 69eecd3fc29c7724a83f9f161877aca52953542e Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Tue, 21 Jun 2022 20:51:12 +0200 Subject: [PATCH 4/5] Selector re-order --- sass/woocommerce/_cart.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/woocommerce/_cart.scss b/sass/woocommerce/_cart.scss index 2927fd0..4b9894f 100644 --- a/sass/woocommerce/_cart.scss +++ b/sass/woocommerce/_cart.scss @@ -256,9 +256,9 @@ &:focus, &:hover { background: #a94346; - color: #fff; border-color: #a94346; box-shadow: none; + color: #fff; } } } From 4bcb8e3c019425bffe4f191bc039deb0be2842e4 Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Tue, 21 Jun 2022 21:36:22 +0200 Subject: [PATCH 5/5] Updated changelog --- readme.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.txt b/readme.txt index aa37f0a..7152bc9 100644 --- a/readme.txt +++ b/readme.txt @@ -104,6 +104,10 @@ Original design files are available on [Google Drive](https://drive.google.com/f == Changelog == += 1.19.11 - 21 June 2022 = +* WooCommerce: Added undefined variable `$woocommerce`. +* WooCommerce Template Builder: Ensured `Proceed to Checkout` button is available in the Cart template. + = 1.19.10 - 12 June 2022 = * SiteOrigin Settings: Added `siteorigin_settings_websafe` filter to allow filtering of websafe fonts.