All tutorials

Installing the what3words Shopware plugin

easy

The Shopware 6 plugin adds a what3words address field to your store’s checkout page allowing your customers to easily enter and validate a what3words address when placing an order.

Shopware 6 Minimum Supported Version: 6.0 or higher

Note:

This extension has been developed by Benny Poensgen, if you encounter any problems or have any feedback at all, kindly submit any feedback to our Support team at support@what3words.com.

1Get an API Key
Signup to create key
2Requirements

To use this extension, you will need to have:

  • a Shopware 6 CE (minimum) self-hosted installation. To get started on this please follow these instructions.
3Installation

The Shopware 6 plugin can be installed in 2 different ways:

1. by downloading the latest plugin zip file from this GitHub page and uploading this file to your custom/plugins folder of your shopware project;

2. by installing it with composer run composer require vanwittlaer/what3words --no-scripts.

Then go to Extensions > My extensions

Click on the Install link to install the extension on your storefront.

4Enable plugin

The next step is to activate the extension by clicking on the toggle next to the extension. It will display the extension at the top.

Once activated, you will be able to configure the app by adding the what3words API key to your Sales Channels.

Click on the ... (3 dots) on the right side of the extension and then click on Configure.

5Add your API Key

You will be able to access the settings page of the extension where you can enter your what3words API key.

Then click the Save button.

If you don’t already have a what3words API key, please go back up a few steps to Get your API key.

6Check if the field is appearing

A new field should now appear on your checkout under the shipping address. When a what3words address is captured in this field, it will be saved alongside your order details and will be visible on order and customer billing and shipping addresses as an additional custom field.

5How to display the field on your order confirmation emails

You can display the what3words address that your customers have submitted with their orders within the order confirmation email or invoice template by going to Settings > Extensions > Email template, for the billing and shipping address, it would be:

{{ delivery.shippingOrderAddress.customFields.what3words }}

{{ billingAddress.customFields.what3words }}

6How to obtain the what3words fields using Stores API

In Shopware 6, the what3words address attributes are stored as customFields in the Orders endpoint of the Shopware Orders REST API.

Please follow this guide to be able to access the Shopware 6 API.

The API request to make to the Shopware Orders REST API should be:
GET {{shop_url}}/api/orders/{{order_id}}, e.g. GET https://shopware.ddev.site/api/orders/10004

The API response should be:

{ 
  "id": "10004",
  ...
  "customFields": {
      "what3words": "///filled.count.soap",
   }
  ...
}
Copied
E-CommerceAdd a 3 word address input fieldShopware 6

Related tutorials