PHPackages                             hounddd/wn-mallimportexport-plugin - 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. hounddd/wn-mallimportexport-plugin

ActiveWinter-plugin[Utility &amp; Helpers](/categories/utility)

hounddd/wn-mallimportexport-plugin
==================================

Import or export data to OFFLINE.mall.

v2.0.0(3y ago)01053MITPHP

Since Sep 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Hounddd/wn-mallimportexport-plugin)[ Packagist](https://packagist.org/packages/hounddd/wn-mallimportexport-plugin)[ Docs](https://github.com/Hounddd/wn-mallimportexport-plugin)[ RSS](/packages/hounddd-wn-mallimportexport-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

Mall Import/Export
==================

[](#mall-importexport)

This plugin offers the possibility to import or export data into the [OFFLINE.Mall](https://github.com/OFFLINE-GmbH/oc-mall-plugin) plugin.

---

⚠ **Please note that it does NOT allow you to add products but to update existing products**.

---

What you can import or export
-----------------------------

[](#what-you-can-import-or-export)

- publication status
- stocks
- authorisation for sales out of stock
- weight
- prices, additional prices and group prices, in all currencies.
- [and whatever you decide](#mallimportexportownfields)

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

[](#how-it-works)

The plugin uses the CSV file [import/export features of WinterCMS](https://wintercms.com/docs/backend/import-export).

With default options, exporting data will give you a CSV file named `Products_export_2021-09-23.csv`.

### Columns naming

[](#columns-naming)

The plugin use currencies symbols to append same to the column name.

- The prices columns will be named "Price $", "Price €", ...
- The customers prices columns will be named "Price *pricename* $", "Price *pricename* €", ...
    ex for a "Vip" customer price : "Price vip $", "Price vip €", ...
- The defined price categories use their own names "*Price category name* $", "*Price category name* €", ...
    ex for a "Old price" price category : "Old price $", "Old price €", ...

You can define your own filename, date or column's names from [config](#mallimportexportconfig).

### Add your own columns

[](#add-your-own-columns)

You can listen for `hounddd.mallimportexport.config.update` event to add your own column definition.

#### Example to add the product's name to export fields, at the second position

[](#example-to-add-the-products-name-to-export-fields-at-the-second-position)

```
/**
 * Extend products controller export columns definition
 */
Event::listen('hounddd.mallimportexport.config.update', function ($controller, $config) {
    $exportColumns = $config->export['list']->columns;
    $position = 1;

    $config->export['list']->columns =
        array_slice($exportColumns, 0, $position, true) +
        [
            'name' => [
                'label' => 'offline.mall::lang.product.name'
            ]
        ] +
        array_slice($exportColumns, $position, count($exportColumns) - 1, true);
});
```

### Integration

[](#integration)

If the version of your OFFLINE.Mall plugin includes event hooks for toolbars (&gt;= 1.14.4), you will find the import and export buttons at the top of the product list, otherwise an entry will be added to the side menu of the plugin.
Buttons are available according to the user rights.

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

[](#installation)

*Let assume you're in the root of your wintercms installation*

### Using composer

[](#using-composer)

Just run this command

```
composer require hounddd/wn-mallimportexport
```

### Cloning repo

[](#cloning-repo)

Clone this repo into your winter plugins folder.

```
cd plugins
mkdir hounddd && cd hounddd
git clone https://github.com/Hounddd/wn-mallimportexport mallimportexport
```

Configuring
-------------------------------------------------------------

[](#configuring)

### Import/export behaviors

[](#importexport-behaviors)

You can configure plugin behaviors with a file `\config\hounddd\mallimportexport\config.php`

```
