WooZone Amazon price update not working Fix (Solution 2018)

/, Woozone, Wordpress/WooZone Amazon price update not working Fix (Solution 2018)

Woozone (Products synchronization) Price Update Solution

This is my solution for Woozone Products synchronization problem fix

The code will click on “Sync Now” Button for each product in the List
You can delete already updated products (for this month for example August)

Woozone price update does not work anymore for me, so I have made this code to automatically update over 2000 products.

Last Update 27.01.2018

IMPORTANT : must  , so the page does not refresh.

Now the code checks for errors and goes to the next pages.

Now it also updates the variations !

Please choose 5 products per page.

Instructions (javascript code)

1. Open the link in Chrome : https://…./wp-admin/admin.php?page=WooZone_synclog
2. Select 500 product per page (MAX , more will break the website)
3. Press F12
4. Put the code in the console and press enter

var seconds = 10;
var products = document.getElementsByClassName("WooZone-sync-table-row ");
var nextPage = document.getElementsByClassName("next-page WooZone-jump-page");

function startUpdate(i) {
setTimeout(function() {
update(i)
}, 1000 * seconds);
}

function update(i) {
if (products[i]) {
button = products[i].getElementsByTagName("button");
button[0].click();
console.log(i + 1 + " updated");
}
i++;
if (i <= products.length) {
startUpdate(i);
} else {
checkNotUpdatedProducts();
}
}

function goToNextPage() {
console.log("Products updated ! Going to the next page.");
currentPage = document.getElementsByClassName("current-page");
totalPages = document.getElementsByClassName("total-pages");
if (currentPage[0].value < parseInt(totalPages[0].innerText)) {
nextPage[0].click();
setTimeout(function() {
openMinusVariations();
openPlusVariations();
products = document.getElementsByClassName("WooZone-sync-table-row ");
console.log("Starting to update products on page : " + currentPage[0].value);
startUpdate(0);
}, 10000);
}
}

function checkNotUpdatedProducts() {
errorsIndex = [];
checkProducts = document.getElementsByClassName("WooZone-row-loading-marker");
for (i = 0; i < checkProducts.length; i++) { if (checkProducts[i].style.display != 'none') { errorsIndex.push(document.getElementsByClassName("WooZone-sync-table-row ")[i]); } } products = errorsIndex; if (products.length > 0) {
console.log("Some products are not updated, fixing this now.");
startUpdate(0);
} else {
goToNextPage();
}
}

function openMinusVariations() {
var minusVariations = document.getElementsByClassName("wz-show-variations sign-minus");
Array.from(minusVariations).forEach(function(element) {
setTimeout(function() {
element.click()
}, 1000);
});
setTimeout(function() {
products = document.getElementsByClassName("WooZone-sync-table-row ");
}, 8000);
}

function openPlusVariations() {
var plusVariations = document.getElementsByClassName("wz-show-variations sign-plus");
Array.from(plusVariations).forEach(function(element) {
setTimeout(function() {
element.click()
}, 1000);
});
setTimeout(function() {
products = document.getElementsByClassName("WooZone-sync-table-row ");
}, 8000);
}
openMinusVariations();
openPlusVariations();
startUpdate(0);

UPDATE 27-01-2018

If you get any error updating prices with variations this is because the server is overloaded.
You can try to update prices without variations, this works faster :

var seconds = 10;
var products = document.getElementsByClassName("WooZone-sync-table-row ");
var nextPage = document.getElementsByClassName("next-page WooZone-jump-page");

function startUpdate(i) {
setTimeout(function() {
update(i)
}, 1000 * seconds);
}

function update(i) {
if (products[i]) {
button = products[i].getElementsByTagName("button");
button[0].click();
console.log(i + 1 + " updated");
}
i++;
if (i <= products.length) {
startUpdate(i);
} else {
checkNotUpdatedProducts();
}
}

function goToNextPage() {
console.log("Products updated ! Going to the next page.");
currentPage = document.getElementsByClassName("current-page");
totalPages = document.getElementsByClassName("total-pages");
if (currentPage[0].value < parseInt(totalPages[0].innerText)) {
nextPage[0].click();
setTimeout(function() {
products = document.getElementsByClassName("WooZone-sync-table-row ");
console.log("Starting to update products on page : " + currentPage[0].value);
startUpdate(0);
}, 10000);
}
}

function checkNotUpdatedProducts() {
errorsIndex = [];
checkProducts = document.getElementsByClassName("WooZone-row-loading-marker");
for (i = 0; i < checkProducts.length; i++) { if (checkProducts[i].style.display != 'none') { errorsIndex.push(document.getElementsByClassName("WooZone-sync-table-row ")[i]); } } products = errorsIndex; if (products.length > 0) {
console.log("Some products are not updated, fixing this now.");
startUpdate(0);
} else {
goToNextPage();
}
}

startUpdate(0);

“I’ve updated WooZone and I’m having problems with the Synchronization module”
The basic functionalty of WooZone is to let you import products from Amazon into your WordPress + WooCommerce website.
But if the synchronization module for the price update is not working , you will have issues with Amazon putting at risk your account, because you are showing wrong product prices on your affiliated website.

Update : Another solution is to run WordPress and WooZone from localhost

By | 2018-01-27T12:34:59+00:00 August 29th, 2017|6 Comments

6 Comments

  1. AndreiW August 29, 2017 at 7:35 pm - Reply

    Life saver,thank you amigo!

  2. ChrisV August 31, 2017 at 6:48 am - Reply

    Hi Adrian,

    Thanks a lot, for a really neat solution to the sync problem. I followed the instructions and placed the code in the console and hit enter. It paused for a while and then returned this below the script:

    initiateTimeOut(0);
    undefined
    VM2830:16 0
    VM2830:22 0 deleted
    VM2830:16 1
    VM2830:22 1 deleted
    VM2830:16 2
    VM2830:22 2 deleted

    I have three Amazon products on my site with several variations each. When I hit enter, the Sync log didn’t show any syncs had been performed? What detailed settings do you recommend? I stopped the auto re-load but should I disable the WP_CRON too?
    Also do I need to manually change the date in this script each month?
    I’m not sure what is happening here, could you explain it a bit more for me please?
    Thanks,
    Chris.

    • adrianweb August 31, 2017 at 5:35 pm - Reply

      1. You have only 3 products ? How many Sync Now buttons do you see in the page ?
      2. The log says “deleted” because i used this code to update the products that haven’t been updated from July.
      3. You don’t have to make any settings

      To update all your products use this code :

      var seconds = 10;
       
      var rows = document.getElementsByClassName("WooZone-sync-table-row ");
      var table = document.getElementsByTagName("table")[1];
      var buttonRow = null;
       
      function initiateTimeOut(i) {
        setTimeout(function() { update(i) }, 1000 * seconds);
      }
      function update(i) {
          console.log(i);
              
              if(rows[i]){
                  button = rows[i].getElementsByTagName("button");
                  console.log(i + " updated");
                  button[0].click();  
              }
           
          i++;
      	
          if (i <= rows.length) {
              initiateTimeOut(i); 
          }
      }
       
      initiateTimeOut(0);
      
      

      For more you can contact me on Facebook, I will help you.

  3. JeffS September 8, 2017 at 8:36 pm - Reply

    Seems to have worked – thanks!

  4. Melissa September 15, 2017 at 9:11 pm - Reply

    WOW awesome it really worked, thank you! i had no idea i could run a script like that in crhome console, pretty neat! Saved me from scrapping woocommerce just because of amazon affiliate pricing issue!!

  5. Will June 2, 2018 at 7:42 am - Reply

    Hey there. When I try to run the top script on even 20 products per page, I get the Aw Snap on Chrome and it asks me to reload the page. Do you know kind of settings I can set on my server that will help expand this complete? Originally, when you first posted this article, it completed just fine, but recently it is giving me the Aw Snap reload. Any ideas? Setting the time out settings on the server higher? I even tried splitting up the script. First expanding everything and then running another script on the page to update the products now that they were expanded. Any ideas?

    I still love the code. Thanks for posting it.

Leave A Comment