Open Navigation

Magento 2

Magento is an e-commerce platform built on open source technology which provides online merchants with a flexible shopping cart system, as well as control over the look, content and functionality of their online store.

Overview

The Tray.io Magento 2 connector allows you to manage your store/stores in Magento 2.

Authentication

In order to setup a new authentication, ensure you have the Magento store host (http prefix omitted, EG 'www.trayio-magentostore.com') and the API key (this can be obtained from your independent Magento store admin panel).

Once you have these, you can click on the New Authentication button:

magento-2-auth

Basic Operations List

Operations included in this example:

  • Search products
  • Get store configs
  • Get product sku

A full list of operations can be obtained at the end of this Readme.

Example

In the following example we create a workflow that searches through the store's products and filter's results by simple products. We then get a product from the list based on the product SKU and Store ID.

To begin with, create a workflow with a Manual Trigger, then add a step from the Magento 2 connector with the operation set to Search products.

magento-2-search-products

We are going to filter the search by simple products (not setting any filter will return all products available for the store). Select the Add filter element button to create a new filter object.

magento-2-filter

To filter by a simple product type we want to set the condition to Equals. The Filter field value will be set to type_id and the Filter value value will be simple.

magento-2-filter-object;

Next, we add a step from the Magento 2 connector with the operation set to Get store configs, to retrieve the Store ID of our current store.

magento-2-get-store-configs;

Next, we add a step from the Magento 2 connector with the operation set to Get product sku, to retrieve information about the simple product. Set the Store ID to the ID of one of the stores (returned by our Get store configs operation), by using a JsonPath as shown in the example:

magento-2-get-store-configs-jsonpath

We then need to the same for the SKU ID field, but setting a JsonPath to the Search products operation as shown in the example:

magento-2-search-products-jsonpath

We will now be able to see information about an existing simple product in the Debug panel, as shown here in the example:

magento-2-get-product-log

Was this article helpful?
Yes
No