Skip to content

Little library for parsing commerceml2 files.

Notifications You must be signed in to change notification settings

dven84/commerceml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Парсер CommerceML2

Библиотека для парсинга CommerceML2 файлов. В основу была взята библиотека zenwalker/commerceml, за что разработчику zenwolker отдельное спасибо.

Установка

  1. Обновите ваш composer.json файл.
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/ArtemsWay/commerceml"
    }
],
"require": {

    "artemsway/commerceml": "dev-master"
},
  1. Выполните команду 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();
    }

}

Выходные данные var_dump($data)

array:6 [▼
  "importTime" => "2016-03-01T01:03:19"
  "onlyChanges" => false
  "categories" => array:218 [▶]
  "properties" => array:608 [▶]
  "priceTypes" => array:1 [▶]
  "products" => array:4535 [▶]
]

About

Little library for parsing commerceml2 files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%