In WooCommerce you can add custom product attributes through the WooCommerce backend, or through the Clerk.io plugin in code, if needed.

Adding Simple Attributes 

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

1. In your WooCommerce backend, start by going to Products -> Attributes

2. In here, find the slug of the attribute you want to add.

3. Now go to Clerk -> Settings .
4. Under Additional Fields, add the attribute slug. You can also add several different ones, separated by comma:


5. Scroll to the bottom of the page and click Save Settings:

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

Adding attributes through code

Attributes in WooCommerce can also be added in code, through two files, as they are used to sync products manually and automatically when changes are made in the webshop.

These are the files:
wp-content->plugins->clerkio->includes->class-clerk-product-sync.php
in the function add_product 

wp-content->plugins->clerkio->includes->class-clerk-rest-api-php
in the function product_endpoint_callback in $productArray

Each attribute is structured like this:
'sku'   => $product->get_sku(), 

 
where 'sku' defines the name you want it to have in Clerk.io, and => $product->get_sku(), is a WooCommerce logic for pulling the attribute.

Finally, go to my.clerk.io -> Data and click Start New Data Sync to import your new attributes.

Did this answer your question?