https://github.com/softwarepunt/php-delegate-b2b-dgxml
PHP Library for working with Delegate Group B2B Catalog XML files (DGXML)
https://github.com/softwarepunt/php-delegate-b2b-dgxml
b2b delegate delegate-group dgxml php xml
Last synced: 4 months ago
JSON representation
PHP Library for working with Delegate Group B2B Catalog XML files (DGXML)
- Host: GitHub
- URL: https://github.com/softwarepunt/php-delegate-b2b-dgxml
- Owner: SoftwarePunt
- License: mit
- Created: 2021-07-16T13:19:46.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-16T14:06:49.000Z (about 2 years ago)
- Last Synced: 2025-02-08T17:18:11.377Z (4 months ago)
- Topics: b2b, delegate, delegate-group, dgxml, php, xml
- Language: PHP
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-delegate-b2b-dgxml
**PHP Library for working with Delegate Group B2B XML files (DGXML)**.[](https://github.com/SoftwarePunt/php-delegate-b2b-dgxml/actions/workflows/phpunit.yml)
[](https://packagist.org/packages/softwarepunt/php-delegate-b2b-dgxml)👉 Currently only supports exporting the Article-/Price Catalog to Delegate DGXML format.
## Installation
### Requirements
- PHP 8.0+
- with extension: dom, intl
- [Composer](https://getcomposer.org/)### Setup
Use Composer to add the package as a dependency to your project:```shell
composer require softwarepunt/php-delegate-b2b-dgxml
```## Usage
### Creating a catalog
Using this library, you can build the catalog by simply assigning PHP objects and values. The structure and property names match the XML and documentation. Each property is type-hinted and contains phpdocs based on the official documentation.📕 To best understand the structure of the catalog, refer to the official documentation (`ArticleCatalog DGXML 1.0_EN`).
Create a new `ProductCatalog` and assign items to it, then export it as XML:
```php
Header->Supplier = new Supplier();
$catalog->Header->Supplier->GLN = "9389229119441";
$catalog->Header->Supplier->Name = "Backshop";$item = new CatalogItem();
$item->Number = 1602;
$item->Name = "Fuldkornsbrød";
$item->Price->Purchase = 1.6;$catalog->Items[] = $item;
echo $catalog->toXml(); //