plugin updates
This commit is contained in:
@@ -614,19 +614,7 @@ class Hubwoo_Admin {
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="notice notice-success hubwoo-review-notice-wrapper">
|
||||
<div class="hubwoo-ocs-options hubwoo-pl-notice">
|
||||
<p>
|
||||
<strong><?php echo esc_html__( 'Liked our HubSpot WooCommerce Integration? Tell us what you loved in it.', 'makewebbetter-hubspot-for-woocommerce' ); ?></strong>
|
||||
</p>
|
||||
<div class="hubwoo-wrapper-notice">
|
||||
<a target="_blank" href="https://wordpress.org/plugins/makewebbetter-hubspot-for-woocommerce/#reviews" class="hubwoo-btn--notific hubwoo-hide-rev-notice"><?php esc_html_e( 'Review Us.', 'makewebbetter-hubspot-for-woocommerce' ); ?></a>
|
||||
<a class="hubwoo-close-size hubwoo-hide-rev-notice" href="#">Dismiss</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
if ( 'yes' != get_option( 'hubwoo_connection_complete', 'no' ) ) {
|
||||
?>
|
||||
@@ -717,19 +705,23 @@ class Hubwoo_Admin {
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="notice notice-success hubwoo-hpos-notice-wrapper">
|
||||
<div class="hubwoo-ocs-options hubwoo-pl-notice">
|
||||
<p>
|
||||
<strong><?php echo esc_html__( 'Activate our HPOS addon for seamless compatibility between HubSpot WooCommerce integration and HPOS functionality.', 'makewebbetter-hubspot-for-woocommerce' ); ?></strong>
|
||||
</p>
|
||||
<div class="hubwoo-wrapper-notice">
|
||||
<a target="_blank" href="https://makewebbetter.com/product/hubspot-woocommerce-hpos-compatibility/?utm_source=MWB-HubspotFree-backend&utm_medium=MWB-backend&utm_campaign=backend" class="hubwoo-btn--notific"><?php esc_html_e( 'Buy Now', 'makewebbetter-hubspot-for-woocommerce' ); ?></a>
|
||||
<a class="hubwoo-close-size hubwoo-hide-hpos-notice fa fa-times"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if( 'yes' == get_option('woocommerce_custom_orders_table_enabled', 'no') ) {
|
||||
?>
|
||||
hello
|
||||
<div class="notice notice-warning hubwoo-hpos-notice-wrapper">
|
||||
<div class="hubwoo-ocs-options hubwoo-pl-notice">
|
||||
<p>
|
||||
<strong><?php echo esc_html__( "We noticed you're using WooCommerce HPOS. To ensure compatibility with the HubSpot WooCommerce plugin, please install the HPOS Addon.", 'makewebbetter-hubspot-for-woocommerce' ); ?></strong>
|
||||
</p>
|
||||
<div class="hubwoo-wrapper-notice">
|
||||
<a target="_blank" href="https://makewebbetter.com/product/hubspot-woocommerce-hpos-compatibility/?utm_source=MWB-HubspotFree-backend&utm_medium=MWB-backend&utm_campaign=backend" class="hubwoo-btn--notific"><?php esc_html_e( 'Install Now', 'makewebbetter-hubspot-for-woocommerce' ); ?></a>
|
||||
<a class="hubwoo-close-size hubwoo-hide-hpos-notice fa fa-times"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1202,7 +1194,7 @@ class Hubwoo_Admin {
|
||||
'type' => 'number',
|
||||
'desc' => esc_html__( 'Delete Abandoned cart data form woocommerce store.', 'makewebbetter-hubspot-for-woocommerce' ),
|
||||
'desc_tip' => true,
|
||||
'custom_attributes' => array( 'min' => '30' ),
|
||||
'custom_attributes' => array( 'min' => '7' ),
|
||||
'default' => '30',
|
||||
);
|
||||
|
||||
@@ -1982,7 +1974,7 @@ class Hubwoo_Admin {
|
||||
|
||||
return count( get_users( $args ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Background sync for Deals.
|
||||
*
|
||||
@@ -1990,6 +1982,7 @@ class Hubwoo_Admin {
|
||||
* @param int $order_id order id.
|
||||
*/
|
||||
public function hubwoo_ecomm_deal_upsert( $order_id ) {
|
||||
|
||||
if ( empty( $order_id ) ) {
|
||||
return;
|
||||
}
|
||||
@@ -1997,6 +1990,72 @@ class Hubwoo_Admin {
|
||||
HubwooObjectProperties::get_instance()->hubwoo_ecomm_deals_sync( $order_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Background sync for Deals.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function hubwoo_ecomm_deal_update( ) {
|
||||
|
||||
if ( 'no' == get_option( 'hubwoo_ecomm_setup_completed', 'no' ) || 'yes' === get_option( 'hubwoo_connection_issue', 'no' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
//hpos changes
|
||||
if ( Hubwoo::hubwoo_check_hpos_active() ) {
|
||||
|
||||
$query = new WC_Order_Query(array(
|
||||
'posts_per_page' => 3,
|
||||
'post_status' => array_keys( wc_get_order_statuses() ),
|
||||
'orderby' => 'date',
|
||||
'order' => 'desc',
|
||||
'return' => 'ids',
|
||||
'no_found_rows' => true,
|
||||
'ignore_sticky_posts' => true,
|
||||
'post_parent' => 0,
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'hubwoo_ecomm_deal_upsert',
|
||||
'compare' => '==',
|
||||
'value' => 'yes',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
$failed_orders = $query->get_orders();
|
||||
} else {
|
||||
// CPT-based orders are in use.
|
||||
$query = new WP_Query();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'shop_order',
|
||||
'posts_per_page' => 3,
|
||||
'post_status' => array_keys( wc_get_order_statuses() ),
|
||||
'orderby' => 'date',
|
||||
'order' => 'desc',
|
||||
'fields' => 'ids',
|
||||
'no_found_rows' => true,
|
||||
'ignore_sticky_posts' => true,
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'hubwoo_ecomm_deal_upsert',
|
||||
'compare' => '==',
|
||||
'value' => 'yes',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$failed_orders = $query->query( $args );
|
||||
}
|
||||
|
||||
if ( ! empty( $failed_orders ) ) {
|
||||
foreach ( $failed_orders as $order_id ) {
|
||||
HubwooObjectProperties::get_instance()->hubwoo_ecomm_deals_sync( $order_id );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Background sync for Deals.
|
||||
*
|
||||
@@ -3147,18 +3206,30 @@ class Hubwoo_Admin {
|
||||
* @param int $order_id order id to be updated.
|
||||
*/
|
||||
public function hubwoo_ecomm_deal_update_order( $order_id ) {
|
||||
|
||||
|
||||
if ( ! empty( $order_id ) ) {
|
||||
|
||||
$order = wc_get_order( $order_id );
|
||||
|
||||
$upsert_meta = $order->get_meta('hubwoo_ecomm_deal_upsert', 'no');
|
||||
|
||||
if( $upsert_meta == 'yes'){
|
||||
return;
|
||||
}
|
||||
|
||||
$post_type = get_post_type( $order_id );
|
||||
|
||||
if ( 'shop_subscription' == $post_type ) {
|
||||
return;
|
||||
}
|
||||
if ('yes' == get_option('woocommerce_custom_orders_table_data_sync_enabled', 'no') || 'yes' == get_option('woocommerce_custom_orders_table_enabled', 'no')) {
|
||||
|
||||
if ('yes' == get_option('woocommerce_custom_orders_table_data_sync_enabled', 'no') && 'yes' == get_option('woocommerce_custom_orders_table_enabled', 'no')) {
|
||||
return;
|
||||
}
|
||||
as_schedule_single_action( time() + 10, 'hubwoo_ecomm_deal_upsert', array( $order_id ) );
|
||||
|
||||
$order->update_meta_data('hubwoo_ecomm_deal_upsert', 'yes');
|
||||
$order->save();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1767,7 +1767,7 @@
|
||||
const deal_property = await jQuery.ajax({ type : 'POST', url : ajaxUrl, data : { action : 'hubwoo_deals_create_property', hubwooSecurity, }, dataType : 'json', });
|
||||
|
||||
allCreatedProperties = allCreatedProperties.map((prop) => { return prop.replace(/["']/g, "").trim()})
|
||||
await saveUpdates( { 'hubwoo-groups-created': allCreatedGroups, 'hubwoo-properties-created': allCreatedProperties, 'hubwoo_fields_setup_completed': 1, 'hubwoo_pro_setup_completed': 1, 'hubwoo_plugin_version': '1.5.5' } );
|
||||
await saveUpdates( { 'hubwoo-groups-created': allCreatedGroups, 'hubwoo-properties-created': allCreatedProperties, 'hubwoo_fields_setup_completed': 1, 'hubwoo_pro_setup_completed': 1, 'hubwoo_plugin_version': '1.5.6' } );
|
||||
await runEcommSetup();
|
||||
updateProgressBar( 100 );
|
||||
transferScreen( 'move-to-list' );
|
||||
|
||||
Reference in New Issue
Block a user