PHPackages                             alaa/magento2-xml-feed-model - 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. alaa/magento2-xml-feed-model

AbandonedArchivedMagento2-module

alaa/magento2-xml-feed-model
============================

2.0.0(7y ago)22MITPHPPHP ~7.0.0|~7.1.0

Since Mar 13Pushed 7y ago2 watchersCompare

[ Source](https://github.com/alaa-almaliki/magento2-xml-feed-model)[ Packagist](https://packagist.org/packages/alaa/magento2-xml-feed-model)[ RSS](/packages/alaa-magento2-xml-feed-model/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Magento2 Xml Feed Model
=======================

[](#magento2-xml-feed-model)

Installation
------------

[](#installation)

```
composer install alaa/magento2-xml-feed-model
php -f bin/magento module:enable Alaa_XmlFeedModel
php -f bin/magento setup:upgrade

```

How it works
------------

[](#how-it-works)

### Setup

[](#setup)

First, a configuration file needs to be created.

```

            Xml Feed Model Example

            Order Feed Fields
            xml_feed_model_example
            {YOUR ACL RESOURCE}

                Mapped Fields

                    Order Fields
                    Magento\Config\Model\Config\Backend\Serialized\ArraySerialized
                    Alaa\XmlFeedModel\Block\Adminhtml\System\Config\Form\Field\FieldArray\SubjectFieldArray

```

A predefined class `Alaa\XmlFeedModel\Block\Adminhtml\System\Config\Form\Field\FieldArray\SubjectFieldArray` is used for mapping array keys

Now you should be able to ad as many mapping as required.

### Usage

[](#usage)

Resolving the representation of the xml

```
$order = $this->orderRepository->get($orderId);

$orderSubject = new Subject('order', $order->getData()); // corresponds to 'order' => 'mapper/mapped_fields/order', in the configuration file
$orderSubject->addAttribute($orderSubject->getNodeName(), 'account', '111');

$customerSubject = new Subject('customer');
$customerSubject->setData($order->getData());
$customerSubject->addAttribute($customerSubject->getNodeName(), 'id', (string) $order->getCustomerId());

$customerAddress = new Subject('customer_address');
$customerAddress->setData($order->getBillingAddress()->getData());

$itemsSubject = new Subject('items');
foreach ($order->getItems() as $item) {
    if ($item->getParentItem()) {
        continue;
    }
    $itemsSubject->addChild(new Subject('item', $item->getData()));
}

$orderSubject->addChild($customerSubject);
$customerSubject->addChild($customerAddress);
$orderSubject->addChild($itemsSubject);

```

Writing the subject to xml

```
// Reading the configuration file
$file = $this->moduleDirReader->getModuleDir('etc', 'YOUR_MODULE'). '/order_mapped_fields.php';

// do the mappings
/** Alaa\XmlFeedModel\Model\MappedSubjectBuilder $this->mappedSubjectBuilder */
$mappedSubject = $this->mappedSubjectBuilder->build($file, $orderSubject);

// convert the data to xml
/** @var \Alaa\XmlFeedModel\Model\XmlConverter $this->xmlConverter */
$xml = $this->xmlConverter->convert($mappedSubject);

// write the xml to a file
$xml->asXML('var/order/subject.xml');

```

Contribution
------------

[](#contribution)

Feel free to raise issues and contribute.

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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 ~284 days

Total

2

Last Release

2695d ago

Major Versions

1.0.0 → 2.0.02018-12-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c696bf597ea0fdd1fd166ce20d7c15c873f16547e874bd67ecb70c4abfdb2cb?d=identicon)[alaa-almaliki](/maintainers/alaa-almaliki)

---

Top Contributors

[![alaa-almaliki](https://avatars.githubusercontent.com/u/7830984?v=4)](https://github.com/alaa-almaliki "alaa-almaliki (5 commits)")

---

Tags

XML feedxml dataMagento Feed

### Embed Badge

![Health badge](/badges/alaa-magento2-xml-feed-model/health.svg)

```
[![Health](https://phpackages.com/badges/alaa-magento2-xml-feed-model/health.svg)](https://phpackages.com/packages/alaa-magento2-xml-feed-model)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.2M1](/packages/fastly-magento2)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[swissup/module-search-mysql-legacy

Legacy mysql search for magento 2.4

10483.0k](/packages/swissup-module-search-mysql-legacy)[fredden/magento2-module-javascript-error-reporting

A Magento 2 module which captures JavaScript errors for later review by website administrators

3138.1k](/packages/fredden-magento2-module-javascript-error-reporting)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

126.8k](/packages/mage-os-module-inventory-reservations-grid)

PHPackages © 2026

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