@@ -34,7 +34,7 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
3434 public function __construct ()
3535 {
3636 $ this ->id = 'integration-retailcrm ' ;
37- $ this ->method_title = esc_html__ ('Simla.com ' , 'woo_retailcrm ' );
37+ $ this ->method_title = esc_html__ ('Simla.com ' , 'woo-retailcrm ' );
3838 $ this ->method_description = esc_html__ ('Integration with Simla.com management system ' , 'woo-retailcrm ' );
3939
4040 static ::$ option_key = $ this ->get_option_key ();
@@ -55,14 +55,14 @@ public function __construct()
5555 */
5656 public function ajax_retailcrm_generate_icml ()
5757 {
58- $ ajax_url = esc_url ( admin_url ('admin-ajax.php ' ) );
58+ $ ajax_url = admin_url ('admin-ajax.php ' );
5959 ?>
6060 <script type="text/javascript">
6161 jQuery('#icml-retailcrm, #wp-admin-bar-retailcrm_ajax_generate_icml').bind('click', function() {
6262 jQuery.ajax({
6363 type: "POST",
64- url: '<?php echo $ ajax_url; ?> ? action=retailcrm_generate_icml',
65- data: { _ajax_nonce: '<?php echo wp_create_nonce ('woo-retailcrm-admin-nonce ' ); ?> '},
64+ url: '<?php echo esc_js ( $ ajax_url . ' ? action=retailcrm_generate_icml' ); ?> ',
65+ data: { _ajax_nonce: '<?php echo esc_js ( wp_create_nonce ('woo-retailcrm-admin-nonce ' )) ; ?> ' },
6666 success: function (response) {
6767 alert('<?php echo esc_html__ ('Catalog was generated ' , 'woo-retailcrm ' ); ?> ');
6868 console.log('AJAX response : ', response);
@@ -75,14 +75,14 @@ public function ajax_retailcrm_generate_icml()
7575
7676 public function ajax_retailcrm_upload_loyalty_price ()
7777 {
78- $ ajax_url = esc_url ( admin_url ('admin-ajax.php ' ) );
78+ $ ajax_url = admin_url ('admin-ajax.php ' );
7979 ?>
8080 <script type="text/javascript">
8181 jQuery('#upload-loyalty-price-retailcrm').bind('click', function () {
8282 jQuery.ajax({
8383 type: "POST",
84- url: '<?php echo $ ajax_url; ?> ? action=retailcrm_upload_loyalty_price',
85- data: { _ajax_nonce: '<?php echo wp_create_nonce ('woo-retailcrm-admin-nonce ' ); ?> '},
84+ url: '<?php echo esc_js ( $ ajax_url . ' ? action=retailcrm_upload_loyalty_price' ); ?> ',
85+ data: { _ajax_nonce: '<?php echo esc_js ( wp_create_nonce ('woo-retailcrm-admin-nonce ' ) ); ?> '},
8686 success: function (response) {
8787 alert('<?php echo esc_html__ ('Promotional prices unloaded ' , 'woo-retailcrm ' );?> ');
8888 console.log('AJAX response : ', response);
@@ -263,13 +263,9 @@ public function init_form_fields()
263263
264264 foreach ($ wc_shipping_list as $ shipping_code => $ shipping ) {
265265 if (isset ($ shipping ['enabled ' ]) && $ shipping ['enabled ' ] == static ::YES ) {
266- $ title = $ shipping ['title ' ] ? esc_html ($ shipping ['title ' ]): '' ;
267- $ description = $ shipping ['description ' ] ? esc_html ($ shipping ['description ' ]) : '' ;
268-
269-
270266 $ this ->form_fields [$ shipping_code ] = [
271- 'title ' => esc_html__ ( $ title, ' woo-retailcrm ' ) ,
272- 'description ' => esc_html__ ( $ description, ' woo-retailcrm ' ) ,
267+ 'title ' => $ shipping [ ' title ' ] ,
268+ 'description ' => $ shipping [ ' description ' ] ,
273269 'css ' => 'min-width:350px; ' ,
274270 'class ' => 'select ' ,
275271 'type ' => 'select ' ,
@@ -718,7 +714,7 @@ public function init_form_fields()
718714
719715 $ this ->form_fields ['corporate_enabled ' ] = [
720716 'title ' => esc_html__ ('Corporate customers support ' , 'woo-retailcrm ' ),
721- 'label ' => esc_html__ ('Enabled ' ),
717+ 'label ' => esc_html__ ('Enabled ' , ' woo-retailcrm ' ),
722718 'description ' => '' ,
723719 'class ' => 'checkbox ' ,
724720 'type ' => 'checkbox ' ,
@@ -813,13 +809,13 @@ public function generate_button_html($key, $data)
813809 <tr valign="top">
814810 <th scope="row" class="titledesc">
815811 <label for="<?php echo esc_attr ($ field ); ?> "><?php echo wp_kses_post ($ data ['title ' ]); ?> </label>
816- <?php echo $ this ->get_tooltip_html ($ data ); ?>
812+ <?php echo esc_attr ( $ this ->get_tooltip_html ($ data) ); ?>
817813 </th>
818814 <td class="forminp">
819815 <fieldset>
820816 <legend class="screen-reader-text"><span><?php echo wp_kses_post ($ data ['label ' ]); ?> </span></legend>
821- <button id="<?php echo $ data ['id ' ]; ?> " class="<?php echo esc_attr ($ data ['class ' ]); ?> " type="button" name="<?php echo esc_attr ($ field ); ?> " id="<?php echo esc_attr ($ field ); ?> " style="<?php echo esc_attr ($ data ['css ' ]); ?> " <?php echo $ this ->get_custom_attribute_html ($ data ); ?> ><?php echo wp_kses_post ($ data ['label ' ]); ?> </button>
822- <?php echo $ this ->get_description_html ($ data ); ?>
817+ <button id="<?php echo esc_attr ( $ data ['id ' ]) ; ?> " class="<?php echo esc_attr ($ data ['class ' ]); ?> " type="button" name="<?php echo esc_attr ($ field ); ?> " id="<?php echo esc_attr ($ field ); ?> " style="<?php echo esc_attr ($ data ['css ' ]); ?> " <?php echo esc_attr ( $ this ->get_custom_attribute_html ($ data) ); ?> ><?php echo wp_kses_post ($ data ['label ' ]); ?> </button>
818+ <?php echo esc_attr ( $ this ->get_description_html ($ data) ); ?>
823819 </fieldset>
824820 </td>
825821 </tr>
0 commit comments