diff --git a/wp-content/themes/cosmopet/global-functions/core-functions.php b/wp-content/themes/cosmopet/global-functions/core-functions.php
index d917072..def1230 100644
--- a/wp-content/themes/cosmopet/global-functions/core-functions.php
+++ b/wp-content/themes/cosmopet/global-functions/core-functions.php
@@ -260,4 +260,3 @@ $zero = '0';
// ]);
// }
-
diff --git a/wp-content/themes/cosmopet/global-functions/multisite-functions.php b/wp-content/themes/cosmopet/global-functions/multisite-functions.php
index 6b6d4a1..153ffc2 100644
--- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php
+++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php
@@ -167,96 +167,97 @@ if($site_env->site_mode == 'production' and $site_env->site_region == 'ae') {
currency: currency
});
- // Событие для Google Analytics
- window.dataLayer = window.dataLayer || [];
- window.dataLayer.push({
- 'event': 'add_to_cart',
- 'ecommerce': {
- 'currency': currency,
- 'value': parseFloat(priceElement) * quantity,
- 'items': [{
- 'item_id': productId,
- 'item_name': productName,
- 'price': parseFloat(priceElement),
- 'quantity': quantity
- }]
- }
- });
+ // Событие для Google Analytics
+ window.dataLayer = window.dataLayer || [];
+ window.dataLayer.push({
+ 'event': 'add_to_cart',
+ 'ecommerce': {
+ 'currency': currency,
+ 'value': parseFloat(priceElement) * quantity,
+ 'items': [{
+ 'item_id': productId,
+ 'item_name': productName,
+ 'price': parseFloat(priceElement),
+ 'quantity': quantity
+ }]
+ }
});
});
});
-
-
+ get_status() !== 'processing' && $order->get_status() !== 'completed')) return;
-
- $items = [];
- foreach ($order->get_items() as $item) {
- $product = $item->get_product();
- $items[] = [
- 'item_id' => $product->get_id(),
- 'item_name' => $product->get_name(),
- 'price' => $product->get_price(),
- 'quantity' => $item->get_quantity()
- ];
- }
- ?>
-
-
+ cart ? WC()->cart->get_total('edit') : 0;
- ?>
-
-
+ {
modalOpen('.basket-open', '.modal__basket');
modalOpen('.open-to-know', '.modal__to-know');
modalOpen('.login-open', '.modal__login');
- modalClose('.modal__close');
-});
\ No newline at end of file
+ modalClose('.modal__close, .m__close');
+});
+
+jQuery('[data-pname]').on('click', function(){
+ jQuery('#sub_product_name').val(jQuery(this).data('pname'))
+})
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css
index c3fd1d3..b67ddfe 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css
+++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css
@@ -951,6 +951,7 @@ button{
display: flex;
align-items: start;
+ flex-wrap: wrap;
}
.compound__item{
margin: 5px;
@@ -1083,18 +1084,17 @@ button{
}
.to-know{
/* width: 100%; */
-
- padding: 12px 24px 7px 24px;
-
- display: flex;
- justify-content: center;
-
border: none;
-
transition: opacity .2s ease-out;
text-decoration: none;
+ text-transform: uppercase;
+}
+.product__item .to-know{
+ margin-right: auto;
+ margin-left: auto;
+ width: auto;
+ display: flex;
}
-
.to-know--start{
justify-content: start;
padding-left: 0;
diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css
index 8900568..296f30f 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css
+++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css
@@ -553,7 +553,6 @@ main{
font-size: 20px;
line-height: 200%;
text-transform: uppercase;
- color: var(--text-black);
}
.product-item__price p::after{
@@ -593,8 +592,8 @@ main{
.product__item.hiding .product-item__images{
filter: grayscale(1)
}
- .product__item.hiding .product-item__price{
- color: var(--text-grey);
+ .product__item.hiding .product-item__price p{
+ color: #999;
}
.product-item__overlay{
position: absolute;
@@ -843,6 +842,7 @@ main{
}
.detail__image--width-perc-100{
width: calc(100% - 24px);
+
height: 600px;
}
@@ -1061,6 +1061,12 @@ main{
.detail__catalot .product__item{
width: calc(100% - 24px);
}
+
+@media (max-width: 640px) {
+ .detail__catalot .product__item{
+ width: calc(100%);
+}
+}
.detail__images-phone{
display: none;
}
diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css
index e59949c..ceab514 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css
+++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css
@@ -1,5 +1,9 @@
/* Стили для планшетов */
@media only screen and (max-width: 1200px) {
+
+ .product__main{
+ margin: 36px 0 0;
+ }
/* header */
main{
padding-top: 64px;
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 e635834..ecca9fc 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
@@ -1,11 +1,6 @@
is_type('variable')
$product;
$product_type;
$context_for_twig;
@@ -103,3 +98,53 @@ add_filter('timber/context', function ($context) use ($context_for_twig) {
return array_merge($context, $context_for_twig);
});
+
+
+ $context = Timber::get_context();
+ $post = Timber::get_post();
+ $context['post'] = $post;
+
+ $context['wc_breadcrumbs'] = array();
+
+ if (function_exists('woocommerce_breadcrumb')) {
+ $args = array(
+ 'delimiter' => '',
+ 'wrap_before' => '',
+ 'wrap_after' => '',
+ 'before' => '',
+ 'after' => '',
+ 'home' => _x('Home', 'breadcrumb', 'woocommerce'),
+ );
+
+ $breadcrumbs = new WC_Breadcrumb();
+ $breadcrumbs->generate();
+
+ $formatted_breadcrumbs = array();
+ foreach ($breadcrumbs->get_breadcrumb() as $crumb) {
+ $formatted_breadcrumbs[] = array(
+ 'text' => $crumb[0],
+ 'url' => $crumb[1]
+ );
+ }
+
+ $context['wc_breadcrumbs'] = $formatted_breadcrumbs;
+ }
+
+ $product_id = get_the_ID();
+ $product = wc_get_product($product_id);
+
+ $context['product'] = $product;
+
+ $context['related_products'] = array();
+ $related_products_ids = wc_get_related_products($product_id, 5);
+
+ if ($related_products_ids) {
+ foreach ($related_products_ids as $related_id) {
+ $related_product = wc_get_product($related_id);
+ if ($related_product) {
+ $context['related_products'][] = $related_product;
+ }
+ }
+ }
+
+ Timber::render('_pages/shop/product-single.twig', $context);
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/single-product.php b/wp-content/themes/cosmopet/single-product.php
index ad3e75f..8cbab0e 100644
--- a/wp-content/themes/cosmopet/single-product.php
+++ b/wp-content/themes/cosmopet/single-product.php
@@ -8,53 +8,5 @@ if (is_product()) {
include_module('shop');
include_component('shop', 'single-product');
-
- $context = Timber::get_context();
- $post = Timber::get_post();
- $context['post'] = $post;
-
- $context['wc_breadcrumbs'] = array();
-
- if (function_exists('woocommerce_breadcrumb')) {
- $args = array(
- 'delimiter' => '',
- 'wrap_before' => '',
- 'wrap_after' => '',
- 'before' => '',
- 'after' => '',
- 'home' => _x('Home', 'breadcrumb', 'woocommerce'),
- );
-
- $breadcrumbs = new WC_Breadcrumb();
- $breadcrumbs->generate();
-
- $formatted_breadcrumbs = array();
- foreach ($breadcrumbs->get_breadcrumb() as $crumb) {
- $formatted_breadcrumbs[] = array(
- 'text' => $crumb[0],
- 'url' => $crumb[1]
- );
- }
-
- $context['wc_breadcrumbs'] = $formatted_breadcrumbs;
- }
-
- $product_id = get_the_ID();
- $product = wc_get_product($product_id);
-
- $context['product'] = $product;
-
- $context['related_products'] = array();
- $related_products_ids = wc_get_related_products($product_id, 5);
-
- if ($related_products_ids) {
- foreach ($related_products_ids as $related_id) {
- $related_product = wc_get_product($related_id);
- if ($related_product) {
- $context['related_products'][] = $related_product;
- }
- }
- }
-
- Timber::render('modules/shop/components/single-product/component-template.twig', $context);
+
}
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig b/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig
index 6ec9d5e..52f7945 100644
--- a/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig
+++ b/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig
@@ -2,8 +2,9 @@
{% set cur_product = fn('wc_get_product', post.id) %}
{% set attrs = post.product.get_attributes() %}
{% set cur_weight = function('get_product_info', post.id, 'weight') %}
-
-
+ {% set stock_status = post.meta('_stock_status') == 'instock' %}
+
+
{% if post.date('Y-m-d') >= criteria_for_new_product %}
@@ -22,18 +23,46 @@
+ {% set for_whom = fn('wc_get_product_terms', post.id, 'pa_for-whom') %}
+ {% for option in for_whom %}
+ {% set term = get_term(option) %}
+
{{ term.name }}
+ {% endfor %}
{% set compound = fn('wc_get_product_terms', post.id, 'pa_compound') %}
{% for option in compound %}
-
{% set term = get_term(option) %}
{{ term.name }}
{% endfor %}
+
+ {% set package_weight = fn('wc_get_product_terms', post.id, 'pa_package-weight') %}
+ {% for option in package_weight %}
+ {% set term = get_term(option) %}
+
{{ term.name }}
+ {% endfor %}
+ {% set features = fn('wc_get_product_terms', post.id, 'pa_features') %}
+ {% for option in features %}
+
+ {% set term = get_term(option) %}
+
{{ term.name }}
+ {% endfor %}
+
+
{{ post.title }}
-
{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}
+
{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}
+
+ {% if post._regular_price() and post._regular_price() > post._price() %}
+
+
+ {{ post._regular_price() }} {{ fn('get_woocommerce_currency_symbol') }}
+
+
+ - {{ ((1 - post._price() / post._regular_price()) * 100)|round(0, 'floor') }} %
+
+
+ {% endif %}
- {% set stock_status = post.meta('_stock_status') == 'instock' %}
{% if stock_status == 'instock' %}