Add hpos
This commit is contained in:
parent
2d579db3b5
commit
2b873deef6
3 changed files with 7 additions and 7 deletions
|
@ -1355,6 +1355,7 @@ if (!class_exists('WC_Retailcrm_History')) :
|
|||
|
||||
if ($wcObject instanceof WC_Order) {
|
||||
$wcObject->update_meta_data($metaKey, $crmData['customFields'][$customKey]);
|
||||
$wcObject->save_meta_data();
|
||||
} else {
|
||||
update_user_meta($wcObject->get_id(), $metaKey, $crmData['customFields'][$customKey]);
|
||||
}
|
||||
|
|
|
@ -202,10 +202,3 @@ function useHpos()
|
|||
return class_exists(Automattic\WooCommerce\Utilities\OrderUtil::class)
|
||||
&& Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled();
|
||||
}
|
||||
|
||||
// TODO добавить правильно
|
||||
add_action('before_woocommerce_init', function() {
|
||||
if (class_exists( Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
|
||||
Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', 'retailcrm.php', true);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -211,4 +211,10 @@ if (!class_exists( 'WC_Integration_Retailcrm')) :
|
|||
$plugin->register_deactivation_hook();
|
||||
|
||||
add_action('plugins_loaded', ['WC_Integration_Retailcrm', 'get_instance'], 0);
|
||||
|
||||
add_action('before_woocommerce_init', function() {
|
||||
if (class_exists( Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
|
||||
Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
|
||||
}
|
||||
});
|
||||
endif;
|
||||
|
|
Loading…
Add table
Reference in a new issue