Here we write the e-shop link of the script that updates the availability. The #PID variable is used for the Product handle of the item and the #STO variable is for the availability.
for example: https://www.sbzsystems.com/stockupdate.php?productid=#PID&quantity=#STO
If we do not specify a variable, then all the availabilities sent together in the “web_availabilities.tmp” text file in the following format:
ex. https://www.sbzsystems.com/stockupdate.php?quantity=#STO
1 |
product code|quantity|barcodes |
1 2 3 |
C31781|7 C28743|2 C34485|6 |
Example of downloading an EMDI file via PHP:
1 2 3 4 5 6 7 8 9 10 |
//UPLOAD FILE $uploadfile = $tmp_path . '/web_availabilities.tmp'; move_uploaded_file($_FILES['document']['tmp_name'], $uploadfile); echo 'ok'."\n"; if (file_exists($uploadfile)) { $all = file_get_contents($uploadfile); ... } |
Synchronize a custom field to availability
Also the sum of the availability of the fields we have set, goes to the custom field with the “t” suffix.
Important
- If the answer from the link is a blank page, it is assumed that the process failed.
- If no custom fields are defined, then main availability is sent.
- Products are only sent if they has been updated in some way:
- a document with an action has been created (“None” action does not affect any product so no information is sent)
- If the Select window does not open in sync, it’s because we have not set the pair of databases between which sync will be. We go from the DB’s/ Companies button and set up the remote database tab.
- If the availability does not go to the site, then check if the EMDI folder, personal \ user, creates the “web_availabilities.tmp” file. If it does not exist then you can set a previous date and sync again: