plugin updates
This commit is contained in:
@@ -46,6 +46,11 @@ if ( ! class_exists( 'Hubwoo_Activator' ) ) {
|
||||
as_schedule_recurring_action( time(), 300, 'hubwoo_deals_sync_check' );
|
||||
}
|
||||
|
||||
if ( ! as_next_scheduled_action( 'hubwoo_ecomm_deal_update' ) ) {
|
||||
|
||||
as_schedule_recurring_action( time(), 180, 'hubwoo_ecomm_deal_update' );
|
||||
}
|
||||
|
||||
if ( ! as_next_scheduled_action( 'hubwoo_products_sync_check' ) ) {
|
||||
|
||||
as_schedule_recurring_action( time(), 300, 'hubwoo_products_sync_check' );
|
||||
|
||||
@@ -47,6 +47,7 @@ if ( ! class_exists( 'Hubwoo_Deactivator' ) ) {
|
||||
as_unschedule_action( 'hubwoo_contacts_sync_background' );
|
||||
as_unschedule_action( 'hubwoo_check_logs' );
|
||||
as_unschedule_action( 'hubwoo_ecomm_deal_upsert' );
|
||||
as_unschedule_action( 'hubwoo_ecomm_deal_update' );
|
||||
as_unschedule_action( 'huwoo_abncart_clear_old_cart' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ if ( ! class_exists( 'Hubwoo' ) ) {
|
||||
$this->version = HUBWOO_VERSION;
|
||||
} else {
|
||||
|
||||
$this->version = '1.5.5';
|
||||
$this->version = '1.5.6';
|
||||
}
|
||||
|
||||
$this->plugin_name = 'makewebbetter-hubspot-for-woocommerce';
|
||||
@@ -286,6 +286,7 @@ if ( ! class_exists( 'Hubwoo' ) ) {
|
||||
if ( 'yes' == get_option( 'hubwoo_ecomm_deal_enable', 'yes' ) ) {
|
||||
|
||||
$this->loader->add_action( 'hubwoo_ecomm_deal_upsert', $plugin_admin, 'hubwoo_ecomm_deal_upsert' );
|
||||
$this->loader->add_action( 'hubwoo_ecomm_deal_update', $plugin_admin, 'hubwoo_ecomm_deal_update' );
|
||||
$this->loader->add_action( 'hubwoo_deals_sync_check', $plugin_admin, 'hubwoo_deals_sync_check' );
|
||||
$this->loader->add_action( 'hubwoo_products_sync_check', $plugin_admin, 'hubwoo_products_sync_check' );
|
||||
$this->loader->add_action( 'hubwoo_deals_sync_background', $plugin_admin, 'hubwoo_deals_sync_background', 10, 2 );
|
||||
@@ -298,7 +299,9 @@ if ( ! class_exists( 'Hubwoo' ) ) {
|
||||
// HubSpot deals hooks.
|
||||
if ( 'yes' == get_option( 'hubwoo_ecomm_setup_completed', 'no' ) ) {
|
||||
|
||||
$this->loader->add_action( 'save_post_shop_order', $plugin_admin, 'hubwoo_ecomm_deal_update_order' );
|
||||
if( 'yes' != get_option('woocommerce_custom_orders_table_enabled', 'no') ) {
|
||||
$this->loader->add_action( 'save_post_shop_order', $plugin_admin, 'hubwoo_ecomm_deal_update_order' );
|
||||
}
|
||||
}
|
||||
|
||||
$this->loader->add_action( 'hubwoo_contacts_sync_background', $plugin_admin, 'hubwoo_contacts_sync_background' );
|
||||
@@ -552,7 +555,7 @@ if ( ! class_exists( 'Hubwoo' ) ) {
|
||||
|
||||
if ( self::is_setup_completed() ) {
|
||||
|
||||
return get_option( 'hubwoo_pro_version', '1.5.5' );
|
||||
return get_option( 'hubwoo_pro_version', '1.5.6' );
|
||||
} else {
|
||||
|
||||
return HUBWOO_VERSION;
|
||||
@@ -2686,6 +2689,10 @@ if ( ! class_exists( 'Hubwoo' ) ) {
|
||||
as_schedule_recurring_action( time(), 300, 'hubwoo_deals_sync_check' );
|
||||
}
|
||||
|
||||
if ( ! as_next_scheduled_action( 'hubwoo_ecomm_deal_update' ) ) {
|
||||
as_schedule_recurring_action( time(), 300, 'hubwoo_ecomm_deal_update' );
|
||||
}
|
||||
|
||||
if ( ! as_next_scheduled_action( 'hubwoo_products_sync_check' ) ) {
|
||||
as_schedule_recurring_action( time(), 300, 'hubwoo_products_sync_check' );
|
||||
}
|
||||
@@ -2698,7 +2705,7 @@ if ( ! class_exists( 'Hubwoo' ) ) {
|
||||
as_schedule_recurring_action( time(), 86400, 'huwoo_abncart_clear_old_cart' );
|
||||
}
|
||||
|
||||
if ( ! as_next_scheduled_action( 'hubwoo_cron_schedule' ) || ! as_next_scheduled_action( 'hubwoo_deals_sync_check' ) ) {
|
||||
if ( ! as_next_scheduled_action( 'hubwoo_cron_schedule' ) || ! as_next_scheduled_action( 'hubwoo_deals_sync_check' ) || ! as_next_scheduled_action( 'hubwoo_ecomm_deal_update' ) ) {
|
||||
$cron_status['status'] = false;
|
||||
$cron_status['type'] = esc_html__( 'You are having issues with your MWB HubSpot for WooCommerce sync. Please read this doc on how to fix your integration.', 'makewebbetter-hubspot-for-woocommerce' );
|
||||
}
|
||||
|
||||
@@ -345,22 +345,28 @@ class HubwooDataSync {
|
||||
|
||||
$email = $hubwoo_customer->get_email();
|
||||
$user_data = get_user_by( 'email', $email );
|
||||
$role = $user_data->roles[0];
|
||||
|
||||
if ( in_array( $role, $role__in ) || in_array( $role, $user_role_in ) ) {
|
||||
if( ! empty( $user_data ) ) {
|
||||
|
||||
if ( empty( $email ) ) {
|
||||
delete_user_meta( $id, 'hubwoo_pro_user_data_change' );
|
||||
continue;
|
||||
if( ! empty( $user_data->roles[0] ) ) {
|
||||
|
||||
$role = $user_data->roles[0];
|
||||
if ( in_array( $role, $role__in ) || in_array( $role, $user_role_in ) ) {
|
||||
|
||||
if ( empty( $email ) ) {
|
||||
delete_user_meta( $id, 'hubwoo_pro_user_data_change' );
|
||||
continue;
|
||||
}
|
||||
$properties = $hubwoo_customer->get_contact_properties();
|
||||
$user_properties = $hubwoo_customer->get_user_data_properties( $properties );
|
||||
$properties_data = array(
|
||||
'email' => $email,
|
||||
'properties' => $user_properties,
|
||||
);
|
||||
|
||||
$contacts[] = $properties_data;
|
||||
}
|
||||
}
|
||||
$properties = $hubwoo_customer->get_contact_properties();
|
||||
$user_properties = $hubwoo_customer->get_user_data_properties( $properties );
|
||||
$properties_data = array(
|
||||
'email' => $email,
|
||||
'properties' => $user_properties,
|
||||
);
|
||||
|
||||
$contacts[] = $properties_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,6 +345,10 @@ class HubwooObjectProperties {
|
||||
}
|
||||
}
|
||||
|
||||
$order->update_meta_data('hubwoo_ecomm_deal_upsert', 'no');
|
||||
$order->delete_meta_data('hubwoo_ecomm_deal_upsert');
|
||||
$order->save();
|
||||
|
||||
$response = self::hubwoo_ecomm_sync_line_items( $order_id );
|
||||
|
||||
return $response;
|
||||
@@ -352,7 +356,6 @@ class HubwooObjectProperties {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create and Associate Line Items for an order.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user