Edit order create hook, added check correct data in base class (#6)
This commit is contained in:
parent
6aa9d3c1fd
commit
1e114cd22e
@ -49,6 +49,7 @@ if ( ! class_exists( 'WC_Retailcrm_Proxy' ) ) :
|
||||
|
||||
public function __call($method, $arguments)
|
||||
{
|
||||
if (!isset($this->retailcrm)) return;
|
||||
try {
|
||||
$response = call_user_func_array(array($this->retailcrm, $method), $arguments);
|
||||
|
||||
|
@ -94,10 +94,10 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
|
||||
/**
|
||||
* Shipping options
|
||||
*/
|
||||
|
||||
$shipping_option_list = array();
|
||||
$retailcrm_shipping_list = $retailcrm->deliveryTypesList();
|
||||
|
||||
if ($retailcrm_shipping_list->isSuccessful()) {
|
||||
foreach ($retailcrm_shipping_list['deliveryTypes'] as $retailcrm_shipping_type) {
|
||||
$shipping_option_list[$retailcrm_shipping_type['code']] = $retailcrm_shipping_type['name'];
|
||||
}
|
||||
@ -127,14 +127,15 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment options
|
||||
*/
|
||||
|
||||
$payment_option_list = array();
|
||||
$retailcrm_payment_list = $retailcrm->paymentTypesList();
|
||||
|
||||
if ($retailcrm_payment_list->isSuccessful()) {
|
||||
foreach ($retailcrm_payment_list['paymentTypes'] as $retailcrm_payment_type) {
|
||||
$payment_option_list[$retailcrm_payment_type['code']] = $retailcrm_payment_type['name'];
|
||||
}
|
||||
@ -164,6 +165,7 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Statuses options
|
||||
@ -171,6 +173,7 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
|
||||
$statuses_option_list = array();
|
||||
$retailcrm_statuses_list = $retailcrm->statusesList();
|
||||
|
||||
if ($retailcrm_statuses_list->isSuccessful()) {
|
||||
foreach ($retailcrm_statuses_list['statuses'] as $retailcrm_status) {
|
||||
$statuses_option_list[$retailcrm_status['code']] = $retailcrm_status['name'];
|
||||
}
|
||||
@ -195,7 +198,11 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
|
||||
'desc_tip' => true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inventories options
|
||||
*/
|
||||
$this->form_fields[] = array(
|
||||
'title' => __( 'Настройки остатков', 'woocommerce' ),
|
||||
'type' => 'title',
|
||||
@ -211,6 +218,9 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
|
||||
'description' => 'Отметьте данный пункт, если хотите выгружать остатки товаров из CRM в магазин.'
|
||||
);
|
||||
|
||||
/**
|
||||
* Uploads options
|
||||
*/
|
||||
$options = array_filter(get_option( 'woocommerce_integration-retailcrm_settings' ));
|
||||
|
||||
if (!isset($options['uploads'])) {
|
||||
|
@ -335,7 +335,7 @@ register_deactivation_hook( __FILE__, 'retailcrm_deactivation' );
|
||||
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option( 'active_plugins')))) {
|
||||
load_plugin_textdomain('wc_retailcrm', false, dirname(plugin_basename( __FILE__ )) . '/');
|
||||
add_filter('cron_schedules', 'filter_cron_schedules', 10, 1);
|
||||
add_action('woocommerce_thankyou', 'retailcrm_process_order', 10, 1);
|
||||
add_action('woocommerce_checkout_order_processed', 'retailcrm_process_order', 10, 1);
|
||||
add_action('retailcrm_history', 'retailcrm_history_get');
|
||||
add_action('retailcrm_icml', 'generate_icml');
|
||||
add_action('retailcrm_inventories', 'load_stocks');
|
||||
|
Loading…
x
Reference in New Issue
Block a user