Magento 2 / Adobe Commerce | Create OCI and cXML PunchOut Catalogues | PunchCommerce                            ![](//analytics.punchcommerce.de/matomo.php?idsite=1&rec=1)

Magento 2 / Adobe Commerce
==========================

Our free extension for Magento 2 enables you to use our OCI or cXML gateway PunchOut in conjunction with your Magento online shop. In this scenario, we handle communication with your customers or their systems (Ariba, Oracle or SAP) and, following successful authentication, redirect the customer to your online shop.

### Setting up the Gateway PunchOut

Download the latest version of the extension and install it in your Magento 2 online shop. You can find the latest version of our module [here](/de/downloads)

#### Setup in PunchCommerce

1. Create a new customer and select OCI or cXML Gateway as the mode
2. Complete the customer configuration in PunchCommerce by setting up the entry URL (to your online shop), including the placeholders {{uID}} and {{sID}}, and the customer ID

***Note** Configure the entry URL as the URL of your online shop according to the following format:*

https://../punchcommerce/authenticate/index/?sId={{sID}}&amp;uId={{uID}}

#### Installation in Magento 2

![](https://www.punchcommerce.de/storage/media/support-articles/magento-2/plugin-configuration.png)

The module can be installed in two different ways:

- **Option 1:** Place the module in a Composer path repository and run the following command: `composer require ecentral/module-punchcommerce`
- **Option 2:** Copy the module files to the directory `./app/code/Ecentral/PunchCommerce`

In the next step, regardless of which of the two options you have chosen, you must run the following commands:

```
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
```

#### Configuration in Magento 2

![](https://www.punchcommerce.de/storage/media/support-articles/magento-2/customer-configuration.png)

1. Create a Magento customer and set a PunchCommerce ID in the “PunchCommerce Customer ID” attribute.
2. Enable the module under “Stores &gt; Configuration &gt; PunchCommerce &gt; PunchCommerce Settings”
3. Specify whether the user should be asked if the shopping basket should be cleared before refreshing the session.
4. To run the punchout in an iFrame, you must set the “Frame Ancestor” configuration field to the domain that provides the iFrame. You can specify multiple domains, separated by spaces.
5. Customise the product mapping. The relevant documentation can also be found below the configuration field in the Magento backend.
6. **Optional** Set the hook URL to point to your PunchCommerce server instance. You only need to adjust this value if you are a PunchCommerce Enterprise user.

**Example configuration for field mapping in Magento**

```
{
  "field1": {
    "type":
    "target":
    "value":
  },
  "field2": {
    ...
  },
  ...
}
// Must contain definitions for the following fields: brand, price, tax_rate, purchase_unit, packaging_unit, shipping_time
```

### Adjustments to your web server

As your online shop is usually displayed as an iFrame within your customer’s e-procurement application during a PunchOut, you will need to adjust your web server configuration.

**Apache**

You must remove or comment out line 289 in the pub/.htaccess file:

Header set X-Frame-Options SAMEORIGIN

This line prevents the website from being loaded in iFrames.

**Note:** Ensure that this change does not create any security risks. It may be necessary to strengthen other security measures to maintain protection against clickjacking attacks.

**Nginx**

The following line could also prevent the website from being loaded in iFrames:

add\_header X-Frame-Options "SAMEORIGIN";

**Note:** As this configuration has not yet been tested, it is advisable to carry out tests to ensure that no website functionality is compromised. It may be necessary to adjust the configuration or implement alternative security measures.

 [ PunchCommerce® ist ein Produkt der ![Netzdirektion GmbH](https://www.punchcommerce.de/static/netzdirektion-logo.png "PunchCommerce® ist ein Produkt der netzdirektion | Gesellschaft für digitale Wertarbeit mbH") ](https://netzdirektion.de)

 [Give feedback now - your opinion helps us to become even better!](https://easy-feedback.de/umfrage/1883200/5FuM95 "Your opinion helps us to become even better!")
