Sending simple attributes from the Magento 2 Admin

If the attributes you want to send are already available as simple attributes in your Magento 2 admin, they can easily be added on the Extension page.

1. Start by going to Stores -> Product

Here you can see all available attributes in your shop. Find the attribute codes of the ones you want to send to Clerk.io:

2. Make sure that your attribute is both Visible and used in Product Listings. You can check this by clicking the attribute, and going to Storefront Properties:

3. Go to Stores->Configuration->Clerk->Configuration

4. Under Synchronization -> Additonal Fields, write the attribute codes separated by commas:

5. Click Save Config in the right corner.

6. Go to System -> Cache Management 

7. Clear the various caches here:


8. After implementing your attributes, go to my.clerk.io->Data and click Start New Data Sync in the upper right corner.

Sending custom attributes

Custom attributes, can be added through the extension in FTP.

This file handles the product attributes:
vendor->clerk->magento2->Model->Adapter->Product.php

Each attribute has its own fieldHandler, in the function addFieldHandlers() 

Simply add your attribute here, with the following syntax:

$this->addFieldHandler('CLERK_ATTRIBUTE_NAME', function($item) {
   return MAGENTO2_LOGIC;
});

Where CLERK_ATTRIBUTE_NAME defines the name you want it to have in Clerk.io, and MAGENTO2_LOGICis the code for pulling the attribute from Magento 2.

Lastly, include your new attributes in the Clerk.io extension in the Magento 2 admin, under Synchronization -> Additional Fields.

After implementing your attributes, go to my.clerk.io->Data and click Start New Data Sync in the upper right corner.

Did this answer your question?