diff --git a/wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css b/wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css
index 4e8d326..d6fb152 100644
--- a/wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css
+++ b/wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css
@@ -87,4 +87,7 @@ main{
margin-right: auto;
margin-left: auto;
width: max-content;
-}
\ No newline at end of file
+}
+
+
+
diff --git a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js
index d207893..fa75b93 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js
+++ b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js
@@ -143,59 +143,7 @@ jQuery(document).ready(function($) {
const variationId = $item.data('variation_id') || 0;
const quantity = parseInt($item.find('.counter__input').val());
- // Сохраняем во временное хранилище
- const removedItems = JSON.parse(localStorage.getItem(removedItemsStorageKey)) || [];
- removedItems.push({ product_id: productId, variation_id: variationId, quantity: quantity, key: key });
- localStorage.setItem(removedItemsStorageKey, JSON.stringify(removedItems));
-
- // Показываем кнопку восстановления
- $item.html(`
-
- Removing an item from the cart: 5с
-
-
-
-
- `);
-
- // Проверяем количество товаров в корзине
- $.ajax({
- type: 'POST',
- url: woocommerce_params.ajax_url,
- data: {
- action: 'check_cart_count'
- },
- success: function(response) {
- if (response.success && response.data.count <= 1) {
- // Если после удаления корзина станет пустой (1 товар сейчас, удаляем его)
- $('.proceed-to-checkout').css('display', 'none');
- }
- }
- });
-
- // Удаляем через 5 секунд, если не восстановили
- const removeTimeout = setTimeout(() => {
- permanentRemoveItem(key, productId, variationId);
- }, 5000);
- const product_remove_timer = setInterval(() => {
- let number = Number($(`#${key}_timer`).html()) - 1;
- $(`#${key}_timer`).html(number);
- }, 1000);
-
- // Обработчик восстановления
- $(document).off('click', `[data-key="${key}"] .modal-basket-item__return`).on('click', `[data-key="${key}"] .modal-basket-item__return`, function(e) {
- e.preventDefault();
- clearTimeout(removeTimeout);
- clearInterval(product_remove_timer); // Очищаем интервал
- restoreItem(key, productId, variationId, quantity);
- });
- }
-
- // Полное удаление товара
- function permanentRemoveItem(key, productId, variationId) {
$('#modal-basket').addClass('loading');
$.ajax({
@@ -217,13 +165,15 @@ jQuery(document).ready(function($) {
);
localStorage.setItem(removedItemsStorageKey, JSON.stringify(updatedItems));
- updateCartFragment(false);
- $('[data-key="' + key + '"]').remove()
+ updateCartFragment();
+ // $('[data-key="' + key + '"]').remove()
}
}
});
+
}
+
// Восстановление товара
function restoreItem(key, productId, variationId, quantity) {
$('#modal-basket').addClass('loading');
@@ -359,8 +309,9 @@ jQuery(document).ready(function($) {
beforeSend: function() {
$('#modal-basket').addClass('loading');
},
- complete: function() {
+ complete: function(response) {
$('#modal-basket').removeClass('loading');
+ console.log(response)
},
success: function(response) {
console.log(response);
diff --git a/wp-content/themes/cosmopet/static/front-page/css/style.css b/wp-content/themes/cosmopet/static/front-page/css/style.css
index 80883d8..78cea8b 100644
--- a/wp-content/themes/cosmopet/static/front-page/css/style.css
+++ b/wp-content/themes/cosmopet/static/front-page/css/style.css
@@ -4552,7 +4552,6 @@ color: #f4f1f0;
.modal__aside {
position: fixed;
transition: right 0.3s ease-in-out;
- right: -400px;
}
.modal__aside.active {
diff --git a/wp-content/themes/cosmopet/temp-functions/cart-logic.php b/wp-content/themes/cosmopet/temp-functions/cart-logic.php
index 1b867f3..ab4fa67 100644
--- a/wp-content/themes/cosmopet/temp-functions/cart-logic.php
+++ b/wp-content/themes/cosmopet/temp-functions/cart-logic.php
@@ -1,70 +1,2 @@
cart;
- $count = $cart->get_cart_contents_count();
- $total = $cart->get_total('raw'); // Числовая сумма
- $total_html = wc_cart_totals_order_total_html(); // Форматированная сумма
-
- wp_send_json_success([
- 'contents' => $contents,
- 'footer' => $footer,
- 'count' => $count,
- 'total' => $total_html,
- 'total_raw' => $total
- ]);
-}
-
-add_action('template_redirect', 'custom_redirect_cart_page');
-function custom_redirect_cart_page() {
- if (is_cart()) {
- wp_redirect(home_url('/'));
- exit;
- }
-}
-
-add_action('wp_enqueue_scripts', 'remove_woocommerce_styles_on_checkout', 9999);
-function remove_woocommerce_styles_on_checkout() {
- // Проверяем, что мы на странице чекаута
- if (function_exists('is_checkout') && is_checkout() && !is_order_received_page()) {
- wp_deregister_style('woocommerce-layout');
- wp_deregister_style('woocommerce-smallscreen');
- wp_deregister_style('woocommerce-general');
-
- // Дополнительно: отключить другие стили WooCommerce
- wp_dequeue_style('select2');
- wp_deregister_style('select2');
- }
-}
-
-add_action('wp_head', 'custom_checkout_padding');
-function custom_checkout_padding() {
- // Проверяем, что это страница Checkout
- if (is_checkout() && !is_admin()) {
- ?>
-
-