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/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. diff --git a/sass/woocommerce/_cart.scss b/sass/woocommerce/_cart.scss index 40509aa..4b9894f 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; + border-color: #a94346; + box-shadow: none; + color: #fff; + } + } } #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; diff --git a/woocommerce/functions.php b/woocommerce/functions.php index 19df2f6..b5609a2 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' ); @@ -180,6 +192,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 {