config->getConfigData($this->key, 0); if($value){ add_filter('wc_facebook_product_price', function ($price, $facebook_price, $product){ if ( !$facebook_price ){ $product_price = Woocommerce::getProductPrice($product); $discounted_price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $product_price, $product, 1, 0, 'discounted_price', true, false); if($discounted_price !== false){ $price = (int)round($discounted_price*100); } } return $price; }, 10, 3); } } /** * load fields * */ public function loadFields(&$available){ $value = $this->config->getConfigData($this->key, 0); if ( is_plugin_active( 'facebook-for-woocommerce/facebook-for-woocommerce.php' ) || ($value == 1)) { $available = true; ?>