Jump to content

Working script for syncing Woocommerce stock (very basic!)


Recommended Posts

We are currently using the API to sync the stock-count to Woocommerce using this API, by using the receipts. 
The API works very good, responds fast and I like how the cursor works. 
 

I provided the script below for inspiration;
https://www.virtualstuff.org/scripts/syncloyverse.php.txt
 

It gets the receipts since the last few hours/days and finds the products by barcode. It simply subtracts the stock-count in Woocommerce by the amount of sales on the Loyverse-receipt. 
Everytime the script runs, it continues from the previous run by storing a "sync date"
 

It requires the PHP Woocommerce API which can be installed using the command "composer require automattic/woocommerce".
It requires modifying the firstlines for the correct API-codes. 

  • Like 1
  • Fire 1
Link to post
Share on other sites
  • 4 weeks later...

Hi Gemma,

 

This sounds fantastic. Maybe we can mixed our parts. I‘m programming several connections to woo, too. I‘m waiting for the Post api for a item, contact and orders... Sync, let’s stay in contact.

 

cu

martin

  • Like 3
Link to post
Share on other sites
  • 3 months later...
  • Similar Content

    • By Avashiva
      Hello, I'm thinking of getting woosa to connect it with Woocommerce and Loyverse.
      My question is that woosa sync the orders to loyverse and in the features they say it will sync into receipts in Loyverse.
      Will it print the receipt as it syncs? or have to be done manually?
      If it doesn't print it automatically, is there any way to make it happened? It would be a very good feature to be added as would solve the automatic printing problem that are facing all the Woocommerce sites, as loyverse seems to connect easily so all the thermal printers.
       
      Kind regards

Loyverse Point of Sale

 

 

 

 

×
×
  • Create New...