admin管理员组文章数量:1307666
I am using Discount Rules for WooCommerce - PRO plugin. But it is not changing price with PHP and it's a problem when it comes to Facebook catalog.
For example I have with discount rule:
- on backend regular price (without sale price) is 11.99 €
- on front end regular price is 11.99 € and sale price is 10,55 €.
For facebook catalog the price 11.99 € and this is problem because it calls $product->get_price(). I tried to use the hook "woocommerce_product_get_price" like:
add_filter('woocommerce_product_get_price', 'manipulating_price_with_discount_rule_price', 9999, 2);
function manipulating_price_with_discount_rule_price($price, $product) {
$discounted_plugin_price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', false, $product, 1, 0, 'all', true);
if (is_array($discounted_plugin_price) && isset($discounted_plugin_price['discounted_price']) && is_numeric($discounted_plugin_price['discounted_price'])) {
$current_plugin_price = round($discounted_plugin_price['discounted_price'], 2);
}
if (isset($current_plugin_price)) {
$price = $current_plugin_price;
}
return $price;
}
The page has stopped working due to memory size issues, even though the filter priority is set very low. Has anyone else encountered a similar problem?
本文标签: phpFlycart discount rules plugin issue on price for the Facebook catalogStack Overflow
版权声明:本文标题:php - Flycart discount rules plugin issue on price for the Facebook catalog - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741822880a2399469.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论