Send Sale price to Facebook for WooCommerce
-
Hi,
I’m using your plugin on a website that is connected to a FB Catalogue with “Facebook for WooCommerce” plugin. I’m just using a 40% Store Wide Discount, the problem is that the discounted price is not sent to FB. I know that the discounted price is not saved in DB.
At the moment I’m using this filter but it overrides the regular price sent to facebook and the user doesn’t have the perception of a discount on the FB Shop:
function odb_facebook_sync_price_update($price, $facebook_price, $product){
if ( ! $facebook_price && $product instanceof \WC_Product ) {
$price = apply_filters(‘advanced_woo_discount_rules_get_product_discount_price_from_custom_price’, $price, $product, 1, $price, ‘discounted_price’, true, true);
}
return $price;
}
add_filter( ‘wc_facebook_product_price’, ‘odb_facebook_sync_price_update’, 10, 3 );I would like to keep the regular price as is and override just the sale price which is actually not set in the product by the discount rules plugin.
Any help? Thank you.
- The topic ‘Send Sale price to Facebook for WooCommerce’ is closed to new replies.