Skip to content

Instantly share code, notes, and snippets.

@wtmujeebu
Last active February 17, 2022 05:05
Show Gist options
  • Save wtmujeebu/098b8af40d58b34606869e06d29be503 to your computer and use it in GitHub Desktop.
Save wtmujeebu/098b8af40d58b34606869e06d29be503 to your computer and use it in GitHub Desktop.
Modify FB retailed ID of the product before syncing - using Product Catalog Sync for WooCommerce by WebToffee
<?php // Do not copy this line.
add_filter('wt_fb_sync_product_retailer_id', 'wt_fb_sync_product_retailer_id', 10, 2);
function wt_fb_sync_product_retailer_id($fb_retailer_id, $product) {
$fb_retailer_id = $product->get_sku() ? $product->get_sku() : 'wc_post_id_' . $product->get_id();
return $fb_retailer_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment