From fdfbc917c9fd39393f4ea85db86d7bba34babd89 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 10 Feb 2025 12:07:48 +0100 Subject: [PATCH] wip #7310 @1:30 --- .../assets/styles/components/woocommerce.styl | 9 +++++++++ .../physioassist/resources/functions.php | 18 +++++++++++------- .../resources/views/woocommerce/cart/cart.php | 16 +++++++++------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/wp-content/themes/physioassist/resources/assets/styles/components/woocommerce.styl b/wp-content/themes/physioassist/resources/assets/styles/components/woocommerce.styl index 9698e55a..af20b242 100644 --- a/wp-content/themes/physioassist/resources/assets/styles/components/woocommerce.styl +++ b/wp-content/themes/physioassist/resources/assets/styles/components/woocommerce.styl @@ -1,6 +1,11 @@ // Woocommerce overrides // Disabling some/all default CSS: https://docs.woocommerce.com/document/disable-the-default-stylesheet/ +body:not(.woocommerce-app) + .frequency, + .product-frequency + display none !important + .woocommerce // Headings h2 @@ -170,6 +175,10 @@ button[type="submit"] width: max-content + .woocommerce-cart-form + .product-price + display: none + div.product form.cart div.quantity diff --git a/wp-content/themes/physioassist/resources/functions.php b/wp-content/themes/physioassist/resources/functions.php index 9baef796..797f2e73 100644 --- a/wp-content/themes/physioassist/resources/functions.php +++ b/wp-content/themes/physioassist/resources/functions.php @@ -133,14 +133,15 @@ add_filter('wps_sfw_show_sync_interval', function() { return ''; }); - -add_filter('wps_sfw_price_html', function(){ +add_filter('wps_sfw_price_html', function($html){ global $product; - if($product) { + if($product && !is_page(['cart','panier'])) { $symbol = get_woocommerce_currency_symbol(); $price = apply_filters('wps_rbpfw_price', $product->get_regular_price()); $suffix = $product->get_price_suffix(); return "$symbol$price$suffix"; + }else{ + return $html; } }); @@ -152,16 +153,19 @@ add_filter('wps_sfw_show_one_time_subscription_price', function($price) { return $price; }); -add_action('woocommerce_after_add_to_cart_quantity', function() { - global $product; - $product_id = $product->get_id(); +add_action('woocommerce_after_add_to_cart_quantity', function($product_id = false) { + if() + if(!$product_id) { + global $product; + } + $product_id = $product_id ?? $product->get_id(); $wps_price_html = "
"; $wps_price_html .= "

Frequency

"; $wps_price_html .= '
'; $wps_price_html .= '
'; $wps_price_html .= '
'; $wps_price_html .= '
'; // translators: placeholder is price_discount_percentage. diff --git a/wp-content/themes/physioassist/resources/views/woocommerce/cart/cart.php b/wp-content/themes/physioassist/resources/views/woocommerce/cart/cart.php index 3817ff3f..43f93d2f 100644 --- a/wp-content/themes/physioassist/resources/views/woocommerce/cart/cart.php +++ b/wp-content/themes/physioassist/resources/views/woocommerce/cart/cart.php @@ -30,6 +30,7 @@ do_action( 'woocommerce_before_cart' ); ?> + @@ -141,16 +142,16 @@ do_action( 'woocommerce_before_cart' ); ?> echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item ); // PHPCS: XSS ok. ?> - + + + + - cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); // PHPCS: XSS ok. @@ -165,7 +166,7 @@ do_action( 'woocommerce_before_cart' ); ?> - +
@@ -185,6 +186,7 @@ do_action( 'woocommerce_before_cart' ); ?> + -- 2.39.5