Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions docs/magento2/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Configuration

After installation, open the **Magento 2** section from the UnoPim sidebar to begin configuration.

## Credentials

The connector supports two authentication methods. Choose the one that fits your Magento setup.

### Option A — Token-Based Credentials (Recommended)

**Step 1 — Create an integration in Magento**

1. In your Magento admin, go to **System → Integrations → Add New Integration**.
2. Enter a **Name** and **Password**, then go to the **API** tab.
3. Set resource access to **All** (or select specific resources listed below), then click **Save**.
4. On the Integrations page, find your integration and click **Activate → Allow**.
5. Copy the generated **Access Token**.

Required API resources:

- Catalog, Inventory, Products, Categories
- Stores, Settings, Currency, Attributes, Other Settings

> **Note:** If your Magento version is 2.4.4 or above, run this command in your Magento root before proceeding:
> ```bash
> bin/magento config:set oauth/consumer/enable_integration_as_bearer 1
> ```

**Step 2 — Add credentials in UnoPim**

1. Go to **Magento 2 → Credentials → Create Token-Based Credentials**.
2. Enter your **Magento Shop URL** and **Access Token**.
3. Click **Save**.

---

### Option B — Login-Based Credentials

> **Note:** Login-based credentials will not work if Magento 2FA is enabled. Disable 2FA or use Token-Based instead.

1. Go to **Magento 2 → Credentials → Create Login-Based Credentials**.
2. Enter your **Magento Shop URL**, **Admin Username**, and **Admin Password**.
3. Click **Save**.

### Store Views

If your Magento store uses multiple store views, map each one to the correct UnoPim locale, channel, and currency after saving your credentials. Products will export to Magento using the channel and currency set for each store view.

> **Note:** When exporting attribute families, Magento creates new attribute sets based on an existing one. In your credential settings, select the **base attribute set** you want UnoPim families to be created from (default is "Default").


## Attribute Mapping

Go to **Magento 2 → Export Mappings**. There are four mapping types.

### Standard Attribute Mapping

Map UnoPim attributes to Magento's built-in product fields. The following fields are available by default:

| Magento Field | Description |
|----------------------------|-----------------------------------------|
| `status` | Enable/disable product |
| `sku` | Product SKU |
| `name` | Product name |
| `price` | Product price |
| `description` | Full product description |
| `short_description` | Short description |
| `weight` | Product weight |
| `product_has_weight` | Whether product has weight |
| `tax_class_id` | Tax class |
| `visibility` | Storefront visibility |
| `qty` | Stock quantity |
| `is_in_stock` | Stock status |
| `url_key` | Product URL |
| `meta_title` | SEO page title |
| `meta_keyword` | SEO keywords |
| `meta_description` | SEO meta description |
| `cost` | Cost of goods |
| `special_price` | Sale price |
| `special_from_date` | Sale start date |
| `special_to_date` | Sale end date |
| `news_from_date` | "New" badge start date |
| `news_to_date` | "New" badge end date |
| `country_of_manufacture` | Country of manufacture |
| `product_websites` | Magento websites to assign product to |
| `page_layout` | Product page layout |
| `options_container` | Display product options setting |
| `custom_design_from` | Schedule update start |
| `custom_design_to` | Schedule update end |
| `custom_design` | Custom theme |
| `custom_layout` | Custom layout |

### Additional Field Mapping (Custom Attributes)

Use this section to map any custom Magento attributes that are not in the standard list above. Enter the Magento attribute code and select the corresponding UnoPim attribute.

This is also where you map variant-specific attributes like **Color** and **Size** for configurable products.

### Image Mapping

| Field | Required | Description |
|---|---|---|
| **Image Attributes** | Required | Select UnoPim image attributes — these become the Magento product gallery images |
| **Alt Text Attribute** | Optional | Select the attribute whose value will be used as the image alt text |
| **Image Role** | Optional | Map images to Magento roles: base, small, thumbnail, or swatch |
| **Hide from Product Page** | Optional | Toggle whether the image is hidden on the product page |

### Video Mapping

| Field | Required | Description |
|---|---|---|
| **Video Attribute** | Required | Map the UnoPim attribute that holds the video URL |
| **Preview Image** | Optional | Map an image to show as the video thumbnail |
| **Title** | Required | Map the attribute used as the video title |
| **Description** | Optional | Map an attribute for the video description |
| **Hide from Product Page** | Optional | Toggle visibility on the product page |

### Category Mapping

Map UnoPim category fields to Magento category fields. If no mapping is set, the connector exports categories with name, URL key, and enabled status only. Add mappings here to export additional category data.
62 changes: 60 additions & 2 deletions docs/magento2/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# Magento 2 Extension
# Overview

The UnoPim Magento 2 Connector connects your UnoPim PIM system with one or more Magento 2 (Adobe Commerce) stores.

It supports **two-way data synchronization**:
- Export data from UnoPim → Magento
- Import data from Magento → UnoPim

This eliminates manual data entry and keeps both systems in sync.

## How it Works

### Export (UnoPim → Magento)
1. Install the ProductImportQueue plugin on Magento.
2. Install the connector on UnoPim.
3. Add Magento credentials in UnoPim.
4. Configure mappings (attributes, categories, media, etc.).
5. Create and run export jobs.

### Import (Magento → UnoPim)
1. Configure Magento credentials in UnoPim.
2. Go to **Data Transfer → Imports**.
3. Create an import profile.
4. Select import type and run the job.

## Key Features

### General
- Two authentication methods (API token or admin login)
- Multi-store support
- Bi-directional sync (Import + Export)

### Export Features
- Category export with hierarchy
- Attribute & attribute family export
- Simple & configurable product export
- SEO data export (meta title, keywords, description)
- Media export (images & videos)
- Advanced filtering (SKU, status, family, type)
- Custom attribute mapping
- Product re-sync support

### Import Features
- Category import with hierarchy
- Attribute and attribute options import
- Attribute set and group import
- Product import (simple & configurable)
- Product association import (related, upsell, cross-sell)
- Store view and configuration import
- Automatic entity mapping

## Requirements

| Requirement | Detail |
|------------|--------|
| UnoPim | <= 2.0.0 |
| PHP | 8.2+ |
| Magento 2 | 2.3.x to latest |
| Node & Yarn | Required |
| Magento Cron | Must be running |

Placeholder landing page. Real docs are pulled from [`unopim/unopim-magento2`](https://github.com/unopim/unopim-magento2) at build time.
107 changes: 107 additions & 0 deletions docs/magento2/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Installation

There are two parts to the installation: first set up the **Magento 2 plugin**, then install the **UnoPim connector**.

## Part 1 — Magento 2 Plugin (ProductImportQueue)

This plugin must be installed on your Magento store first. It handles incoming product data from UnoPim.

### 1. Copy the plugin files

Extract the plugin ZIP. Move the `app` folder (found inside the `src` folder) into your Magento root directory.

### 2. Enable the module

```bash
php bin/magento module:enable Webkul_ProductImportQueue
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
```

### 3. Flush cache and reindex

```bash
php bin/magento cache:clean
php bin/magento indexer:reindex
```
## Part 2 — UnoPim Connector

### 1. Place the package

Unzip the connector and merge the `packages` folder into your UnoPim project root.

### 2. Register the service provider

Open `bootstrap/providers.php` and add:

```php
use Webkul\Magento2\Providers\Magento2ServiceProvider;

return [
// ...existing providers...
Magento2ServiceProvider::class,
];
```

### 3. Update Composer autoload

In `composer.json`, add under `autoload.psr-4`:

```json
"Webkul\\Magento2\\": "packages/Webkul/Magento2/src"
```

### 4. Run the installer

```bash
composer dump-autoload
php artisan magento-package:install
php artisan optimize:clear
```

### 5. Verify

A **Magento 2 icon** should now appear in the left sidebar of your UnoPim dashboard.


## Optional — Register Test Cases

Only needed if you plan to run the connector's test suite.

**a) Register the test directory** in `composer.json` under `autoload-dev.psr-4`:

```json
"Webkul\\Magento2\\Tests\\": "packages/Webkul/Magento2/tests"
```

**b) Add the test case** to `tests/Pest.php`:

```php
uses(Webkul\Magento2\Tests\Magento2TestCase::class)
->in('../packages/Webkul/Magento2/tests');
```

**c) Register the test suite** in `phpunit.xml`:

```xml
<testsuite name="Magento2 Feature Tests">
<directory suffix="Test.php">./packages/Webkul/Magento2/tests/Feature</directory>
</testsuite>
```

**d) Create a testing environment file:**

```bash
cp .env .env.testing
```

Open `.env.testing` and update `APP_URL` to your UnoPim base URL.

**e) Run the tests:**

```bash
composer dump-autoload
php artisan optimize:clear
./vendor/bin/pest ./packages/Webkul/Magento2/tests/Feature
```
5 changes: 4 additions & 1 deletion docs/magento2/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
{
"text": "Magento 2",
"items": [
{ "text": "Overview", "link": "/magento2/" }
{ "text": "Overview", "link": "/magento2/" },
{ "text": "Installation", "link": "/magento2/installation" },
{ "text": "Configuration", "link": "/magento2/configuration" },
{ "text": "Usage", "link": "/magento2/usage" }
]
}
]
Loading