PHPackages                             codefit/ecommerce-xml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. codefit/ecommerce-xml

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codefit/ecommerce-xml
=====================

Generátor XML feedů pro Zboží CZ, Heureka CZ, Heureka SK, Google Merchant, Facebook

2.0.1(2mo ago)053MITPHPPHP ^8.1

Since May 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/codefit/ecommerce-xml)[ Packagist](https://packagist.org/packages/codefit/ecommerce-xml)[ RSS](/packages/codefit-ecommerce-xml/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Feeds XML Generator
===================

[](#feeds-xml-generator)

Tento balíček umožňuje generovat XML feedy pro různé služby (Google, Heureka, Zbozi, Facebook) s podporou validace a dynamického nastavení parametrů.

Instalace
---------

[](#instalace)

```
composer require codefit/ecommerce-xml
```

Použití
-------

[](#použití)

### Google Feed

[](#google-feed)

```
use Feeds\XmlGenerator\Feed\Google;
use Feeds\XmlGenerator\Entities\GoogleItem;
use Feeds\XmlGenerator\Exceptions\ValidationException;

try {
    $feed = new Google([
        'namespace' => 'http://www.w3.org/2005/Atom',
        'root_element' => 'feed'
    ]);

    // Nastavení autora, linku a title
    $feed->setAuthor('Codefit Webdesign');
    $feed->setLink('https://www.codefit.cz/');
    $feed->setTitle('Produkty');

    // Vzorová data produktů
    $products = [
        [
            'id' => '12345',
            'title' => 'iPhone 13 Pro',
            'description' => 'Nejnovější iPhone s výkonným čipem A15 Bionic',
            'link' => 'https://example.com/iphone-13-pro',
            'image_link' => 'https://example.com/images/iphone-13-pro.jpg',
            'price' => 34990.00,
            'brand' => 'Apple',
            'gtin' => '1234567890123',
            'mpn' => 'IP13P256',
            'google_product_category' => 'Electronics > Phones & Accessories > Mobile Phones'
        ]
    ];

    // Přidání produktů do feedu
    foreach ($products as $productData) {
        $item = new GoogleItem();
        $item->setId($productData['id'])
            ->setTitle($productData['title'])
            ->setDescription($productData['description'])
            ->setLink($productData['link'])
            ->setImageLink($productData['image_link'])
            ->setPriceVat($productData['price'])
            ->setBrand($productData['brand'])
            ->setGtin($productData['gtin'])
            ->setMpn($productData['mpn'])
            ->setGoogleProductCategory($productData['google_product_category']);

        $feed->addItem($item);
        $feed->addAvailability('in stock');
        $feed->addCondition('new');
        $feed->addShipping('CZ', 'Standard', 99.00);
        $feed->addShipping('CZ', 'Express', 149.00);
        $feed->addTax('CZ', '21', true);
    }

    // Generování a uložení feedu
    $feed->save('google.xml');
} catch (ValidationException $e) {
    echo "Chyba při generování Google feedu: " . $e->getMessage() . "\n";
}
```

### Heureka Feed

[](#heureka-feed)

```
use Feeds\XmlGenerator\Feed\Heureka;
use Feeds\XmlGenerator\Entities\HeurekaItem;
use Feeds\XmlGenerator\Enums\HeurekaDeliveryMethod;
use Feeds\XmlGenerator\Exceptions\ValidationException;

try {
    $feed = new Heureka([
        'namespace' => 'http://www.heureka.cz/ns/offer/1.0',
        'root_element' => 'SHOP',
        'country' => 'cz'
    ]);

    // Vzorová data produktů
    $products = [
        [
            'itemId' => '12345',
            'productName' => 'iPhone 13 Pro',
            'product' => 'Apple iPhone 13 Pro 256GB',
            'description' => 'Nejnovější iPhone s výkonným čipem A15 Bionic',
            'categoryText' => 'Elektronika | Mobilní telefony | Apple',
            'ean' => '1234567890123',
            'productNo' => 'IP13P256',
            'manufacturer' => 'Apple',
            'url' => 'https://example.com/iphone-13-pro',
            'deliveryDate' => 0,
            'imgUrl' => 'https://example.com/images/iphone-13-pro.jpg',
            'priceVat' => 34990.00
        ]
    ];

    // Přidání produktů do feedu
    foreach ($products as $productData) {
        $item = new HeurekaItem();
        $item->setItemId($productData['itemId'])
            ->setProductName($productData['productName'])
            ->setProduct($productData['product'])
            ->setDescription($productData['description'])
            ->setCategoryText($productData['categoryText'])
            ->setEan($productData['ean'])
            ->setProductNo($productData['productNo'])
            ->setManufacturer($productData['manufacturer'])
            ->setUrl($productData['url'])
            ->setDeliveryDate($productData['deliveryDate'])
            ->setImgUrl($productData['imgUrl'])
            ->setPriceVat($productData['priceVat']);

        $feed->addItem($item);
        $feed->addParameter('barva', 'Grafit');
        $feed->addParameter('kapacita', '256 GB');
        $feed->addDelivery(HeurekaDeliveryMethod::DPD, 99.0);
        $feed->addDelivery(HeurekaDeliveryMethod::PPL, 89.0);
        $feed->addGift('Obal zdarma');
        $feed->addWarranty('Rozšířená záruka', 36);
    }

    // Generování a uložení feedu
    $feed->save('heureka.xml');
} catch (ValidationException $e) {
    echo "Chyba při generování Heureka feedu: " . $e->getMessage() . "\n";
}
```

### Zbozi Feed

[](#zbozi-feed)

```
use Feeds\XmlGenerator\Feed\Zbozi;
use Feeds\XmlGenerator\Entities\ZboziItem;
use Feeds\XmlGenerator\Enums\ZboziDeliveryMethod;
use Feeds\XmlGenerator\Exceptions\ValidationException;

try {
    $feed = new Zbozi([
        'namespace' => 'http://www.zbozi.cz/ns/offer/1.0',
        'root_element' => 'SHOP'
    ]);

    // Vzorová data produktů
    $products = [
        [
            'itemId' => '12345',
            'productName' => 'iPhone 13 Pro',
            'product' => 'Apple iPhone 13 Pro 256GB',
            'description' => 'Nejnovější iPhone s výkonným čipem A15 Bionic',
            'categoryText' => 'Elektronika | Mobilní telefony | Apple',
            'ean' => '1234567890123',
            'productNo' => 'IP13P256',
            'manufacturer' => 'Apple',
            'url' => 'https://example.com/iphone-13-pro',
            'deliveryDate' => 0,
            'imgUrl' => 'https://example.com/images/iphone-13-pro.jpg',
            'priceVat' => 34990.0,
            'maxCpc' => 5.80,
            'maxCpcSearch' => 4.50
        ]
    ];

    // Přidání produktů do feedu
    foreach ($products as $productData) {
        $item = new ZboziItem();
        $item->setItemId($productData['itemId'])
            ->setProductName($productData['productName'])
            ->setProduct($productData['product'])
            ->setDescription($productData['description'])
            ->setCategoryText($productData['categoryText'])
            ->setEan($productData['ean'])
            ->setProductNo($productData['productNo'])
            ->setManufacturer($productData['manufacturer'])
            ->setUrl($productData['url'])
            ->setDeliveryDate($productData['deliveryDate'])
            ->setImgUrl($productData['imgUrl'])
            ->setPriceVat($productData['priceVat'])
            ->setMaxCpc($productData['maxCpc'])
            ->setMaxCpcSearch($productData['maxCpcSearch']);

        $feed->addItem($item);
        $feed->addParameter('barva', 'Grafit');
        $feed->addParameter('kapacita', '256 GB');
        $feed->addDelivery(ZboziDeliveryMethod::DPD, 99.0);
        $feed->addDelivery(ZboziDeliveryMethod::PPL, 89.0);
        $feed->addExtraMessage('free_gift', 'Obal zdarma');
        $feed->addExtraMessage('extended_warranty', 'Rozšířená záruka 3 roky');
    }

    // Generování a uložení feedu
    $feed->save('zbozi.xml');
} catch (ValidationException $e) {
    echo "Chyba při generování Zbozi feedu: " . $e->getMessage() . "\n";
}
```

### Facebook Feed

[](#facebook-feed)

```
use Feeds\XmlGenerator\Feed\Facebook;
use Feeds\XmlGenerator\Entities\FacebookItem;
use Feeds\XmlGenerator\Exceptions\ValidationException;

try {
    $feed = new Facebook();

    // Nastavení autora, linku a title
    $feed->setAuthor('Codefit Webdesign');
    $feed->setLink('https://www.codefit.cz/');
    $feed->setTitle('Produkty');

    // Vzorová data produktů
    $products = [
        [
            'id' => '12345',
            'title' => 'iPhone 13 Pro',
            'description' => 'Nejnovější iPhone s výkonným čipem A15 Bionic',
            'link' => 'https://example.com/iphone-13-pro',
            'image_link' => 'https://example.com/images/iphone-13-pro.jpg',
            'price' => 34990.00,
            'brand' => 'Apple',
            'availability' => 'in stock',
            'condition' => 'new'
        ],
        [
            'id' => '12346',
            'title' => 'Samsung Galaxy S21',
            'description' => 'Výkonný Android telefon s kvalitním fotoaparátem',
            'link' => 'https://example.com/samsung-galaxy-s21',
            'image_link' => 'https://example.com/images/samsung-galaxy-s21.jpg',
            'price' => 29990.00,
            'brand' => 'Samsung',
            'availability' => 'in stock',
            'condition' => 'new'
        ]
    ];

    // Přidání produktů do feedu
    foreach ($products as $productData) {
        $item = new FacebookItem();
        $item->setId($productData['id'])
            ->setTitle($productData['title'])
            ->setDescription($productData['description'])
            ->setLink($productData['link'])
            ->setImageLink($productData['image_link'])
            ->setPriceVat($productData['price'])
            ->setBrand($productData['brand'])
            ->setAvailability($productData['availability'])
            ->setCondition($productData['condition']);

        $feed->addItem($item);
    }

    // Generování a uložení feedu
    $feed->save('examples/xml/facebook.xml');
} catch (ValidationException $e) {
    echo "Chyba při generování Facebook feedu: " . $e->getMessage() . "\n";
}
```

### Povinné atributy produktu

[](#povinné-atributy-produktu)

- `id` - Unikátní identifikátor produktu
- `title` - Název produktu
- `description` - Popis produktu
- `link` - URL produktu
- `image_link` - URL obrázku produktu
- `price` - Cena produktu s DPH
- `brand` - Značka produktu
- `availability` - Dostupnost produktu (in stock, out of stock, preorder)
- `condition` - Stav produktu (new, used, refurbished)

Entity
------

[](#entity)

### GoogleItem

[](#googleitem)

VlastnostTypPopisidstringUnikátní identifikátor produktutitlestringNázev produktudescriptionstringPopis produktulinkstringURL produktuimage\_linkstringURL obrázku produktupriceVatfloatCena s DPHbrandstringZnačka produktugtinstringGTIN (EAN) kódmpnstringVýrobní číslogoogle\_product\_categorystringKategorie produktu v Google### HeurekaItem

[](#heurekaitem)

VlastnostTypPopisitemIdstringUnikátní identifikátor produktuproductNamestringNázev produktuproductstringPlný název produktudescriptionstringPopis produktucategoryTextstringKategorie produktueanstringEAN kódproductNostringVýrobní číslomanufacturerstringVýrobceurlstringURL produktudeliveryDateintPočet dní do dodání (0 = skladem)imgUrlstringURL obrázku produktupriceVatfloatCena s DPHparametersarrayParametry produktudeliveryarrayMožnosti dopravygiftsarrayDárky k produktuwarrantiesarrayZáruky### ZboziItem

[](#zboziitem)

VlastnostTypPopisitemIdstringUnikátní identifikátor produktuproductNamestringNázev produktuproductstringPlný název produktudescriptionstringPopis produktucategoryTextstringKategorie produktueanstringEAN kódproductNostringVýrobní číslomanufacturerstringVýrobceurlstringURL produktudeliveryDateintPočet dní do dodání (0 = skladem)imgUrlstringURL obrázku produktupriceVatfloatCena s DPHmaxCpcfloatMaximální CPC pro obsahovou síťmaxCpcSearchfloatMaximální CPC pro vyhledáváníparametersarrayParametry produktudeliveryarrayMožnosti dopravyextraMessagesarrayExtra zprávyEnums
-----

[](#enums)

### HeurekaDeliveryMethod

[](#heurekadeliverymethod)

Hodnoty odpovídají [DELIVERY\_ID ve specifikaci Heureka XML feedu](https://sluzby.heureka.cz/napoveda/xml-feed/#DELIVERY).

- **Doručení na adresu:** `CESKA_POSTA`, `CESKA_POSTA_DOPORUCENA_ZASILKA`, `CSAD_LOGISTIK_OSTRAVA`, `DPD`, `DHL`, `DSV`, `FOFR`, `GEBRUDER_WEISS`, `GEIS`, `GLS`, `PPL`, `SEEGMULLER`, `TOPTRANS`, `UPS`, `FEDEX`, `RABEN_LOGISTICS`, `ZASILKOVNA_NA_ADRESU`, `ONE_COURIER`, `RHENUS_LOGISTICS`, `MESSENGER`, `BALIKOVNA_NA_ADRESU`, `QDL`, `DB_SCHENKER`, `EMONS`
- **Výdejní místa:** `ZASILKOVNA`, `DPD_PICKUP`, `BALIKOVNA_DEPOTAPI`, `ONE_POINT`, `PPL_PARCELSHOP`, `GLS_PARCELSHOP`, `ALZAPOINT`, `UPS_ACCESS_POINT`
- **Výdejní boxy:** `DPD_BOX`, `Z_BOX`, `ONE_BOX`, `PPL_PARCELBOX`, `BALIKOVNA_BOX`, `ALZABOX`, `GLS_PARCELBOX`
- **Ostatní:** `ONLINE`, `VLASTNI_PREPRAVA`

### ZboziDeliveryMethod

[](#zbozideliverymethod)

Hodnoty odpovídají [DELIVERY (DELIVERY\_ID) ve specifikaci Zboží.cz / Sklik](https://napoveda.sklik.cz/reklamy/xml-feed/specifikace/).

- **Výdejní místa:** `ALZABOX`, `CESKA_POSTA_BALIKOVNA`, `CESKA_POSTA_NA_POSTU`, `DPD_PICKUP`, `GLS_PARCELSHOP`, `PPL_PARCELSHOP`, `TOPTRANS_DEPO`, `ONE_POINT`, `ZASILKOVNA`, `VLASTNI_VYDEJNI_MISTA`
- **Dopravci:** `KURYR_123` (123\_KURYR), `CESKA_POSTA`, `BALIKOVNA_NA_ADRESU`, `DACHSER`, `DB_SCHENKER`, `DPD`, `DHL`, `DSV`, `EMONS`, `FOFR`, `GEBRUDER_WEISS`, `GEIS`, `GLS`, `HDS`, `HELICAR`, `IN_TIME_KURYR`, `ONE_COURIER`, `NAS_KURYR`, `MESSENGER`, `LAGERMAX`, `PPL`, `TNT`, `TOPTRANS`, `UPS`, `FEDEX`, `RABEN_LOGISTICS`, `RHENUS`, `ZASILKOVNA_NA_ADRESU`, `VLASTNI_PREPRAVA`

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance83

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Total

5

Last Release

84d ago

Major Versions

1.1.1 → 2.0.02026-01-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/9becd2d5ca6bca18ddc82f1d7a47e4de6c278e0e495c36ddc4227bccd29c2e16?d=identicon)[David Kojecký](/maintainers/David%20Kojeck%C3%BD)

---

Top Contributors

[![codefit](https://avatars.githubusercontent.com/u/17836699?v=4)](https://github.com/codefit "codefit (18 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codefit-ecommerce-xml/health.svg)

```
[![Health](https://phpackages.com/badges/codefit-ecommerce-xml/health.svg)](https://phpackages.com/packages/codefit-ecommerce-xml)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
