From 2f70bc5a50b912c79f0ebe4b316c8dab81501c88 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 Jun 2025 15:14:35 +0300 Subject: [PATCH] =?UTF-8?q?Task=206809=20|=20=D0=B2=D1=8B=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=20=D1=86=D0=B5=D0=BD=D1=8B=20=D0=BF=D0=BE=D0=B4=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BE=D1=87=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=80=D0=B0=20=D0=BA=D0=B0=D0=BA=20One-time=20Purs?= =?UTF-8?q?chare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../single-product/component-controller.php | 9 +++ .../templates/_pages/shop/product-single.twig | 3 +- ...duct-subscription-options-prompt-radio.php | 55 +++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 wp-content/themes/cosmopet/woocommerce/single-product/product-subscription-options-prompt-radio.php diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php b/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php index ecca9fc..e20b7b8 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php +++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php @@ -147,4 +147,13 @@ add_filter('timber/context', function ($context) use ($context_for_twig) { } } + +if (class_exists('WCS_ATT_Product_Schemes')) { + $schemes = WCS_ATT_Product_Schemes::get_subscription_schemes($product); + $context['has_subscription_options'] = !empty($schemes); + } else { + $context['has_subscription_options'] = false; + } + + Timber::render('_pages/shop/product-single.twig', $context); \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/_pages/shop/product-single.twig b/wp-content/themes/cosmopet/templates/_pages/shop/product-single.twig index d9c31de..ea4fc05 100644 --- a/wp-content/themes/cosmopet/templates/_pages/shop/product-single.twig +++ b/wp-content/themes/cosmopet/templates/_pages/shop/product-single.twig @@ -84,7 +84,8 @@ {# Start | Цена для неподписочного товара #} - {% if product.get_price %} + + {% if not has_subscription_options and product.get_price %}
{% if is_subscription %} {% if product.get_regular_price %} diff --git a/wp-content/themes/cosmopet/woocommerce/single-product/product-subscription-options-prompt-radio.php b/wp-content/themes/cosmopet/woocommerce/single-product/product-subscription-options-prompt-radio.php new file mode 100644 index 0000000..a3da641 --- /dev/null +++ b/wp-content/themes/cosmopet/woocommerce/single-product/product-subscription-options-prompt-radio.php @@ -0,0 +1,55 @@ + + + + +