PHP code example of netwolf103 / ecommerce-zilingo
1. Go to this page and download the library: Download netwolf103/ecommerce-zilingo library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
netwolf103 / ecommerce-zilingo example snippets
Netwolf103\Ecommerce\Zilingo\Product;
$varDir = sprintf('%s/var/1688/%s', dirname(dirname(__FILE__)), date('Y-m-d'));
if (!is_dir($varDir)) {
printf("%s dir not exists.", $varDir);
exit;
}
if ($handle = opendir($varDir)) {
while (false !== ($file = readdir($handle))) {
if ($file == '.' || $file == '..') {
continue;
}
if(substr($file, -3) != 'csv') {
continue;
}
$file = $varDir .'/'. $file;
$fileExcel = $file .'.zilingo.xlsx';
if (file_exists($fileExcel)) {
continue;
}
$product = new Product($file);
$product->saveExcel($fileExcel);
}
closedir($handle);
}