diff --git a/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php b/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php index f0933b4..7c94dff 100644 --- a/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php +++ b/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php @@ -164,16 +164,17 @@ function process_form($enabledHandlers, $crmData = array()) { -add_action('woocommerce_thankyou', 'send_order_data_on_payment', 10, 1); +// Отправляем данные в Bitrix24 при создании заказа +add_action('woocommerce_checkout_order_created', 'send_order_to_bitrix_on_create', 10, 1); -function send_order_data_on_payment($order_id) { - $order = wc_get_order($order_id); +function send_order_to_bitrix_on_create($order) { + $order_id = $order->get_id(); $already_sent = $order->get_meta('_order_sent'); + if (!$already_sent) { - // Отправляем заказ в Bitrix24 send_order_data($order_id); - - // Помечаем заказ как отправленный, чтобы избежать дублирования + + // Помечаем заказ как отправленный $order->update_meta_data('_order_sent', '1'); $order->save(); } @@ -262,5 +263,20 @@ function send_order_data($order_id) { $response = $handler->handle($formData, array()); } +add_action('woocommerce_payment_complete', 'notify_order_paid', 10, 1); + +function notify_order_paid($order_id) { + $order = wc_get_order($order_id); + + $formData = [ + 'TITLE' => 'Заказ #' . $order_id . ' оплачен', + 'ORDER_ID' => $order_id, + 'PAYMENT_METHOD' => $order->get_payment_method_title(), + 'ORDER_TOTAL' => $order->get_total(), + 'SOURCE' => 'WooCommerce', + ]; + $handler = FormHandlerFactory::getHandler(['tg']); + $handler->handle($formData, []); +} ?> \ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/css/catalog.css b/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/css/catalog.css index 1283d7c..541477c 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/css/catalog.css +++ b/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/css/catalog.css @@ -91,7 +91,7 @@ width: 17px; height: 10px; - background-image: url(../img/svg/main/arrow-black.svg); + background-image: url(../../../../../../static/img/svg/main/arrow-black.svg); background-repeat: no-repeat; background-size: contain; @@ -157,7 +157,7 @@ right: 8px; width: 16px; height: 12px; - background-image: url(../img/svg/main/arrow-selected.svg); + background-image: url(../../../../../../static/img/svg/main/arrow-selected.svg); } /* select */ @@ -213,7 +213,7 @@ right: 0; width: 24px; aspect-ratio: 1; - background-image: url(../img/svg/main/black-x.svg); + background-image: url(../../../../../../static/img/svg/main/black-x.svg); transform: rotate(45deg); transition: transform .2s; pointer-events: none; @@ -360,7 +360,7 @@ .wpfFilterContent ul li input[type="checkbox"]:checked { background-color: var(--background-black); - background-image: url(../../static/img/svg/main/arrow-selected-white.svg); + background-image: url(../../../../../../static/img/svg/main/arrow-selected-white.svg); background-repeat: no-repeat; background-position: center; } @@ -502,7 +502,7 @@ display: none; background: none; border: none; - background-image: url(../img/svg/main/gradient-x.svg); + background-image: url(../../../../../../static/img/svg/main/gradient-x.svg); background-repeat: no-repeat; background-position: center; }