From 6a6a4545b8b091cf05d9bfc682a19e8469fad7ac Mon Sep 17 00:00:00 2001 From: Kocmonavtik <61938582+Kocmonavtik@users.noreply.github.com> Date: Thu, 8 Aug 2024 09:47:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B3?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D0=BC=D1=8B=20=D0=BB=D0=BE=D1=8F=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20(#356)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 + intaro.retailcrm/description.ru | 3 +- .../.default/lang/en/.parameters.php | 2 + .../templates/.default/lang/en/template.php | 29 ++ .../templates/.default/lang/ru/template.php | 1 + .../lp.register/templates/.default/script.js | 2 +- .../intaro/lp.score/lang/en/.description.php | 4 + .../intaro/lp.score/lang/en/component.php | 11 + .../.default/lang/en/.parameters.php | 2 + .../templates/.default/lang/en/template.php | 43 +++ .../.default/lang/en/.parameters.php | 3 + .../.default/lang/en/result_modifier.php | 3 + .../templates/.default/lang/en/template.php | 85 ++++++ .../templates/.default/lang/ru/template.php | 1 + .../templates/.default/script.js | 2 +- .../.default/lang/en/result_modifier.php | 8 + .../templates/.default/lang/en/template.php | 280 ++++++++++-------- .../templates/.default/lang/ru/template.php | 5 +- .../templates/.default/order_ajax.js | 12 +- .../install/export/lp-register/index.php | 2 +- .../export/lp-register/lang/en/index.php | 2 + .../export/lp-register/lang/ru/index.php | 2 + .../install/export/lp-score/index.php | 4 +- .../install/export/lp-score/lang/en/index.php | 2 + .../install/export/lp-score/lang/ru/index.php | 2 + .../install/export/sub-register/index.php | 2 +- .../export/sub-register/lang/en/index.php | 2 + .../export/sub-register/lang/ru/index.php | 2 + intaro.retailcrm/install/index.php | 27 +- intaro.retailcrm/install/version.php | 4 +- .../lib/component/advanced/installertrait.php | 109 +++++++ .../loyaltyinstaller.php} | 42 +-- .../lib/lang/en/service/loyaltyservice.php | 20 ++ intaro.retailcrm/options.php | 13 +- intaro.retailcrm/updater.php | 23 -- 35 files changed, 542 insertions(+), 216 deletions(-) create mode 100644 intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/en/.parameters.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/en/template.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/lp.score/lang/en/.description.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/lp.score/lang/en/component.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/lp.score/templates/.default/lang/en/.parameters.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/lp.score/templates/.default/lang/en/template.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default/lang/en/.parameters.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default/lang/en/result_modifier.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default/lang/en/template.php create mode 100644 intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/lang/en/result_modifier.php create mode 100644 intaro.retailcrm/install/export/lp-register/lang/en/index.php create mode 100644 intaro.retailcrm/install/export/lp-register/lang/ru/index.php create mode 100644 intaro.retailcrm/install/export/lp-score/lang/en/index.php create mode 100644 intaro.retailcrm/install/export/lp-score/lang/ru/index.php create mode 100644 intaro.retailcrm/install/export/sub-register/lang/en/index.php create mode 100644 intaro.retailcrm/install/export/sub-register/lang/ru/index.php create mode 100644 intaro.retailcrm/lib/component/advanced/installertrait.php rename intaro.retailcrm/lib/component/{installer/installertrait.php => advanced/loyaltyinstaller.php} (88%) create mode 100644 intaro.retailcrm/lib/lang/en/service/loyaltyservice.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bd76e84..6568a585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2024-08-06 v.6.5.24 +- Добавлены переводы текста в программе лояльности +- Установка функционала программы лоялности перенесена в настройки модуля + ## 2024-08-06 v.6.5.23 - Исправлена ошибка с присвоением externalId при добавлении товара в заказ как разные товарные позиции из CRM diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index d65af461..a01b037c 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1,2 @@ -- Исправлена ошибка с присвоением externalId при добавлении товара в заказ как разные товарные позиции из CRM +- Добавлены переводы текста в программе лояльности +- Установка функционала программы лоялности перенесена в настройки модуля diff --git a/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/en/.parameters.php b/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/en/.parameters.php new file mode 100644 index 00000000..2140fe6a --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/en/.parameters.php @@ -0,0 +1,2 @@ +link"; +$MESS["LP_NOT_ACTIVE"] = "Loyalty program is not active at the moment"; +$MESS["SEC"] = "seconds"; +$MESS["RESEND_SMS"] = "Send sms again"; +$MESS["RESEND_POSSIBLE"] = "It is possible to resend sms via"; +$MESS["LOYALTY_CONNECTION_ERROR"] = "There are problems connecting to the remote server. Try reloading the page."; +$MESS ["NO_VALID_EMAIL"] = "Check that your email is filled in correctly"; diff --git a/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/ru/template.php b/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/ru/template.php index 49dbc181..ad719b5a 100644 --- a/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/ru/template.php +++ b/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/lang/ru/template.php @@ -26,3 +26,4 @@ $MESS["SEC"] = "сек."; $MESS["RESEND_SMS"] = "Отправить смс повторно"; $MESS["RESEND_POSSIBLE"] = "Повторная отправка смс возможна через"; $MESS["LOYALTY_CONNECTION_ERROR"] = "Возникли проблемы с подключением к удаленному серверу. Попробуйте перезагрузить страницу."; +$MESS ["NO_VALID_EMAIL"] = "Проверьте правильность заполнения email"; diff --git a/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/script.js b/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/script.js index bb635c37..64030cf3 100644 --- a/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/script.js +++ b/intaro.retailcrm/install/export/local/components/intaro/lp.register/templates/.default/script.js @@ -67,7 +67,7 @@ function activateAccount() { ) if (emailViolation) { - $('#errMsg').text('Проверьте правильность заполнения email') + $('#errMsg').text(BX.message("NO_VALID_EMAIL")); return; } diff --git a/intaro.retailcrm/install/export/local/components/intaro/lp.score/lang/en/.description.php b/intaro.retailcrm/install/export/local/components/intaro/lp.score/lang/en/.description.php new file mode 100644 index 00000000..6e19594c --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/lp.score/lang/en/.description.php @@ -0,0 +1,4 @@ + diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default/lang/en/result_modifier.php b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default/lang/en/result_modifier.php new file mode 100644 index 00000000..bc938cf3 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default/lang/en/result_modifier.php @@ -0,0 +1,3 @@ + -Check the order information thoroughly and edit your order if required. Once you see everything is good, click \"#ORDER_BUTTON#\". -"; -$MESS["FURTHER_DEFAULT"] = "Next"; -$MESS["INNER_PS_BALANCE_DEFAULT"] = "Your balance:"; -$MESS["NAV_BACK_DEFAULT"] = "Back"; -$MESS["NAV_FORWARD_DEFAULT"] = "Next"; -$MESS["NEAREST_PICKUP_LIST_DEFAULT"] = "Nearest locations:"; -$MESS["ORDER_DEFAULT"] = "Checkout"; -$MESS["ORDER_DESC_DEFAULT"] = "Order comments:"; -$MESS["PAYMENT_BLOCK_NAME_DEFAULT"] = "Payment"; -$MESS["PAY_SYSTEM_PAYABLE_ERROR_DEFAULT"] = "You'll be able to pay for the order after we verify that the items you have ordered are in stock. Once your order is fulfilled, you'll receive an email with payment instructions. You'll be able to complete the purchase inside your customer account."; -$MESS["PERIOD_DEFAULT"] = "Delivery time"; -$MESS["PERSON_TYPE_DEFAULT"] = "Payer type"; -$MESS["PICKUP_LIST_DEFAULT"] = "Pick-up locations:"; -$MESS["PRICE_DEFAULT"] = "Price"; -$MESS["PRICE_FREE_DEFAULT"] = "free"; -$MESS["REGION_BLOCK_NAME_DEFAULT"] = "Delivery area"; -$MESS["REGION_REFERENCE_DEFAULT"] = "Select your city from the list. If you cannot find your city, select \"other location\" and enter your city in the \"City\" field."; -$MESS["REGISTRATION_REFERENCE_DEFAULT"] = "Please register for better shopping experience and to keep your order history."; -$MESS["REG_BLOCK_NAME_DEFAULT"] = "Register"; -$MESS["SALE_SADC_TRANSIT"] = "Delivery time"; -$MESS["SELECT_FILE_DEFAULT"] = "Select"; -$MESS["SELECT_PICKUP_DEFAULT"] = "Select"; -$MESS["SELECT_PROFILE_DEFAULT"] = "Select profile"; -$MESS["SOA_BAD_EXTENSION"] = "Invalid file type"; -$MESS["SOA_DELIVERY"] = "Delivery service"; -$MESS["SOA_DELIVERY_SELECT_ERROR"] = "Delivery service not selected"; -$MESS["SOA_DISTANCE_KM"] = "km"; -$MESS["SOA_DO_SOC_SERV"] = "Social login"; -$MESS["SOA_ERROR_ORDER"] = "Error creating the order."; -$MESS["SOA_ERROR_ORDER_LOST"] = "Order no. #ORDER_ID# cannot be found."; -$MESS["SOA_ERROR_ORDER_LOST1"] = "Please contact the store administration or try again."; -$MESS["SOA_FIELD"] = "Field"; -$MESS["SOA_INVALID_EMAIL"] = "E-mail is incorrect"; -$MESS["SOA_INVALID_PATTERN"] = "does not match the pattern"; -$MESS["SOA_LESS"] = "at least"; -$MESS["SOA_LOCATION_NOT_FOUND"] = "Location was not found"; -$MESS["SOA_LOCATION_NOT_FOUND_PROMPT"] = "Click #ANCHOR#add location#ANCHOR_END# so we know where you want to have your order shipped to"; -$MESS["SOA_MAP_COORDS"] = "Map coordinates"; -$MESS["SOA_MAX_LENGTH"] = "Max. field length"; -$MESS["SOA_MAX_SIZE"] = "Max. file size exceeded"; -$MESS["SOA_MAX_VALUE"] = "Max. field value"; -$MESS["SOA_MIN_LENGTH"] = "Min. field length"; -$MESS["SOA_MIN_VALUE"] = "Min. field value"; -$MESS["SOA_MORE"] = "less than"; -$MESS["SOA_NO"] = "no"; -$MESS["SOA_NOT_CALCULATED"] = "not calculated"; -$MESS["SOA_NOT_FOUND"] = "Not found"; -$MESS["SOA_NOT_NUMERIC"] = "numbers only"; -$MESS["SOA_NOT_SELECTED"] = "not selected"; -$MESS["SOA_NOT_SELECTED_ALT"] = "Make location more specific if required"; -$MESS["SOA_NOT_SPECIFIED"] = "not specified"; -$MESS["SOA_NO_JS"] = "The ordering process requires that JavaScript is enabled on your system. JavaScript is disabled or not supported by your browser. Please change the browser settings and try again."; -$MESS["SOA_NUM_STEP"] = "doesn't match"; -$MESS["SOA_ORDER_COMPLETE"] = "Order has been completed"; -$MESS["SOA_ORDER_PROPS"] = "Order properties"; -$MESS["SOA_ORDER_PS_ERROR"] = "The selected payment method failed. Please contact the site administrator or select another method."; -$MESS["SOA_ORDER_SUC"] = "Your order ##ORDER_ID# of #ORDER_DATE# has been created successfully."; -$MESS["SOA_ORDER_SUC1"] = "You can track your order in your personal account. You will be asked to enter your login and password to access your account."; -$MESS["SOA_OTHER_LOCATION"] = "Other location"; -$MESS["SOA_PAY"] = "Order payment"; -$MESS["SOA_PAYMENT_SUC"] = "Payment ##PAYMENT_ID#"; -$MESS["SOA_PAYSYSTEM_PRICE"] = "Extra COD:"; -$MESS["SOA_PAY_ACCOUNT3"] = "You have sufficient credit to pay the order in full."; -$MESS["SOA_PAY_LINK"] = "If you don't see any payment information, click here: Pay and place order."; -$MESS["SOA_PAY_PDF"] = "Click Download invoice to get the invoice in PDF format."; -$MESS["SOA_PAY_SYSTEM"] = "Payment system"; -$MESS["SOA_PICKUP_ADDRESS"] = "Address"; -$MESS["SOA_PICKUP_DESC"] = "Description"; -$MESS["SOA_PICKUP_EMAIL"] = "E-Mail"; -$MESS["SOA_PICKUP_PHONE"] = "Phone"; -$MESS["SOA_PICKUP_STORE"] = "Warehouse"; -$MESS["SOA_PICKUP_WORK"] = "Business hours"; -$MESS["SOA_PROP_NEW_PROFILE"] = "New profile"; -$MESS["SOA_PS_SELECT_ERROR"] = "Payment system not selected"; -$MESS["SOA_REQUIRED"] = "this field is required"; -$MESS["SOA_SUM_DELIVERY"] = "Delivery:"; -$MESS["SOA_SUM_DISCOUNT"] = "Discount"; -$MESS["SOA_SUM_IT"] = "Total:"; -$MESS["SOA_SUM_LEFT_TO_PAY"] = "Amount payable:"; -$MESS["SOA_SUM_NAME"] = "Name"; -$MESS["SOA_SUM_PAYED"] = "Paid:"; -$MESS["SOA_SUM_PRICE"] = "Price"; -$MESS["SOA_SUM_QUANTITY"] = "Quantity"; -$MESS["SOA_SUM_SUMMARY"] = "Total price:"; -$MESS["SOA_SUM_VAT"] = "Tax:"; -$MESS["SOA_SUM_WEIGHT"] = "Weight"; -$MESS["SOA_SUM_WEIGHT_SUM"] = "Total weight:"; -$MESS["SOA_SYMBOLS"] = "symbols"; $MESS["SOA_YES"] = "yes"; -$MESS["STOF_AUTH_REQUEST"] = "Please log in."; -$MESS["STOF_DO_AUTHORIZE"] = "Log in"; -$MESS["STOF_DO_REGISTER"] = "Register"; -$MESS["STOF_EMAIL"] = "E-mail"; -$MESS["STOF_ENTER"] = "Log in"; -$MESS["STOF_FORGET_PASSWORD"] = "Forgot your password?"; -$MESS["STOF_LASTNAME"] = "Last name"; +$MESS["SOA_NO"] = "no"; +$MESS["SOA_DO_SOC_SERV"] = "Sign in with social media"; +$MESS["SOA_NOT_FOUND"] = "Not Found"; +$MESS["SOA_NOT_SPECIFIED"] = "not specified"; +$MESS["SOA_NOT_SELECTED"] = "not selected"; +$MESS["SOA_NOT_CALCULATED"] = "not calculated"; +$MESS["SOA_PS_SELECT_ERROR"] = "Payment system not selected"; +$MESS["SOA_DELIVERY_SELECT_ERROR"] = "Delivery service not selected"; +$MESS["SOA_PICKUP_PHONE"] = "Phone"; +$MESS["SOA_PICKUP_ADDRESS"] = "Address"; +$MESS["SOA_PICKUP_WORK"] = "Work Mode"; +$MESS["SOA_PICKUP_STORE"] = "Warehouse"; +$MESS["SOA_PICKUP_EMAIL"] = "Email"; +$MESS["SOA_PICKUP_DESC"] = "Description"; +$MESS["SOA_MAP_COORDS"] = "Map coordinates"; +$MESS["SOA_DISTANCE_KM"] = "km"; +$MESS["SOA_ORDER_PROPS"] = "Order Properties"; +$MESS["SOA_FIELD"] = "Field"; +$MESS["SOA_REQUIRED"] = "required"; +$MESS["SOA_INVALID_EMAIL"] = "Invalid e-mail entered"; +$MESS["SOA_MIN_LENGTH"] = "Minimum field length"; +$MESS["SOA_MAX_LENGTH"] = "Maximum field length"; +$MESS["SOA_NOT_NUMERIC"] = "must be numeric"; +$MESS["SOA_MIN_VALUE"] = "Minimum field value"; +$MESS["SOA_MAX_VALUE"] = "Maximum field value"; +$MESS["SOA_NUM_STEP"] = "does not match the step"; +$MESS["SOA_LESS"] = "not less than"; +$MESS["SOA_MORE"] = "not more than"; +$MESS["SOA_SYMBOLS"] = "characters"; +$MESS["SOA_INVALID_PATTERN"] = "does not match the template"; +$MESS["SOA_PROP_NEW_PROFILE"] = "New Profile"; +$MESS["SOA_PAY_SYSTEM"] = "Payment System"; +$MESS["SOA_PAY_ACCOUNT3"] = "Funds are sufficient for full payment of the order."; +$MESS["SOA_DELIVERY"] = "Delivery service"; +$MESS["SOA_ORDER_SUC"] = "Your order №#ORDER_ID# from #ORDER_DATE# has been successfully created."; +$MESS["SOA_PAYMENT_SUC"] = "Your payment number: №#PAYMENT_ID#"; +$MESS["SOA_ORDER_SUC1"] = "You can follow the fulfillment of your order in personalized section of the site. Please note that you will need to enter your site user login and password to access this section."; +$MESS["SOA_PAY"] = "Order payment"; +$MESS["SOA_PAY_LINK"] = "If the payment information window does not open automatically, click on the link Pay order."; +$MESS["SOA_PAY_PDF"] = "To download the invoice in pdf format, click on the link Download Invoice."; +$MESS["SOA_ERROR_ORDER"] = "Order formation error"; +$MESS["SOA_ERROR_ORDER_LOST"] = "Order №#ORDER_ID# not found."; +$MESS["SOA_ERROR_ORDER_LOST1"] = "Please contact the administration of the online store or try to place your order again."; +$MESS["SOA_SUM_NAME"] = "Name"; +$MESS["SOA_SUM_DISCOUNT"] = "Discount"; +$MESS["SOA_SUM_WEIGHT"] = "Weight"; +$MESS["SOA_SUM_QUANTITY"] = "Quantity"; +$MESS["SOA_SUM_PRICE"] = "Price"; +$MESS["SOA_SUM_WEIGHT_SUM"] = "Total weight:"; +$MESS["SOA_SUM_SUMMARY"] = "Items per:"; +$MESS["SOA_SUM_VAT"] = "VAT:"; +$MESS["SOA_SUM_DELIVERY"] = "Shipping:"; +$MESS["SOA_SUM_IT"] = "Total:"; +$MESS["SOA_SUM_PAYED"] = "Paid:"; +$MESS["SOA_SUM_LEFT_TO_PAY"] = "Remaining to be paid:"; +$MESS["SOA_ORDER_COMPLETE"] = "Order formed."; +$MESS["CAPTCHA_REGF_TITLE"] = "Automatic Registration Protection"; +$MESS["CAPTCHA_REGF_PROMT"] = "Enter the word in the picture"; $MESS["STOF_LOGIN"] = "Login"; -$MESS["STOF_MY_PASSWORD"] = "Your login and password"; -$MESS["STOF_NAME"] = "First name"; -$MESS["STOF_NEXT_STEP"] = "Continue checkout"; $MESS["STOF_PASSWORD"] = "Password"; -$MESS["STOF_PHONE"] = "Phone number"; +$MESS["STOF_REMEMBER"] = "Remember me"; +$MESS["STOF_ENTER"] = "Login"; $MESS["STOF_REGISTER"] = "Register"; -$MESS["STOF_REG_HINT"] = "Please register for better shopping experience and to keep your order history."; -$MESS["STOF_REG_REQUEST"] = "Please register."; -$MESS["STOF_REG_SMS_REQUEST"] = "A confirmation code has been sent to your phone"; -$MESS["STOF_REMEMBER"] = "Remember Me"; -$MESS["STOF_RE_PASSWORD"] = "Repeat password"; +$MESS["STOF_DO_AUTHORIZE"] = "Authorize"; +$MESS["STOF_DO_REGISTER"] = "Register"; +$MESS["STOF_AUTH_REQUEST"] = "Please Authorize"; +$MESS["STOF_REG_REQUEST"] = "Please register"; +$MESS["STOF_PHONE"] = "Phone number"; +$MESS["STOF_REG_SMS_REQUEST"] = "An SMS with a confirmation code was sent to your number"; +$MESS["STOF_SMS_CODE"] = "Confirmation code from SMS"; $MESS["STOF_SEND"] = "Send"; -$MESS["STOF_SMS_CODE"] = "SMS confirmation code"; +$MESS["STOF_REG_HINT"] = "If this is your first time on the site and you want us to remember you and keep all your orders, +please fill out the registration form."; +$MESS["STOF_FORGET_PASSWORD"] = "Forgot your password?"; +$MESS["STOF_NEXT_STEP"] = "Continue Checkout"; +$MESS["STOF_NAME"] = "First Name"; +$MESS["STOF_LASTNAME"] = "Last Name"; +$MESS["STOF_EMAIL"] = "E-mail"; +$MESS["STOF_MY_PASSWORD"] = "Set login and password"; +$MESS["STOF_RE_PASSWORD"] = "Repeat password"; $MESS["STOF_SYS_PASSWORD"] = "Generate login and password"; -$MESS["SUCCESS_PRELOAD_TEXT_DEFAULT"] = "You previously shopped with us and we remember you, so we have taken the liberty to fill in the fields for you.
-If the information is correct, click \"#ORDER_BUTTON#\". +$MESS["SALE_SADC_TRANSIT"] = "Delivery time"; +$MESS["SOA_NO_JS"] = "JavaScript must be enabled to place an order. It appears that JavaScript is either not supported by your browser or is disabled. Change your browser settings and then try again."; +$MESS["SOA_PAYSYSTEM_PRICE"] = "Optional cash on delivery:"; +$MESS["SOA_OTHER_LOCATION"] = "Other Location"; +$MESS["SOA_LOCATION_NOT_FOUND"] = "Location not found"; +$MESS["SOA_LOCATION_NOT_FOUND_PROMPT"] = "#ANCHOR#Select a location from the list#ANCHOR_END#, to let us know where to deliver your order."; +$MESS["SOA_NOT_SELECTED_ALT"] = "If you need to specify the location"; +$MESS["SOA_ORDER_PS_ERROR"] = "Error of selected payment method. Please contact Site Administration or select another payment method."; +$MESS["AUTH_BLOCK_NAME_DEFAULT"] = "Authorization"; +$MESS["REG_BLOCK_NAME_DEFAULT"] = "Registration"; +$MESS["BASKET_BLOCK_NAME_DEFAULT"] = "Items in the order"; +$MESS["REGION_BLOCK_NAME_DEFAULT"] = "Delivery Region"; +$MESS["PAYMENT_BLOCK_NAME_DEFAULT"] = "Payment"; +$MESS["DELIVERY_BLOCK_NAME_DEFAULT"] = "Delivery"; +$MESS["BUYER_BLOCK_NAME_DEFAULT"] = "Buyer"; +$MESS["BACK_DEFAULT"] = "Back"; +$MESS["FURTHER_DEFAULT"] = "Next"; +$MESS["EDIT_DEFAULT"] = "change"; +$MESS["ORDER_DEFAULT"] = "Checkout"; +$MESS["ADD_DEFAULT"] = "Add"; +$MESS["PRICE_DEFAULT"] = "Price"; +$MESS["PERIOD_DEFAULT"] = "Delivery time"; +$MESS["NAV_BACK_DEFAULT"] = "Back"; +$MESS["NAV_FORWARD_DEFAULT"] = "Forward"; +$MESS["PRICE_FREE_DEFAULT"] = "free"; +$MESS["ECONOMY_DEFAULT"] = "Economy"; +$MESS["REGISTRATION_REFERENCE_DEFAULT"] = "If this is your first time on the site and you want us to remember you and keep all your orders, please fill out the registration form."; +$MESS["AUTH_REFERENCE_1_DEFAULT"] = "Required fields are marked with an \"asterisk\" (*)."; +$MESS["AUTH_REFERENCE_2_DEFAULT"] = "After registration, you will receive an informational letter."; +$MESS["AUTH_REFERENCE_3_DEFAULT"] = "Personal information, received by the online store during registration or otherwise, will not be transferred to third organizations and persons without the permission of users, except in situations where required by law or court order."; +$MESS["ADDITIONAL_PROPS_DEFAULT"] = "Additional properties."; +$MESS["USE_COUPON_DEFAULT"] = "Apply Coupon"; +$MESS["COUPON_DEFAULT"] = "Coupon"; +$MESS["PERSON_TYPE_DEFAULT"] = "Payer Type"; +$MESS["SELECT_PROFILE_DEFAULT"] = "Select a profile"; +$MESS["REGION_REFERENCE_DEFAULT"] = 'Select your city from the list. If you dont find your city, select \"other location\", and put the city in the field \"City\"'; +$MESS["PICKUP_LIST_DEFAULT"] = "Pickup locations:"; +$MESS["NEAREST_PICKUP_LIST_DEFAULT"] = "Nearest locations:"; +$MESS["SELECT_PICKUP_DEFAULT"] = "Select"; +$MESS["INNER_PS_BALANCE_DEFAULT"] = "In your user account:"; +$MESS["ORDER_DESC_DEFAULT"] = "Order Comments:"; +$MESS["SELECT_FILE_DEFAULT"] = "Select"; +$MESS["SUCCESS_PRELOAD_TEXT_DEFAULT"] = "You ordered from our online store, so we filled in all the data automatically.
+If everything is filled in correctly, press the button \"#ORDER_BUTTON#\". "; -$MESS["USE_COUPON_DEFAULT"] = "Apply coupon"; -?> \ No newline at end of file +$MESS["FAIL_PRELOAD_TEXT_DEFAULT"] = "You ordered from our online store, so we filled in all the data automatically.
+Pay attention to the detailed block with information about the order. Here you can make the necessary changes or +leave it as it is and click the button \"#ORDER_BUTTON#\". +"; +$MESS["DELIVERY_CALC_ERROR_TITLE_DEFAULT"] = "Failed to calculate the shipping cost."; +$MESS["DELIVERY_CALC_ERROR_TEXT_DEFAULT"] = "You can continue placing your order, and later the store manager will contact you and clarify the delivery information."; +$MESS["EMPTY_BASKET_TITLE"] = "Your cart is empty"; +$MESS["EMPTY_BASKET_HINT"] = "#A1#Click here#A2#, to continue shopping"; +$MESS["SOA_BAD_EXTENSION"] = "Invalid file type"; +$MESS["SOA_MAX_SIZE"] = "Maximum file size exceeded"; +$MESS["PAY_SYSTEM_PAYABLE_ERROR_DEFAULT"] = "You will be able to pay for your order after the manager checks the availability of a full set of goods in stock. Immediately after checking you will receive an email with payment instructions. You will be able to pay for the order in the personal section of the site."; +$MESS["BONUS_PAYMENT"] = 'Pay with bonuses'; +$MESS["HOW_MANY_BONUSES_TO_SPEND"] = 'How many bonuses to spend?'; +$MESS["BONUS_TOTAL"] = 'Total bonuses:'; +$MESS["YOU_CAN_SPEND"] = 'You can spend:'; +$MESS["CHARGE_RATE"] = "Bonus rate: 1 bonus = %s %s"; +$MESS["RUB"] = "rub."; +$MESS["CALCULATION_ERROR"] = 'Failed to calculate the number of available bonuses.'; +$MESS["CONFIRM_MESSAGE"] = 'To complete the bonus debiting procedure, enter your verification code'; +$MESS["SEND"] = 'Send'; +$MESS["RESEND_POSSIBLE"] = "It is possible to resend sms through"; +$MESS["RESEND_SMS"] = "Send sms again"; +$MESS["BONUS_SUCCESS"] = "Bonuses have been successfully debited"; +$MESS["BONUS_ERROR"] = "Error of bonus debiting"; +$MESS["LOYALTY_CONNECTION_ERROR"] = "There were problems with connection to the remote server. +Loyalty program discounts were not applied. Try reloading the page."; +$MESS["PAYMENT_IN_BONUSES"] = 'Payment with bonuses:'; +$MESS["PERSONAL_DISCOUNT"] = 'Personal discount: '; +$MESS["COMMON_DISCOUNT"] = 'Regular discount: '; +$MESS["WILL_CREDITED_BONUSES"] = 'Bonuses to be credited: '; diff --git a/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/lang/ru/template.php b/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/lang/ru/template.php index 2b204a1a..55199f26 100644 --- a/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/lang/ru/template.php +++ b/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/lang/ru/template.php @@ -152,4 +152,7 @@ $MESS["BONUS_SUCCESS"] = "Бонусы успешно списаны"; $MESS["BONUS_ERROR"] = "Ошибка списания бонусов"; $MESS["LOYALTY_CONNECTION_ERROR"] = "Возникли проблемы с подключением к удаленному серверу. Скидки программы лояльности не были применены. Попробуйте перезагрузить страницу."; - +$MESS["PAYMENT_IN_BONUSES"] = 'Оплата бонусами:'; +$MESS["PERSONAL_DISCOUNT"] = 'Персональная скидка: '; +$MESS["COMMON_DISCOUNT"] = 'Обычная скидка: '; +$MESS["WILL_CREDITED_BONUSES"] = "Будет начислено бонусов: "; diff --git a/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/order_ajax.js b/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/order_ajax.js index eeac7c4b..d38d87ee 100644 --- a/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/order_ajax.js +++ b/intaro.retailcrm/install/export/local/components/intaro/sale.order.ajax/templates/.default/order_ajax.js @@ -8324,25 +8324,25 @@ BX.namespace('BX.Sale.OrderAjaxComponent'); if (this.loyaltyDiscount !== undefined && this.loyaltyDiscount > 0) { let loyaltyDiscount = this.bonusCurrency .replace('#', this.loyaltyDiscount.toString()); - this.totalInfoBlockNode.appendChild(this.createTotalUnit("Персональная скидка: ", loyaltyDiscount)); + this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("PERSONAL_DISCOUNT"), loyaltyDiscount)); } if (this.bitrixDiscount !== undefined && this.bitrixDiscount > 0) { let defaultDiscount = this.bonusCurrency .replace('#', this.bitrixDiscount.toString()); - this.totalInfoBlockNode.appendChild(this.createTotalUnit("Обычная скидка: ", defaultDiscount)); + this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("COMMON_DISCOUNT"), defaultDiscount)); } if (this.result.TOTAL.BONUS_PAYMENT !== undefined && this.result.TOTAL.BONUS_PAYMENT > 0) { let bonusPayment = this.bonusCurrency .replace('#', this.result.TOTAL.BONUS_PAYMENT.toString()); - this.totalInfoBlockNode.appendChild(this.createTotalUnit('Оплата бонусами:', bonusPayment)); + this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("PAYMENT_IN_BONUSES"), bonusPayment)); } if (this.result.TOTAL.WILL_BE_CREDITED !== undefined && this.result.TOTAL.WILL_BE_CREDITED > 0) { - this.totalInfoBlockNode.appendChild(this.createTotalUnit('Будет начислено бонусов: ', String(this.result.TOTAL.WILL_BE_CREDITED), {highlighted: true})); + this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("WILL_CREDITED_BONUSES"), String(this.result.TOTAL.WILL_BE_CREDITED), {highlighted: true})); } else if (this.willBeCredited > 0) { - this.totalInfoBlockNode.appendChild(this.createTotalUnit('Будет начислено бонусов:', this.willBeCredited, {highlighted: true})); + this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("WILL_CREDITED_BONUSES"), this.willBeCredited, {highlighted: true})); } } @@ -8386,4 +8386,4 @@ BX.namespace('BX.Sale.OrderAjaxComponent'); this.editMobileTotalBlock(); }; -})(); \ No newline at end of file +})(); diff --git a/intaro.retailcrm/install/export/lp-register/index.php b/intaro.retailcrm/install/export/lp-register/index.php index ff4635f6..acad4b90 100644 --- a/intaro.retailcrm/install/export/lp-register/index.php +++ b/intaro.retailcrm/install/export/lp-register/index.php @@ -1,6 +1,6 @@ SetTitle('Регистрация'); +$APPLICATION->SetTitle(GetMessage('REGISTER_LOYALTY')); ?> IncludeComponent( diff --git a/intaro.retailcrm/install/export/lp-register/lang/en/index.php b/intaro.retailcrm/install/export/lp-register/lang/en/index.php new file mode 100644 index 00000000..7fb5caa6 --- /dev/null +++ b/intaro.retailcrm/install/export/lp-register/lang/en/index.php @@ -0,0 +1,2 @@ +SetTitle("Бонусный счет"); +$APPLICATION->SetTitle(GetMessage('BONUS_ACCOUNT')); ?> IncludeComponent( @@ -10,4 +10,4 @@ $APPLICATION->SetTitle("Бонусный счет"); ); ?> - \ No newline at end of file + diff --git a/intaro.retailcrm/install/export/lp-score/lang/en/index.php b/intaro.retailcrm/install/export/lp-score/lang/en/index.php new file mode 100644 index 00000000..bbd7105e --- /dev/null +++ b/intaro.retailcrm/install/export/lp-score/lang/en/index.php @@ -0,0 +1,2 @@ +SetTitle('Регистрация'); +$APPLICATION->SetTitle(GetMessage('REGISTER')); ?> IncludeComponent( diff --git a/intaro.retailcrm/install/export/sub-register/lang/en/index.php b/intaro.retailcrm/install/export/sub-register/lang/en/index.php new file mode 100644 index 00000000..fd89eaa2 --- /dev/null +++ b/intaro.retailcrm/install/export/sub-register/lang/en/index.php @@ -0,0 +1,2 @@ +INSTALL_PATH . '/../lib/service/currencyservice.php'); include($this->INSTALL_PATH . '/../lib/component/factory/clientfactory.php'); include($this->INSTALL_PATH . '/../lib/component/apiclient/clientadapter.php'); + include($this->INSTALL_PATH . '/../lib/component/advanced/loyaltyinstaller.php'); - $this->CopyFiles(); + + /* $this->CopyFiles(); $this->addEvents(); $this->addAgreement(); - $this->addUserFields(); - $this->createCustomPropertyFile(); + $this->addUserFields();*/ - OrderLoyaltyDataService::createLoyaltyHlBlock(); + $this->installExport(); + $this->subscriptionSetup(); + //$this->createCustomPropertyFile(); + + /* OrderLoyaltyDataService::createLoyaltyHlBlock(); $service = new OrderLoyaltyDataService(); - $service->addCustomersLoyaltyFields(); + $service->addCustomersLoyaltyFields();*/ if ($step == 11) { $arResult['arSites'] = RCrmActions::getSitesList(); @@ -1121,8 +1126,6 @@ class intaro_retailcrm extends CModule 30 ); - $this->CopyFiles(); - COption::RemoveOption($this->MODULE_ID, Constants::CRM_CATALOG_BASE_PRICE); if ( @@ -1315,7 +1318,9 @@ class intaro_retailcrm extends CModule } $this->deleteFiles(); - $this->deleteLPEvents(); + + $loyalty = new LoyaltyInstaller(); + $loyalty->deleteLPEvents(); UnRegisterModule($this->MODULE_ID); diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 2fa538db..7e9597c0 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.5.23', - 'VERSION_DATE' => '2024-08-06 11:00:00' + 'VERSION' => '6.5.24', + 'VERSION_DATE' => '2024-08-06 14:30:00' ]; diff --git a/intaro.retailcrm/lib/component/advanced/installertrait.php b/intaro.retailcrm/lib/component/advanced/installertrait.php new file mode 100644 index 00000000..10ce356e --- /dev/null +++ b/intaro.retailcrm/lib/component/advanced/installertrait.php @@ -0,0 +1,109 @@ +isExists()) { + $file->putContents(""); + } + } + + public function subscriptionSetup() + { + $pathFrom = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . Constants::MODULE_ID . '/install'; + + CopyDirFiles( + $pathFrom . '/export/sub-register', + $_SERVER['DOCUMENT_ROOT'] . '/sub-register', + true, + true, + false + ); + + $templateNames = [ + 'default_subscribe' => [ + 0 => [ + 'name' => 'sale.personal.section', + 'templateDirectory' => '.default' + ], + 1 => [ + 'name' => 'main.register', + 'templateDirectory' => '.default_subscribe' + ] + ] + ]; + + foreach ($templateNames as $directory => $templates) { + foreach ($templates as $template) { + $this->copy($directory, $template); + } + } + + $property = [ + 'ENTITY_ID' => 'USER', + 'FIELD_NAME' => 'UF_SUBSCRIBE_USER_EMAIL', + 'USER_TYPE_ID' => 'boolean', + 'MULTIPLE' => 'N', + 'MANDATORY' => 'N', + 'EDIT_FORM_LABEL' => ['ru' => GetMessage('UF_SUBSCRIBE_USER_EMAIL_TITLE')], + + ]; + + $obUserField = new CUserTypeEntity(); + $dbRes = CUserTypeEntity::GetList([], ['FIELD_NAME' => 'UF_SUBSCRIBE_USER_EMAIL'])->fetch(); + + if (!$dbRes['ID']) { + $obUserField->Add($property); + } + } + + private function copy($directory, $template): void + { + $templatePath = $_SERVER['DOCUMENT_ROOT'] + . '/local/templates/.default/components/bitrix/' . $template['name'] . '/'. $directory + ; + + if (!file_exists($templatePath)) { + $pathFrom = $_SERVER['DOCUMENT_ROOT'] + . '/bitrix/modules/intaro.retailcrm/install/export/local/components/intaro/' + . $template['name'] + . '/templates/' . $template['templateDirectory'] + ; + + CopyDirFiles( + $pathFrom, + $templatePath, + true, + true, + false + ); + } + } +} diff --git a/intaro.retailcrm/lib/component/installer/installertrait.php b/intaro.retailcrm/lib/component/advanced/loyaltyinstaller.php similarity index 88% rename from intaro.retailcrm/lib/component/installer/installertrait.php rename to intaro.retailcrm/lib/component/advanced/loyaltyinstaller.php index d4038058..83512e01 100644 --- a/intaro.retailcrm/lib/component/installer/installertrait.php +++ b/intaro.retailcrm/lib/component/advanced/loyaltyinstaller.php @@ -1,6 +1,6 @@ 'main.register', 'templateDirectory' => '.default' ], - ], - - 'default_subscribe' => [ - 0 => [ - 'name' => 'sale.personal.section', - 'templateDirectory' => '.default' - ], - 1 => [ - 'name' => 'main.register', - 'templateDirectory' => '.default_subscribe' - ] ] ]; @@ -108,7 +97,7 @@ trait InstallerTrait } /** - * Добавление полей пользователя для ПЛ и подписки + * Добавление полей пользователя для ПЛ */ public function addUserFields(): void { @@ -150,10 +139,6 @@ trait InstallerTrait [ 'name' => 'UF_EXT_REG_PL_INTARO', 'title' => GetMessage('UF_EXT_REG_PL_INTARO_TITLE'), - ], - [ - 'name' => 'UF_SUBSCRIBE_USER_EMAIL', - 'title' => GetMessage('UF_SUBSCRIBE_USER_EMAIL_TITLE') ] ] ); @@ -178,7 +163,7 @@ trait InstallerTrait ]; $props = array_merge($arProps, $customProps); $obUserField = new CUserTypeEntity(); - $dbRes = CUserTypeEntity::GetList([], ['FIELD_NAME' => $filed['name']])->fetch(); + $dbRes = CUserTypeEntity::GetList([], ['FIELD_NAME' => $filed['name']])->fetch(); if (!$dbRes['ID']) { $obUserField->Add($props); @@ -232,23 +217,10 @@ trait InstallerTrait } } - public function createCustomPropertyFile(): void - { - $path = $_SERVER['DOCUMENT_ROOT'] . '/local/'; - - CheckDirPath($path); - - $file = new \Bitrix\Main\IO\File($path . 'icml_property_retailcrm.txt', $siteId = null); - - if (!$file->isExists()) { - $file->putContents(""); - } - } - /** * delete loyalty program events handlers */ - private function deleteLPEvents(): void + public function deleteLPEvents(): void { $eventManager = EventManager::getInstance(); @@ -279,7 +251,7 @@ trait InstallerTrait CopyDirFiles( $pathFrom, $templatePath, - true, + false, true, false ); diff --git a/intaro.retailcrm/lib/lang/en/service/loyaltyservice.php b/intaro.retailcrm/lib/lang/en/service/loyaltyservice.php new file mode 100644 index 00000000..695f822b --- /dev/null +++ b/intaro.retailcrm/lib/lang/en/service/loyaltyservice.php @@ -0,0 +1,20 @@ +GetCurPage() . '?mid=' . htmlspecialchars($mid) . '&lang=' . LANGUAGE_ID; @@ -41,6 +44,7 @@ if (!empty($_GET['ok']) && $_GET['ok'] === 'Y') { $arResult = []; $enabledCustom = false; +$loyaltySetup = new LoyaltyInstaller(); if (file_exists($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/intaro.retailcrm/classes/general/config/options.xml')) { $options = simplexml_load_file($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/intaro.retailcrm/classes/general/config/options.xml'); @@ -586,12 +590,19 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { if (isset($_POST['loyalty_toggle']) && $_POST['loyalty_toggle'] === 'on') { try { + $loyaltySetup->CopyFiles(); + $loyaltySetup->addEvents(); + $loyaltySetup->addAgreement(); + $loyaltySetup->addUserFields(); + $hlName = RetailCrmUtils::getHlClassByName(Constants::HL_LOYALTY_CODE); if (empty($hlName)) { OrderLoyaltyDataService::createLoyaltyHlBlock(); + $service = new OrderLoyaltyDataService(); + $service->addCustomersLoyaltyFields(); } - } catch (LoaderException | SystemException $exception) { + } catch (Exception $exception) { RCrmActions::eventLog( 'intaro.retailcrm/options.php', 'OrderLoyaltyDataService::createLoyaltyHlBlock', $e->getCode() . ': ' . $exception->getMessage() diff --git a/intaro.retailcrm/updater.php b/intaro.retailcrm/updater.php index a7c1f0d8..77382528 100644 --- a/intaro.retailcrm/updater.php +++ b/intaro.retailcrm/updater.php @@ -1182,29 +1182,6 @@ function update() Loader::includeModule('highloadblock'); COption::SetOptionString('intaro.retailcrm', 'api_version', 'v5'); - - (new LoyaltyProgramUpdater()) - ->updateBonusInfoFieldForLp() - ->updateBonusFieldsTypeInHl() - ->updateDefDiscountFieldTypeInHl(); - - UnRegisterModuleDependences("main", "OnBeforeProlog", 'intaro.retailcrm', "RetailCrmPricePrchase", "add"); - UnRegisterModuleDependences("main", "OnBeforeProlog", 'intaro.retailcrm', "RetailCrmDc", "add"); - UnRegisterModuleDependences("main", "OnBeforeProlog", 'intaro.retailcrm', "RetailCrmCc", "add"); - - (new UpdateSubscribe()) - ->CopyFiles() - ->addEvent() - ->addCustomUserField() - ; - - COption::SetOptionString( - 'intaro.retailcrm', - 'custom_fields_toggle', - 'N' - ); - - createCustomPropertyFile(); } function createCustomPropertyFile()