Библиотека для парсинга CommerceML2 файлов. В основу была взята библиотека zenwalker/commerceml, за что разработчику zenwolker отдельное спасибо.
- Обновите ваш composer.json файл.
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ArtemsWay/commerceml"
}
],
"require": {
"artemsway/commerceml": "dev-master"
},
- Выполните команду
composer update
.
use ArtemsWay\CommerceML\CommerceML;
class ExampleController extends Controller {
public function exampleAction() {
$importFile = storage_path('import0_1.xml');
$offersFile = storage_path('offers0_1.xml');
$reader = new CommerceML($importFile, $offersFile);
$data = $reader->getData();
}
}
array:6 [▼
"importTime" => "2016-03-01T01:03:19"
"onlyChanges" => false
"categories" => array:218 [▶]
"properties" => array:608 [▶]
"priceTypes" => array:1 [▶]
"products" => array:4535 [▶]
]