1
0
Fork 0
mirror of synced 2025-04-06 07:13:33 +03:00
Adding an error translation
Fix duplicate text
This commit is contained in:
Ivan Chaplygin 2024-04-05 10:37:26 +03:00
parent a571f21fe8
commit 670c794fdf
3 changed files with 19 additions and 3 deletions

View file

@ -474,3 +474,6 @@ msgstr "Условия обработки персональных данных"
msgid "Insert the terms and conditions for processing personal data"
msgstr "Вставьте условия обработки персональных данных"
msgid "To activate the loyalty program it is necessary to activate the work with coupons!"
msgstr "Для активации программы лояльности необходимо активировать работу с купонами!"

View file

@ -20,12 +20,16 @@ jQuery(function() {
})
.done(function (response) {
if (response.coupon_status !== 'yes') {
alert('lol');
var checkElement = jQuery('#woocommerce_integration-retailcrm_loyalty');
checkElement.parent().css('color', 'red');
checkElement.css('border-color', 'red');
checkElement.parent().parent().append("<p style='color: red'>Test</p>");
checkElement.prop('checked', false);
if (!jQuery('#coupon_warning').length) {
checkElement.parent().parent().append(
"<p id='coupon_warning' style='color: red'>" + response.translate.coupon_warning + "</p>"
);
}
}
})
}

View file

@ -604,7 +604,16 @@ if (!class_exists('WC_Retailcrm_Base')) {
public function get_status_coupon()
{
echo json_encode(['coupon_status' => get_option('woocommerce_enable_coupons')]);
echo json_encode(
[
'coupon_status' => get_option('woocommerce_enable_coupons'),
'translate' => [
'coupon_warning' => __(
'To activate the loyalty program it is necessary to activate the work with coupons!',
'retailcrm'
)
]
]);
wp_die();
}