From 2f15ba5c13aeca5f3c2fbe35b93e71d3f07c3776 Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Wed, 24 Apr 2024 11:12:56 +0300 Subject: [PATCH] ref #95242 Changing the update description Changing the option description Edit tests Changing option name --- CHANGELOG.md | 2 +- resources/pot/retailcrm-es_ES.pot | 4 +-- resources/pot/retailcrm-ru_RU.pot | 4 +-- .../class-wc-retailcrm-abstracts-settings.php | 24 +++++++-------- src/include/class-wc-retailcrm-icml.php | 4 +-- src/languages/retailcrm-es_ES.l10n.php | 4 +-- src/languages/retailcrm-es_ES.mo | Bin 13653 -> 13576 bytes src/languages/retailcrm-ru_RU.l10n.php | 4 +-- src/languages/retailcrm-ru_RU.mo | Bin 16851 -> 16757 bytes src/readme.txt | 2 +- .../class-wc-retailcrm-test-case-helper.php | 2 +- tests/test-wc-retailcrm-icml.php | 29 +++++++++--------- 12 files changed, 40 insertions(+), 39 deletions(-) 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 5e9973485145cadebd4afa32f8fbf342e0e4304e..3b176fa7e3896dce16b8ba6d7e623916cdaae174 100644 GIT binary patch delta 2669 zcmYk+du)?c7{~Ev3mYp1+_-Fm4R{g81cky75E#fs7z4)K#&8Y>bZvoRX~$N!;gEt{ zL^J}aL@*I!&}iZX!xH~6h6GRnjTi+l(HQg(0!tJ_f{8#BzrXce;t3C*^Pax%xjg5b zeYbJn#t(0$B`VD9y#Z$9@D8rUq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S6=kg{RQ;4%Cnt1ZUVmju~(TZ7k2$_pHiacY^picE%JhWAPbO=F>3`wZ}ckpNaENseToc zFTgPE8yLV=^4W%$Q5no)Sy!+WHL(%Y7TiQ-?6*|^Kd4OQk(Nw`F_Wn%XDVE_dYOjAq4P@^3CRBbW;inSCF1#%^MK zIhA^rRgH&mJ6^`wSk9=*Ogq+L09WD})C6ziD$FbQCcX)k>NqMx$5AUii%s|zYN5ZQ zwkXF>{&hn!-+~TV8FJvwLezlk@E{(;7A$DA}A1eL-)s8pT6cKjH#v3REUJx@ixB-4OOZ9C3G7qx(a zRR2fFfj3{FgSS!dZ{_8uF&L+!nf{F$pnzrQh7wf&Ow`^sU@o?zeh)Sx2jBFf4^Lta zzJ}Vm3#iln9cluwl zdg0Hw5OZt22{z$g+MQ_QkGL9_KIFaUEPhM-5@z9x?DJSWf!X^0&r#9LE}{ zDX(D>?GerN^B-V#4bW7b+qiJ z!p4(uN;%;YkEoFcNQZo_AZ9-@QL=?W8vh!$ckv4?n!*hui>^>z!XfwpO@2H}u|ILrH@>Wy zn#wwYFU4#l4iG9w34P;FC5C-9X|cqgK7W-??s{UhR8v_+JWZ@7bTC!=h@FEi`CGCE z?-tePy0K0-YDIctZX|3`bHa8<$O+D}>`=&ZV@@|0w^_0N9>?IR)&Cul{T-aa?rL@hfUw087_B6g78Sj1ZGc8BchK%{%Hx-{E2_=10;Z>tlH z*^C)*hX%tIjiCX{4#eC(J7~}1nP4Ppg$O6)bUWb~wV-3g+@8q)rVyp4*N)k}Ljz&v X(H%+6z~%1#gzYcRNRD~BwkQ2x7@IuS 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 a5e6a99edcc3ec82bc59cc91f9df43ed0cc953e7..a0b0cf3044c0f91b24f60ae87114514694ecd825 100644 GIT binary patch delta 2749 zcmXxleN0t#9LMn=C@LZfA_9tWK*?uOe8?U^lvK#@SxgNT~mkg^Kj4ko$v4WyYw_g z{M8uI-apbVGRCAQ7&8gIxEaskeEbI&Va^C+Xqp2!6wjirzlbkmcli7>oW_1^qA^qO z4a`6{X5(>;#V*wMZYLVs#L@UOd?IS3F|*iDzyVl*!*LmMZ&QZ4!A{hJno%A55_O+% zQP=lkAwI+*I48-NR?Np#?7>0!B*}Je{EP$i!3<3{CLYIOG|oX?n1^~$VR*j;)sYI! zLLZL9HXMfEp|0=6Gx!K!!sZlXreYh8!ET$zcp6WTYfSPervfvunEeXW5ZpleX!?(K zzL<)U?7xOFn1iZ7A*$r-Q61lls^meW7^Vfem1#p=XLr#^qj3*ax=89X7ZXuqy%afR zN>C-=jk?h#+=5-W0>|Z9*O2hE&QnyJwm}o*oVFdW1gcPw8JuHHSWWK*n{fuFQ^Lrf$7+fkBL0rWYW+Z zE<>HD;$sQ6;7sgAy=g4<(hYWmZNwSu`%!b|7S`e&9E(f%P{q8c?_EGnnah}q-8h)% zn|Nl9mQyNPxELp5CCn1kJ@3dChH?wE$U@p|N5rV91IR@C=zBGbw|z%-0x&8@-= zw6GrS1vJjkIEp`G6}p&_8!(6$aOwn>4*r08U>tX!jp?`z*Wz@%g?sTS>VDB4`{)Y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 zHyP|8eO8%h;TD{N`*9w&V^2*_2Qk#yUamUhi$0me?qpC3FDh1IVJ&f zaRFL*3cWd0I;b4LKHQ2;Y|Zuf2v6gx$vlL=qB>0H?K3b3OR*N8$6nlpvCKvjI>AAk z?iy+n-$4!NF)G7DlF2{te4K8G6Ajc1U)%w^Q(x{I1&1{*?an~(SK9PYywzO7n} zWBU56j-uXs1@rJWF2SjMvy9PHqt4$?BmXZ^c|e0woz65oSb;3N=|v|FVxcvFO4LkG z;#RzY+H})0_(CunHEFHA%YBnP#oB^ZWH7>!4Q*FVIeoPQnkHfqMbsDY-<3}nK)K3Hi)9~VBy7qM;@ zFUM|V3}zBP4rJS`LuFtumSG1rW6}#egYBr9&S3N`v&qGN_zuQk9qKDMg$&4RI;m*Q zL+1u&8jtEQ71d!8YCuPD0p7xRjH0msry{Fh_M+DQ3a-STk!3e&nZ{hl4R{+9`1W>U zAL{>)sbS$)hZu7R2Xo=a?7*5n2>J)AJ#;=I)HH@S@v(B>efqP{H0VgXS^sOZO#UlM<5;y5~3ufl0WW$=6)>MQ)Olu;Q#Y#>Gk8z%(J z^8eC?bCN@BB@Pioi2cMCLS-2d<*ym@8tx!6h=SHd5y>$NspSzRgvxSaU3+81djs3u z(RpD`&lYEu-FAK '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); } }