1
0
Fork 0
mirror of synced 2025-04-06 07:13:33 +03:00
This commit is contained in:
Uryvskiy Dima 2023-12-06 14:24:16 +03:00
parent 2d579db3b5
commit 2b873deef6
3 changed files with 7 additions and 7 deletions

View file

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

View file

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

View file

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