Fix for jquery error in sync.js
-
This plugin does not work. The sync function causes several problems. The first is that it kills jQuery in the wordpress admin. The second is it fails to sync and eventually times out with a 404.
The jQuery problem can be fixed as per here://$(document).ready(function(){
jQuery(document).ready(function($){
$(‘#sync_loader’).hide();
$(‘#engagebay-wc-sync-btn’).click(function(){
if ((!$(‘#engagebay-wc-import-contacts’).is(‘:checked’))&&(!$(‘#engagebay-wc-import-orders’).is(‘:checked’))&&(!$(‘#engagebay-wc-import-products’).is(‘:checked’))) {
return;
}
$(‘#engagebay-wc-sync-btn’).val(‘Sync Is In Progress…’);
$(‘#sync_loader’).show();
$.ajax({
url: ajax_url.url,
type: ‘POST’,
data: {
action: ‘engagebay_wc_ajax’,
engagebay_wc_import_contacts: $(‘#engagebay-wc-import-contacts’).is(‘:checked’) ? ‘on’ : ‘off’,
engagebay_wc_import_orders: $(‘#engagebay-wc-import-orders’).is(‘:checked’) ? ‘on’ : ‘off’,
engagebay_wc_import_products: $(‘#engagebay-wc-import-products’).is(‘:checked’) ? ‘on’ : ‘off’
},
success: function(data){
$(‘#sync_loader’).hide();
if(data === ‘success’)
$(‘#engagebay-wc-sync-btn’).val(‘Sync’);
},
error: function(data) {
console.log(data);
}
})
})
})
The topic ‘Fix for jquery error in sync.js’ is closed to new replies.