diff --git a/resources/pot/retailcrm-es_ES.pot b/resources/pot/retailcrm-es_ES.pot index e1bdfd9..70825be 100644 --- a/resources/pot/retailcrm-es_ES.pot +++ b/resources/pot/retailcrm-es_ES.pot @@ -597,3 +597,15 @@ msgstr "Carga de los precios actuales de las ofertas" msgid "Every 4 hours" msgstr "Cada 4 horas" + +msgid "Upload prices now" +msgstr "Descargar precios ahora" + +msgid "Uploaded discount price" +msgstr "Descarga de precios promocionales" + +msgid "This functionality loads the promotional prices offers into Simla.com" +msgstr "Esta función carga los precios promocionales de las ofertas comerciales en Simla.com" + +msgid "Promotional prices unloaded" +msgstr "Se han cargado los precios promocionales" diff --git a/resources/pot/retailcrm-ru_RU.pot b/resources/pot/retailcrm-ru_RU.pot index 191bc1b..3dc8b15 100644 --- a/resources/pot/retailcrm-ru_RU.pot +++ b/resources/pot/retailcrm-ru_RU.pot @@ -606,3 +606,15 @@ msgstr "Выгрузка текущих цен торговых предложе msgid "Every 4 hours" msgstr "Каждые 4 часа" + +msgid "Upload prices now" +msgstr "Выгрузить цены сейчас" + +msgid "Uploaded discount price" +msgstr "Выгрузка акционных цен" + +msgid "This functionality loads the promotional prices offers into Simla.com" +msgstr "Эта функция загружает акционные цены торговых предложений в Simla.com" + +msgid "Promotional prices unloaded" +msgstr "Акционные цены выгружены" diff --git a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php index 9adf83b..eb4ac9b 100644 --- a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php +++ b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php @@ -72,6 +72,25 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration + + form_fields[] = [ + 'label' => __('Upload prices now', 'retailcrm'), + 'title' => __('Uploaded discount price', 'retailcrm'), + 'type' => 'button', + 'desc_tip' => true, + 'id' => 'upload-loyalty-price-retailcrm', + 'description' => __( + 'This functionality loads the promotional prices offers into Simla.com', + 'retailcrm' + ), + ]; + $this->form_fields['icml'] = [ 'label' => __('Generating ICML', 'retailcrm'), 'title' => __('Generating ICML catalog by wp-cron', 'retailcrm'), diff --git a/src/include/class-wc-retailcrm-base.php b/src/include/class-wc-retailcrm-base.php index 4ae0eef..c656fe5 100644 --- a/src/include/class-wc-retailcrm-base.php +++ b/src/include/class-wc-retailcrm-base.php @@ -128,6 +128,8 @@ if (!class_exists('WC_Retailcrm_Base')) { add_action('woocommerce_review_order_before_payment', [$this, 'reviewCreditBonus'], 11, 1); add_action('wp_trash_post', [$this, 'trash_order_action'], 10, 1); add_action('retailcrm_loyalty_upload_price', [$this, 'upload_loyalty_price']); + add_action('admin_print_footer_scripts', [$this, 'ajax_upload_loyalty_price'], 99); + add_action('wp_ajax_upload_loyalty_price', [$this, 'upload_loyalty_price']); if ( !$this->get_option('deactivate_update_order') @@ -386,8 +388,6 @@ if (!class_exists('WC_Retailcrm_Base')) { return null; } - $infoApiKey = $this->apiClient->credentials(); - $discountPriceUpload = new WC_Retailcrm_Upload_Discount_Price($this->apiClient); $discountPriceUpload->upload(); } diff --git a/src/languages/retailcrm-es_ES.l10n.php b/src/languages/retailcrm-es_ES.l10n.php index b33d9a0..8298f7b 100644 --- a/src/languages/retailcrm-es_ES.l10n.php +++ b/src/languages/retailcrm-es_ES.l10n.php @@ -249,7 +249,11 @@ return [ "Use coupon:" => "Utiliza el cupón:", "Points will be awarded upon completion of the order:" => "Los puntos se concederán al finalizar el pedido:", "Upload of current prices of offers" => "Upload of current prices of offers", - "Every 4 hours" => "Cada 4 horas" + "Every 4 hours" => "Cada 4 horas", + "Upload prices now" => "Descargar precios ahora", + "Uploaded discount price" => "Descarga de precios promocionales", + "This functionality loads the promotional prices offers into Simla.com" => "Esta función carga los precios promocionales de las ofertas comerciales en Simla.com", + "Promotional prices unloaded" => "Se han cargado los precios promocionales" ], "language" => "es", "x-generator" => "GlotPress/2.4.0-alpha", diff --git a/src/languages/retailcrm-es_ES.mo b/src/languages/retailcrm-es_ES.mo index c6b63f8..9760a27 100644 Binary files a/src/languages/retailcrm-es_ES.mo and b/src/languages/retailcrm-es_ES.mo differ diff --git a/src/languages/retailcrm-ru_RU.l10n.php b/src/languages/retailcrm-ru_RU.l10n.php index 0c250ca..25eab44 100644 --- a/src/languages/retailcrm-ru_RU.l10n.php +++ b/src/languages/retailcrm-ru_RU.l10n.php @@ -248,7 +248,11 @@ return [ "Use coupon:" => "Используйте купон:", "Points will be awarded upon completion of the order:" => "По завершению заказа будет начислено баллов:", "Upload of current prices of offers" => "Выгрузка текущих цен торговых предложений", - "Every 4 hours" => "Каждые 4 часа" + "Every 4 hours" => "Каждые 4 часа", + "Upload prices now" => "Выгрузить цены сейчас", + "Uploaded discount price" => "Выгрузка акционных цен", + "This functionality loads the promotional prices offers into Simla.com" => "Эта функция загружает акционные цены торговых предложений в Simla.com", + "Promotional prices unloaded" => "Акционные цены выгружены" ], "language" => "ru", "x-generator" => "GlotPress/2.4.0-alpha", diff --git a/src/languages/retailcrm-ru_RU.mo b/src/languages/retailcrm-ru_RU.mo index d499cfe..12863b0 100644 Binary files a/src/languages/retailcrm-ru_RU.mo and b/src/languages/retailcrm-ru_RU.mo differ