---
# System prepended metadata

title: Shopgate Fulfillment Integration for Magento2

---

# Shopgate Fulfillment Integration for Magento2

## Installation

### Magento Setup

Upload the file `Shopgate_Fulfillment_v1.1.0.tgz` to the server and unpack the content of the zip file to folder `[mage root folder]/app/code/`.

In the next step you need to enable and install the plugin with the following commands:

```sh
cd [mage root folder]
bin/magento module:enable Shopgate_Fulfillment
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:clean
```

### Theme setup

#### Multi cart item reservation

For the multi cart item reservation the Fulfillment plugin needs to add another column into the cart view. Therefore you need to adapt the checkout module of Magento. Depending on the way Magento is installed its located in `vendor/magento/module-checkout` or `app/code/Magento/Checkout`.

Adapt the files as follows:

1. Change the file `form.phtml` at the location:
    -`vendor/magento/module-checkout/view/frontend/templates/cart/form.phtml`
    or
    -`app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml`

    Find the line ~35 after first `<th>` at position of 2nd `th` of the table, without `th` element (will be added by block itself)

    ```php
    <th class="col item" scope="col"><span><?= $block->escapeHtml(__('Item')) ?></span></th>
    <?= $this->getLayout()->getBlock('checkout.cart.items.thead')->toHtml() ?>
    <th class="col price" scope="col"><span><?= $block->escapeHtml(__('Price')) ?></span></th>
    ```

2. Change the file `default.phtml` at the location:
    -`vendor/magento/module-checkout/view/frontend/templates/cart/item/default.phtml`
    or
    -`app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml`

    Find the line ~71 and add the following code after the first `<td>` and before the 2nd `td` of the table. The `td` is provided by the block and does not need to be added

    ```php
    </td>
    
    <?= $this->getLayout()->getBlock('checkout.cart.items.item')->setQuoteItem($_item)->toHtml() ?>
    
    <?php if ($canApplyMsrp) :?>
        <td class="col msrp" data-th="<?= $block->escapeHtml(__('Price')) ?>">
    ```

    Find the line ~125 and change the colspan of actions `td` from 4 to 5 (because we injected 1 reserve `td`)

    ```html
        <tr class="item-actions">
              <td colspan="5">
              ......
    ```

3. After modifying the files clean Mage caches
    ```sh
    bin/magento cache:clean
    ```
    
    
## Setup

After the Plugin is installed a new menu point should appear in the store settings (Stores->Settings->Configuration->Shopgate Connect)

In the menu point `Deliver (Fulfillment)` you need the enter the credentials which you got via Mail.