diff --git a/CHANGELOG.md b/CHANGELOG.md index 2740d4b..78c06d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## 2024-04-23 4.7.7 -* Support for services in ICML +* Added transfer of services via ICML catalog ## 2024-04-22 4.7.6 * Support WP 6.5 diff --git a/resources/pot/retailcrm-es_ES.pot b/resources/pot/retailcrm-es_ES.pot index 2c81b93..970ebdc 100644 --- a/resources/pot/retailcrm-es_ES.pot +++ b/resources/pot/retailcrm-es_ES.pot @@ -448,5 +448,5 @@ msgstr "La moneda del sitio web es distinto a la tienda del CRM. Para el funcion msgid "Uploading services" msgstr "Descarga de servicios" -msgid "When this option is enabled, all items of type 'virtual' will be considered services and uploaded to Simla.com" -msgstr "Si esta opción está activada, todos los elementos de tipo 'virtual' se tratarán como servicios y se cargarán en Simla.com" +msgid "Goods with the 'virtual' option enabled will be uploaded to Simla as services" +msgstr "Los bienes con la opción 'virtual' activada se cargarán en Simla como servicios" diff --git a/resources/pot/retailcrm-ru_RU.pot b/resources/pot/retailcrm-ru_RU.pot index a16004a..b353e9a 100644 --- a/resources/pot/retailcrm-ru_RU.pot +++ b/resources/pot/retailcrm-ru_RU.pot @@ -457,5 +457,5 @@ msgstr "Валюта сайта отличается от валюты мага msgid "Uploading services" msgstr "Выгрузка услуг" -msgid "When this option is enabled, all items of type 'virtual' will be considered services and uploaded to Simla.com" -msgstr "При включении опции, все элементы типа 'виртуальные' будут рассматриваться как услуги и загружаться в Simla.com" +msgid "Goods with the 'virtual' option enabled will be uploaded to Simla as services" +msgstr "Товары с включенной опцией 'виртуальные' будут выгружаться в CRM как услуги" diff --git a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php index 8e0d37d..ba8bbef 100644 --- a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php +++ b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php @@ -144,6 +144,18 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration ), ]; + $this->form_fields['icml_unload_services'] = [ + 'label' => __('Enabled', 'retailcrm'), + 'title' => __('Uploading services', 'retailcrm'), + 'class' => 'checkbox', + 'type' => 'checkbox', + 'desc_tip' => true, + 'description' => __( + "Goods with the 'virtual' option enabled will be uploaded to Simla as services", + "retailcrm" + ), + ]; + foreach (get_post_statuses() as $statusKey => $statusValue) { $this->form_fields['p_' . $statusKey] = [ 'title' => $statusValue, @@ -603,18 +615,6 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration ), ]; - $this->form_fields['icml_services'] = [ - 'label' => __('Enabled', 'retailcrm'), - 'title' => __('Uploading services', 'retailcrm'), - 'class' => 'checkbox', - 'type' => 'checkbox', - 'desc_tip' => true, - 'description' => __( - "When this option is enabled, all items of type 'virtual' will be considered services and uploaded to 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-icml.php b/src/include/class-wc-retailcrm-icml.php index 5c33cd6..5d0875f 100644 --- a/src/include/class-wc-retailcrm-icml.php +++ b/src/include/class-wc-retailcrm-icml.php @@ -50,8 +50,8 @@ if (!class_exists('WC_Retailcrm_Icml')) : $this->settings = get_option(WC_Retailcrm_Base::$option_key); $this->icmlWriter = new WC_Retailcrm_Icml_Writer($this->tmpFile); $this->unloadServices = ( - isset($this->settings['icml_services']) && - $this->settings['icml_services'] === WC_Retailcrm_Base::YES + isset($this->settings['icml_unload_services']) + && $this->settings['icml_unload_services'] === WC_Retailcrm_Base::YES ); } diff --git a/src/languages/retailcrm-es_ES.l10n.php b/src/languages/retailcrm-es_ES.l10n.php index b76b61c..e3fb869 100644 --- a/src/languages/retailcrm-es_ES.l10n.php +++ b/src/languages/retailcrm-es_ES.l10n.php @@ -198,8 +198,8 @@ return [ "The currency of the site differs from the currency of the store in CRM. For the integration to work correctly, the currencies in CRM and CMS must match" => "La moneda del sitio web es distinto a la tienda del CRM. Para el funcionamiento correcto de la integración, las monedas del CMS y CRM deben coincid", "Uploading services" => "Descarga de servicios", - "When this option is enabled, all items of type 'virtual' will be considered services and uploaded to Simla.com" => - "Si esta opción está activada, todos los elementos de tipo 'virtual' se tratarán como servicios y se cargarán en Simla.com" + "Goods with the 'virtual' option enabled will be uploaded to Simla as services" => + "Los bienes con la opción 'virtual' activada se cargarán en Simla como servicios" ], "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 5e99734..3b176fa 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 f5ac832..857338c 100644 --- a/src/languages/retailcrm-ru_RU.l10n.php +++ b/src/languages/retailcrm-ru_RU.l10n.php @@ -197,8 +197,8 @@ return [ "The currency of the site differs from the currency of the store in CRM. For the integration to work correctly, the currencies in CRM and CMS must match" => "Валюта сайта отличается от валюты магазина в CRM. Для корректной работы интеграции, валюты в CRM и CMS должны совпадать", "Uploading services" => "Выгрузка услуг", - "When this option is enabled, all items of type 'virtual' will be considered services and uploaded to Simla.com" => - "При включении опции, все элементы типа 'виртуальные' будут рассматриваться как услуги и загружаться в Simla.com" + "Goods with the 'virtual' option enabled will be uploaded to Simla as services" => + "Товары с включенной опцией 'виртуальные' будут выгружаться в CRM как услуги" ], "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 a5e6a99..a0b0cf3 100644 Binary files a/src/languages/retailcrm-ru_RU.mo and b/src/languages/retailcrm-ru_RU.mo differ diff --git a/src/readme.txt b/src/readme.txt index c02dc85..060325a 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -83,7 +83,7 @@ Asegúrate de tener una clave API específica para cada tienda. Las siguientes i == Changelog == = 4.7.7 = -* Support for services in ICML +* Added transfer of services via ICML catalog = 4.7.6 = * Support WP 6.5 diff --git a/tests/helpers/class-wc-retailcrm-test-case-helper.php b/tests/helpers/class-wc-retailcrm-test-case-helper.php index a89eb35..2c09d1c 100644 --- a/tests/helpers/class-wc-retailcrm-test-case-helper.php +++ b/tests/helpers/class-wc-retailcrm-test-case-helper.php @@ -80,7 +80,7 @@ class WC_Retailcrm_Test_Case_Helper extends WC_Unit_Test_Case 'product_description' => 'full', 'stores_for_uploading' => ['woocommerce', 'main'], 'woo_coupon_apply_field' => 'testField', - 'icml_services' => 'yes' + 'icml_unload_services' => 'yes' ]; update_option(WC_Retailcrm_Base::$option_key, $options); diff --git a/tests/test-wc-retailcrm-icml.php b/tests/test-wc-retailcrm-icml.php index 8c154aa..f55574d 100644 --- a/tests/test-wc-retailcrm-icml.php +++ b/tests/test-wc-retailcrm-icml.php @@ -62,23 +62,24 @@ class WC_Retailcrm_Icml_Test extends WC_Retailcrm_Test_Case_Helper private function createVirtualProduct() { - $product = wp_insert_post( array( + $product = wp_insert_post([ 'post_title' => 'Dummy Product', 'post_type' => 'product', 'post_status' => 'publish', - ) ); - update_post_meta( $product, '_price', '10' ); - update_post_meta( $product, '_regular_price', '10' ); - update_post_meta( $product, '_sale_price', '' ); - update_post_meta( $product, '_sku', 'DUMMY SKU' ); - update_post_meta( $product, '_manage_stock', 'no' ); - update_post_meta( $product, '_tax_status', 'taxable' ); - update_post_meta( $product, '_downloadable', 'no' ); - update_post_meta( $product, '_virtual', 'yes' ); - update_post_meta( $product, '_stock_status', 'instock' ); - update_post_meta( $product, '_weight', '1.1' ); - wp_set_object_terms( $product, 'simple', 'product_type' ); + ]); - return new WC_Product_Simple( $product ); + update_post_meta($product, '_price', '10'); + update_post_meta($product, '_regular_price', '10'); + update_post_meta($product, '_sale_price', ''); + update_post_meta($product, '_sku', 'DUMMY SKU'); + update_post_meta($product, '_manage_stock', 'no'); + update_post_meta($product, '_tax_status', 'taxable'); + update_post_meta($product, '_downloadable', 'no'); + update_post_meta($product, '_virtual', 'yes'); + update_post_meta($product, '_stock_status', 'instock'); + update_post_meta($product, '_weight', '1.1'); + wp_set_object_terms($product, 'simple', 'product_type'); + + return new WC_Product_Simple($product); } }