Created
May 19, 2021 07:38
-
-
Save Balakrishnan-flycart/0e2a1284e519179321e6e0cd54299961 to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - Woo Discount rules compatible with Facebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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