2017 © Pedro PelΓ‘ez
 

library commerceml

Library for parsing CommerceML files

image

carono/commerceml

Library for parsing CommerceML files

  • Saturday, March 10, 2018
  • by carono
  • Repository
  • 1 Watchers
  • 0 Stars
  • 302 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 18 Forks
  • 0 Open issues
  • 6 Versions
  • 6 % Grown

The README.md

Scrutinizer Code Quality Code Coverage Build Status Latest Stable Version Total Downloads License, (*1)

PHP CommerceML

Π‘ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° для ΡƒΠ½ΠΈΠ²Π΅Ρ€ΡΠ°Π»ΡŒΠ½ΠΎΠ³ΠΎ парсинга CommerceML2 Ρ„Π°ΠΉΠ»ΠΎΠ²., (*2)

Установка

composer require carono/commerceml, (*3)

ΠšΠ°Ρ‚Π°Π»ΠΎΠ³ ΠΈ Ρ‚ΠΎΠ²Π°Ρ€Ρ‹

// $filePath - ΠΏΠΎΠ»Π½Ρ‹ΠΉ ΠΏΡƒΡ‚ΡŒ Π΄ΠΎ XML Ρ„Π°ΠΉΠ»Π° import.xml ΠΈΠ»ΠΈ ΠΊΠΎΠ½Ρ‚Π΅Π½Ρ‚
$cml = new CommerceML();
$cml->loadImportXml('/fullpath/import.xml'); // Π—Π°Π³Ρ€ΡƒΠΆΠ°Π΅ΠΌ Ρ‚ΠΎΠ²Π°Ρ€Ρ‹
$cml->loadOffersXml('/fullpath/offers.xml'); // Π—Π°Π³Ρ€ΡƒΠΆΠ°Π΅ΠΌ прСдлоТСния

Π Π°Π±ΠΎΡ‚Π° с Ρ‚ΠΎΠ²Π°Ρ€Π°ΠΌΠΈ ΠΈ прСдлоТСниями

foreach ($cml->catalog->products as $product){
    echo $product->name; // Π’Ρ‹Π²ΠΎΠ΄ΠΈΠΌ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Ρ‚ΠΎΠ²Π°Ρ€Π° (Π’ΠΎΠ²Π°Ρ€Ρ‹->Π’ΠΎΠ²Π°Ρ€->НаимСнованиС)
    foreach ($product->offers as $offer){
        echo $offer->name; // Π’Ρ‹Π²ΠΎΠ΄ΠΈΠΌ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ прСдлоТСния (ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ->ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅->НаимСнованиС)
        echo $offer->prices[0]->cost; // Π’Ρ‹Π²ΠΎΠ΄ΠΈΠΌ ΠΏΠ΅Ρ€Π²ΡƒΡŽ Ρ†Π΅Π½Ρƒ прСдлоТСния (ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ->ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅->Π¦Π΅Π½Ρ‹->Π¦Π΅Π½Π°->Π¦Π΅Π½Π°Π—Π°Π•Π΄ΠΈΠ½ΠΈΡ†Ρƒ)
    }
}

\Zenwalker\CommerceML\CommerceML

ΠœΠ΅Ρ‚ΠΎΠ΄ XML ОписаниС
catalog ΠšΠ°Ρ‚Π°Π»ΠΎΠ³ ΠžΠ±ΡŠΠ΅ΠΊΡ‚ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π°
classifier ΠšΠ»Π°ΡΡΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ ΠžΠ±ΡŠΠ΅ΠΊΡ‚ классификатора
offerPackage ΠŸΠ°ΠΊΠ΅Ρ‚ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ ΠžΠ±ΡŠΠ΅ΠΊΡ‚ ΠΏΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ

\Zenwalker\CommerceML\Model\OfferPackage

ΠœΠ΅Ρ‚ΠΎΠ΄ XML ОписаниС
offers ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ->ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Бписок всСх ΠΏΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ
priceTypes Π’ΠΈΠΏΡ‹Π¦Π΅Π½->Π’ΠΈΠΏΠ¦Π΅Π½Ρ‹ Бписок всСх Ρ‚ΠΈΠΏΠΎΠ² Ρ†Π΅Π½

\Zenwalker\CommerceML\Model\Product

ΠœΠ΅Ρ‚ΠΎΠ΄ XML ОписаниС
properties ΠšΠ°Ρ‚Π°Π»ΠΎΠ³->Π’ΠΎΠ²Π°Ρ€Ρ‹->Π’ΠΎΠ²Π°Ρ€->ЗначСнияБвойств Бвойства ΠΏΡ€ΠΎΠ΄ΡƒΠΊΡ‚Π°, $product->properties[0]->value
requisites ΠšΠ°Ρ‚Π°Π»ΠΎΠ³->Π’ΠΎΠ²Π°Ρ€Ρ‹->Π’ΠΎΠ²Π°Ρ€->ЗначСнияРСквизитов->Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅Π Π΅ΠΊΠ²ΠΈΠ·ΠΈΡ‚Π° Π Π΅ΠΊΠ²ΠΈΠ·ΠΈΡ‚Ρ‹ ΠΏΡ€ΠΎΠ΄ΡƒΠΊΡ‚Π°, $product->requisites[0]->value
offers ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ->ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Бписок ΠΏΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ для ΠΏΡ€ΠΎΠ΄ΡƒΠΊΡ‚Π°
group ΠšΠ°Ρ‚Π°Π»ΠΎΠ³->Π’ΠΎΠ²Π°Ρ€Ρ‹->Π’ΠΎΠ²Π°Ρ€->Π“Ρ€ΡƒΠΏΠΏΡ‹=>ΠšΠ»Π°ΡΡΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€->Π³Ρ€ΡƒΠΏΠΏΡ‹->Π³Ρ€ΡƒΠΏΠΏΠ° Π“Ρ€ΡƒΠΏΠΏΠ° Ρ‚ΠΎΠ²Π°Ρ€Π° $product->group->name
images ΠšΠ°Ρ‚Π°Π»ΠΎΠ³->Π’ΠΎΠ²Π°Ρ€Ρ‹->Π’ΠΎΠ²Π°Ρ€->ΠšΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° Бписок ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΎΠΊ Ρƒ Ρ‚ΠΎΠ²Π°Ρ€Π°

\Zenwalker\CommerceML\Model\Offer

ΠœΠ΅Ρ‚ΠΎΠ΄ XML ОписаниС
prices ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ->ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅->Π¦Π΅Π½Ρ‹->Π¦Π΅Π½Π° ВсС Ρ†Π΅Π½Ρ‹ прСдлоТСния
specifications ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ->ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅->Π₯арактСристикиВовара->Π₯арактСристикаВовара Бписок всСх характСристик прСдлоТСния

The Versions

10/03 2018

dev-master

9999999-dev https://github.com/zenwalker/php-commerceml

Library for parsing CommerceML files

  Sources   Download

MIT

The Development Requires

1c commerceml

28/11 2017

0.2.2

0.2.2.0 https://github.com/zenwalker/php-commerceml

Library for parsing CommerceML files

  Sources   Download

MIT

1c commerceml

20/07 2017

0.2.1

0.2.1.0 https://github.com/zenwalker/php-commerceml

Library for parsing CommerceML files

  Sources   Download

MIT

1c commerceml

19/05 2017

0.2.0

0.2.0.0 https://github.com/zenwalker/php-commerceml

Library for parsing CommerceML files

  Sources   Download

MIT

1c commerceml

11/05 2017

0.1.0

0.1.0.0 https://github.com/zenwalker/php-commerceml

Library for parsing CommerceML files

  Sources   Download

MIT

1c commerceml

11/05 2017

v2.x-dev

2.9999999.9999999.9999999-dev https://github.com/zenwalker/php-commerceml

Library for parsing CommerceML files

  Sources   Download

MIT

1c commerceml