Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Balakrishnan-flycart/0e2a1284e519179321e6e0cd54299961 to your computer and use it in GitHub Desktop.
Save Balakrishnan-flycart/0e2a1284e519179321e6e0cd54299961 to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - Woo Discount rules compatible with Facebook
function odb_facebook_sync_price_update($price, $facebook_price, $product){
if ( ! $facebook_price && $product instanceof \WC_Product ) {
$discount = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $price, $product, 1, $price, 'discounted_price', true, true);
if($discount !== false){
$price = $discount;
}
}
return $price;
}
add_filter( 'wc_facebook_product_price', 'odb_facebook_sync_price_update', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment