/
import-producttypes.php
48 lines (39 loc) · 963 Bytes
/
import-producttypes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Import Producttypes into your project.
*
* This little helper imports given producttypes as json files into
* your commercetools project.
*
* PHP Version 5
*
* @category commercetools-php-import-producttypes
* @package Import
* @author Marcel Thiesies <thiesies@bestit-online.de>
* @copyright 2015 best it
* @license MIT
* @version 0.1
* @link http://www.bestit-online.de/
* @since 10.08.15 - 08:18
* @deprecated Not deprecated
*/
// require helper functions
require __DIR__ . '/functions.php';
/**
* @param $files
* @return null
*/
function _run ($files) {
importLog('START Import');
foreach ($files as $file) {
$file = __DIR__ . '/data/types_nested/' . $file;
importLog($file);
if(file_exists($file)){
postProductTypes($file);
}
}
importLog('DONE Import');
return null;
}
// import product types
_run(getProductTypes());