Using PCC Magento 2 Connector

Prev Next

Magento is an open-source e-commerce platform which provides users with an option to manage the overall look, content and functionality of their online stores.

The PCC Magento 2 connector enables you to connect PCC with your Magento store and transfer data between these applications seamlessly.

Click the View Details icon to view the details and features of the connector and the following is displayed.

A screenshot of a computer  Description automatically generated

Figure 206: Magento 2 connector description

Configuring the Connector

You need to configure the connector and add the tokens and keys for setting up the stores. Once the stores are configured, the attributes present in the Magento store can be mapped with the attributes in the PCC catalog as explained here.

The first step is to generate the keys and the token and use them to configure a Magento store. A detailed description about the same is explained in the Appendix section A.6 Generating Token and Keys to Configure Magento Store.  

To add a new Magento store configuration:

  1. Go to the PCC Platform Connectors screen and click the Set Configurations  icon available for Magento 2 as shown below.

Graphical user interface, application  Description automatically generated

OR

Click Configure Magento 2 Connector as shown in Figure 206: Magento 2 connector description.

The following screen appears.

Graphical user interface, text, application, website  Description automatically generated

Figure 207: PCC Magento 2 Connector screen

By default, the Setup Credentials tab is selected.

  1. Click Add New Store Configuration and the following dialog box appears to add the store details.

Graphical user interface, text, application  Description automatically generated

  1. Type the Store Name, that is, the name of the Magento store which contains the product attributes to be mapped. For example, AMG store.

  2. Type the Store URL, that is, the URL of the Magento store (in this case AMG store) to be configured. For example, http://11.20.111.100:10000/

    Copy-paste the integration keys and tokens generated as shown in Figure 371: integration tokens in the respective fields as explained in the Appendix section Generating Token and Keys to Configure Magento Store.  

    Type the Maximum Records Per File, that is, the number of SKU records to be exported per file. For example, 20. This means that if there are 40 records of SKUs in a file, a maximum of 20 SKUs will be exported whenever the details are exported.

  3. Type the Default Attribute Set Code, that is the attribute set code for the Magento store being configured. A Magento store has attribute sets. Depending on the product and the attributes of the Magento store, the relevant attribute set code should be provided. For example, Set1. However, if the meta attribute name in the taxonomy node in PCC catalog is set as ATTRIBUTE_SET, the value assigned to this meta attribute will replace the default attribute set code for the SKUs in that node. Refer section 0 Working with Taxonomy Metadata Master for more details on meta attributes. If this meta attribute ('ATTRIBUTE_SET') is not present for a node, the default attribute set code mentioned in the configuration is used.

NOTE

The attribute set code mentioned while configuring the store should be present in Magento. Also, the value of the meta attribute ('ATTRIBUTE_SET') used in PCC catalogs should be added as an attribute set in Magento. If not present, the exported data with the attribute mapping details cannot be imported in Magento as it will fail the import validation process. Only attributes belonging to the attribute set code listed in the Magento store are considered during import in Magento.

The icon next to each field provides details on what data must be added.

NOTE

All fields are mandatory. The details entered in the last 2 fields will be considered while exporting the data.

  1. Once all the values are entered, click the Check connection with entered values icon next to the Store Name to check whether the access tokens and keys entered as well as the store URL is valid. If the details are not valid, an error is displayed as follows.

A screenshot of a cell phone  Description automatically generated

Make the necessary changes and ensure that the connection is valid.

  1. Click Add Store and the store is added successfully and is visible in the list as shown below.

A screenshot of a computer  Description automatically generated

The following table lists the various fields along with its description that are visible on the Setup Credentials screen.

Fields

Description

Actions

Displays the icons of the various actions that can be performed:

  •  - To edit the store configuration details

  •   - To delete the store configuration details

  •   - To setup attribute mapping details  

Store Name

Displays the name of the store added while configuring a store

Created By

Displays the name of the user who configured the store

Created On

Displays the date when the store was configured

Updated By

Displays the name of the user who made any changes to the store

Updated On

Displays the date when any modifications / changes were made to the store

You can sort / filter the data in the columns in ascending or descending order as needed. By default, the latest store created is displayed first based on the date when it was created in descending order.

Editing the Store Configuration

Sometimes, the connectors might have some updates (a new feature / version update) which might result in changes in the keys / tokens of the stores configured. You can edit the details configured in case of any such changes.

To edit the store configured:

  1. In the Actions column, click the Edit Store Configuration icon next to the store to be edited. The following screen appears.

Graphical user interface, text, application, email  Description automatically generated

  1. Make the changes as needed and click Edit Store.  The details are updated successfully.

Deleting the Store Configuration

You can also delete the store configured if the store is no longer required for mapping the attribute details.

To delete the store configured:

  1. In the Actions column, click the Delete Store Configuration icon next to the store to be deleted. The following screen appears.

Graphical user interface, application  Description automatically generated

Details about the store to be deleted are displayed.

  1. Click Delete Store and the store is deleted successfully.

Attribute Mapping between Magento and PCC

Customers using the Magento platform will have stores configured depending on their vendors. These stores will have product attributes based on the requirements of the vendor. In PCC, the customer will curate their data and then the data can be pushed to Magento. However, it is possible that the attributes used in the Magento store will be different from the ones used in PCC but have similar properties. For example, let us say a customer has a Magento store named Apparels dealing with clothing accessories. For a product such as a shirt, it contains attributes such as Color and Material. In PCC, the customer has a catalog curated for its clothing accessories and here the attributes present for the same product shirt are Fabric Color and Cloth Material. Now, both attributes have the same properties but the naming convention used is different. Since, the Magento store is configured as per the vendor’s requirement, the product attributes in the Magento store should be mapped to the respective attribute in PCC.

Once the store is configured, you can map the product attributes between Magento and PCC by selecting the relevant store and catalog respectively.  

Once the attributes are mapped, the data can be exported by the customers and shared with the vendors.

To map the attributes between the Magento store and PCC:

  1. As shown in Figure 207: PCC Magento 2 Connector screen, click the Setup Attribute Mapping tab and the following is displayed.

Graphical user interface, application, Teams  Description automatically generated

Select the Magento Store configured containing attributes to be mapped from the drop-down list.

OR

  1. Click the Setup Credentials tab and in the Actions column, click the Setup Attribute Mappings for this Storeicon next to the store for attribute mapping. In this case, since the icon is present next to the store, the attributes in the store will be populated automatically and you do not need to select the store again.

A picture containing graphical user interface  Description automatically generated

The fields, that is, the attributes present in the selected Magento store and the field code assigned to each attribute will be displayed.

Graphical user interface, application  Description automatically generated

Also, the total number of attributes present in the store is displayed. In this case, the count is 107

NOTE

The field code is a unique code assigned to each attribute listed in the store.

  1. Select the PCC Catalog from the drop-down list which has attributes to be mapped. The following screen appears.

Graphical user interface, application  Description automatically generated

The field names in the PCC catalog are blank. Based on the attributes displayed from the Magento store, you need to select an attribute from the catalog in parallel to the Magento store attribute which should be mapped.

For example, let us consider that the customer is mapping attributes for a product Sunglasses. The Magento store uses attributes Brand Name and Color whereas in the PCC catalog, the attribute having the same properties is Brand and Lens Color. So, the Magento store attributes now need to be mapped with the attributes present in the selected PCC catalog.

In the select an attribute field under PCC catalog, go to the field adjacent to Brand Name field in the Magento store and start typing the name of the attribute to mapped as shown below.

Graphical user interface, text, application, email  Description automatically generated

A list of all available attributes in the catalog based on the keyword entered is displayed.

NOTE

You can also search the attributes in both the Magento store as well as the PCC catalog

Graphical user interface, application  Description automatically generated

Select the appropriate attribute to be mapped. For example, in this case, let us select Brand from the list displayed as shown below.

Graphical user interface, application  Description automatically generated

Similarly, you can map other attributes as well by selecting the relevant attribute from the catalog next to the field displayed for the Magento store.

Graphical user interface, application  Description automatically generated

  1. Click Save Changes and the attributes are mapped successfully.

The attributes which are mapped between Magento and PCC will have an icon next to it as shown below.

Graphical user interface, text, application  Description automatically generated

Once the mapping is done, you can export the attributes mapped using the export option.

NOTE

If you need to map a different attribute from the PCC catalog to an already mapped attribute, you just need to select the relevant attribute and save the changes again and the newly selected attribute will be mapped.

Syncing SKU Data from PCC to Magento Store

The process to export any data and view it remains the same as explained in chapter 22 Export Catalog.

There are 2 options available for exporting data in Magento format:

Let us understand how to export the data using both the options in the following sections.

Exporting the Data into Magento CSV Format

This option generates the data into Magento CSV format and then you need to import the data into the Magento portal manually. To export the data in Magento CSV format, click the Export Catalog icon for file type Magento 2 and the following is displayed.

Graphical user interface, application  Description automatically generated

Select the Magento Store Name from the drop-down list which contains the mapped attributes (as explained here).

Enter the necessary details and then click Export and the export process is initiated. Refer section Viewing the Export File for more information on how to view and download the export file.

Once the data is exported successfully, you can download the data in CSV format. Following is a sample file.

A screenshot of a cell phone  Description automatically generated

The details of all SKUs present in the nodes selected to be exported are displayed.

NOTE

Here, the SKUs displayed will depend on the Maximum Records Per File value entered while configuring the store.

The following details are displayed:

  • SKU– SKU IDs of the products in the catalog

  • product_type – the type assigned to the product. It is set as simple.

  • categories – the complete taxonomy path of the product in the catalog. The delimiter used for the taxonomy path is /.

  • attribute_set_code – the attribute set code (Default) mentioned while configuring the store is displayed. However, in the case of the first 3 SKUs, the meta attribute name in the taxonomy node is set as ATTRIBUTE_SET with value Types of analog and digital watches. Hence, it will replace the default attribute set code.

  • name - the SKU title of the SKUs in the catalog

  • <field code> - Instead of attribute name, field code will be displayed. For example, brand_name is the field code used for the attribute Brand in Magento store. The field code of the Magento attribute mapped with the attributes in the PCC catalog is displayed. Also, the attributes mapped should be present in the nodes selected for export else it will not be displayed in the exported file.

If an attribute mapped has multiple values as shown in the following figure, each attribute value will be separated using a semicolon when the file is exported using Magento sync as well as CSV export.

A screenshot of a computer  Description automatically generated

NOTE

The multiple values for any attribute should be added in separate rows. If values are added in the same row, it will always be considered as a single value.

Here, the attribute Frame Material has 2 values metal and Plastic. When the export is generated using Magento CSV format, the values will be displayed as follows in the exported file.

A screenshot of a computer  Description automatically generated

As shown above, the multiple attribute values are separated using a semicolon. Similarly, in case of data exported directly to Magento as explained here, the multiple values will be separated by a semicolon in the Magento portal as well.

NOTE

The attribute set present in the Magento store contains multiple attributes. Some of these attributes are marked as required based on the vendor’s needs. Depending on the attribute set code configured for the Magento store, all the required attributes in that set should be present in the exported file. If those attributes are not present in the exported file, you cannot import the mapped attributes in the Magento store as the import process will fail.

However, if an error occurs during the export process, you can make the necessary changes and generate an export again.

Once the mapped attributes are exported into a file, it needs to be imported to the Magento store so that the customers can share it with their vendors.  A detailed description about the same is explained in the Appendix section Importing Mapped Attributes to Magento.

Exporting the Data Directly to Magento using API

This option will directly export / sync the selected catalog data to Magento. All the mapped attributes present in the selected categories / entire catalog, depending on the option selected during export will be synced to Magento directly.

  1. To sync the data directly to Magento using API, click the Export Catalog icon for file type Magento 2 Sync and the following is displayed.  

Graphical user interface, text, application  Description automatically generated

  1. Select the Magento Store Name from the drop-down list which contains the mapped attributes (as explained here).

  2. Click Export and the export process is initiated. Refer section Viewing the Export File for more information on how to view the status of the export. Once the export process is successfully completed, you can go to the Magento store and view details in the Products page.

  3. However, if an error occurs during the export process, an error file will be generated with details of the errors. The Export page will display the following information in case of an error.

Graphical user interface, text, application, email, Teams  Description automatically generated

You can download the error file and make the necessary changes and export again after correcting the errors listed. Following is a sample error file.

Graphical user interface, text  Description automatically generated

An error ‘The Product Name attribute value is empty’ is displayed for multiple SKU IDs. This means that the SKU Title is empty and has no value for all the SKUs listed here.

NOTE

The SKU Title field is mandatory and all SKUs being exported to Magento should have a SKU Title. Also, the SKU Title should not be duplicate, that is, 2 SKUs cannot have the same SKU Title else an error will be generated. To avoid duplicate entries, it is best to use the SKU title formula feature which will be available in the future release to generate SKU titles to avoid errors related to name attribute.

The Product load summary will be shown for all records, and it will have the following fields:

  • Total products – displays the total count of SKUs being exported

  • Products processed – displays the total count of SKUs processed

  • Products successfully loaded – displays the count of SKUs loaded successfully from the processed SKUs

  • Failed to load – displays the total count of SKUs that have failed from the processed SKUs

Following are some of the key points to be noted while exporting data in Magento format:

  • If a SKU being exported to Magento has an incorrect attribute data or data type that does not match with the Magento attribute, no error messages will be displayed. However, such SKUs will not be imported in Magento.

    For example, an attribute Warranty has datatype as String in PCC and the same attribute has datatype as Integer in Magento, in this case, since the datatype does not match, the attribute Warranty will not be imported in Magento.

  • No categories will be created in Magento. This is applicable for data exported to Magento directly using API. For example, SKUs being exported belong to the taxonomy Accessories > Sunglasses > Aviator and if this taxonomy does not exist in Magento, the SKUs will not be imported for these categories. Hence, it is important to create all the required categories in Magento first.

    Once the categories are created, all SKUs being imported in future will be added to the relevant categories.

  • By default, 0 value will be added / updated for the price attribute. However, if PRICE metatag is assigned to an attribute and if that attribute has any value, the value will be considered for the attribute.

  • If a price attribute has multiple values such as 50, 100 and so on or multiple PRICE metatag is assigned to an attribute for a single SKU, in this case, 0 value will be set for the price attribute in Magento as a product cannot have multiple prices.

  • If the price attribute has an incorrect value such as Ten instead of 10,  0 value will be set for the price attribute in Magento.

  • The UoM for the price attribute will  be dollar, by default. All the values for the price attribute in Magento will be displayed as 50 $ or 70 $ and so on.