1
0
Fork 0
mirror of synced 2025-04-03 22:03:34 +03:00

Added manual uploading of promotional price types.

Added translations
This commit is contained in:
Ivan Chaplygin 2024-09-09 14:08:53 +03:00
parent 9f86ace5ba
commit f676469ad6
8 changed files with 67 additions and 4 deletions

View file

@ -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"

View file

@ -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 "Акционные цены выгружены"

View file

@ -72,6 +72,25 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
<?php
}
public function ajax_upload_loyalty_price()
{
$ajax_url = admin_url('admin-ajax.php');
?>
<script type="text/javascript">
jQuery('#upload-loyalty-price-retailcrm').bind('click', function () {
jQuery.ajax({
type: "POST",
url: '<?php echo $ajax_url; ?>?action=upload_loyalty_price',
success: function (response) {
alert('<?php echo __('Promotional prices unloaded', 'retailcrm');?>');
console.log('AJAX response : ', response);
}
});
})
</script>
<?php
}
/**
* Initialize integration settings form fields.
*/
@ -651,6 +670,18 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
),
];
$this->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'),

View file

@ -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();
}

View file

@ -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",

Binary file not shown.

View file

@ -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",

Binary file not shown.