1
0
mirror of synced 2025-03-22 08:03:51 +03:00

Merge pull request #3 from iyzoer/master

fix for retailcrm
This commit is contained in:
Alex Lushpai 2017-07-14 10:11:53 +03:00 committed by GitHub
commit e21c214156
2 changed files with 9 additions and 9 deletions

View File

@ -62,11 +62,11 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
if ($this->get_option( 'api_url' ) != '' && $this->get_option( 'api_key' ) != '') { if ($this->get_option( 'api_url' ) != '' && $this->get_option( 'api_key' ) != '') {
if ( ! class_exists( 'WC_Retailcrm_Client' ) ) { if ( ! class_exists( 'WC_Retailcrm_Proxy' ) ) {
include_once( __DIR__ . '/api/class-wc-retailcrm-client.php' ); include_once( __DIR__ . '/api/class-wc-retailcrm-proxy.php' );
} }
$retailcrm = new WC_Retailcrm_Client( $retailcrm = new WC_Retailcrm_Proxy(
$this->get_option( 'api_url' ), $this->get_option( 'api_url' ),
$this->get_option( 'api_key' ) $this->get_option( 'api_key' )
); );
@ -191,7 +191,7 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
'description' => 'Отметьте данный пункт, если хотите выгружать остатки товаров из CRM в магазин.' 'description' => 'Отметьте данный пункт, если хотите выгружать остатки товаров из CRM в магазин.'
); );
$options = array_filter(get_option( 'woocommerce_integration-ecomlogic_settings' )); $options = array_filter(get_option( 'woocommerce_integration-retailcrm_settings' ));
if (!isset($options['uploads'])) { if (!isset($options['uploads'])) {
$this->form_fields[] = array( $this->form_fields[] = array(
@ -203,11 +203,11 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
$this->form_fields['upload-button'] = array( $this->form_fields['upload-button'] = array(
'label' => 'Выгрузить', 'label' => 'Выгрузить',
'title' => __( 'Выгрузка клиентов и заказов', 'woocommerce-integration-ecomlogic' ), 'title' => __( 'Выгрузка клиентов и заказов', 'woocommerce-integration-retailcrm' ),
'type' => 'button', 'type' => 'button',
'description' => __( 'Пакетная выгрузка существующих клиентов и заказов.', 'woocommerce-integration-ecomlogic' ), 'description' => __( 'Пакетная выгрузка существующих клиентов и заказов.', 'woocommerce-integration-retailcrm' ),
'desc_tip' => true, 'desc_tip' => true,
'id' => 'uploads-ecomlogic' 'id' => 'uploads-retailcrm'
); );
} }
} }

View File

@ -300,14 +300,14 @@ function upload_to_crm() {
$orders->ordersUpload(); $orders->ordersUpload();
$options['uploads'] = 'yes'; $options['uploads'] = 'yes';
update_option('woocommerce_integration-ecomlogic_settings', $options); update_option('woocommerce_integration-retailcrm_settings', $options);
} }
function ajax_upload() { function ajax_upload() {
$ajax_url = admin_url('admin-ajax.php'); $ajax_url = admin_url('admin-ajax.php');
?> ?>
<script type="text/javascript" > <script type="text/javascript" >
jQuery('#uploads-ecomlogic').bind('click', function() { jQuery('#uploads-retailcrm').bind('click', function() {
jQuery.ajax({ jQuery.ajax({
type: "POST", type: "POST",
url: '<?php echo $ajax_url; ?>?action=do_upload', url: '<?php echo $ajax_url; ?>?action=do_upload',