Conditions | 4 |
Paths | 5 |
Total Lines | 33 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function getTSVData(): array |
||
37 | { |
||
38 | $array = []; |
||
39 | $array[] = [ |
||
40 | 'id', //1 |
||
41 | 'title', //2 |
||
42 | 'description', //3 |
||
43 | 'google product category', //4 |
||
44 | 'link', //6 |
||
45 | 'image link', //7 |
||
46 | 'condition', //8 |
||
47 | 'availability', //9 |
||
48 | 'price', //10 |
||
49 | 'brand', //11 |
||
50 | 'mpn', //12 |
||
51 | 'custom label 1', //13 |
||
52 | ]; |
||
53 | |||
54 | $products = parent::getArrayBasic(); |
||
55 | |||
56 | foreach ($products as $id => $className) { |
||
57 | $productArray = []; |
||
58 | |||
59 | if (method_exists($className, 'get_data_for_google_shopping_feed')) { |
||
60 | $productArray = $className::get_data_for_google_shopping_feed($id); |
||
61 | } |
||
62 | |||
63 | if (! empty($productArray)) { |
||
64 | $array[] = $productArray; |
||
65 | } |
||
66 | } |
||
67 | |||
68 | return $array; |
||
69 | } |
||
77 |