This article is aimed at developers looking to extend/change the data sent to PureClarity in the data feeds.
Filters
The following filters are available to hook into and update the data being sent to PureClarity:
Product feed - pureclarity_feed_get_product_data
Category feed - pureclarity_feed_get_category_data
User feed - pureclarity_feed_get_user_data
Example usage
This example adds a custom field to the product data.
/**
* @param mixed[] $data - the array of data that will be sent to PureClarity
* @param WC_Product $product - the WooCommerce product object
* @return mixed
*/
function product_callback($data, $product) {
$data['MyCustomField'] = 'MyCustomData';
return $data;
}
add_filter( 'pureclarity_feed_get_product_data', 'product_callback', 10, 2 );