Issue with WooCommerce Addon – Custom Fields Not Updating on Product Update
-
Hello,
I am using the WooCommerce addon, but I am encountering an issue when updating a product. The custom fields I have created are not being updated within the
cm_tsfwc_data_before_entry
filter.For example, my implementation looks like this:
public function formatProductData($formatted_data, $raw_data, $object, $schema_name) {
if ('product' !== $schema_name) { return $formatted_data; }
ob_start();
// custom_product_label();
do_action('custom_product_label');
$formatted_data['woodmart_product_label'] = ob_get_clean();
return $formatted_data;
}
add_filter('cm_tsfwc_data_before_entry', [$this, 'formatProductData'], 10, 4);
However, after a product update, my custom fields do not get updated in Typesense. It seems that thecm_tsfwc_data_before_entry
filter is not correctly handling the custom fields during the update process.
Interestingly, when I manually run the following WP-CLI command:wp typesense index product --ids={productId}
The indexing works correctly, and the custom fields are included as expected.
Could you please provide guidance on how to resolve this issue? Any suggestions would be greatly appreciated.
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.