Thread Starter
Defix
(@defix)
Thanks!
Using that last php snippet and mainly now fixed in product catalog, but if I using woocommerce shortcodes to display products on my frontpage etc – there still that problem exist.. How to fix that?
please share your shortcode
Thread Starter
Defix
(@defix)
[products limit=”4″ columns=”4″ category=”furniture” visibility=”featured”]
Maybe something related visibility=”featured”
Good day, @defix!
Are you using any page builders plugin (Elementor, e.g.)? Because there’s no problem in variable badges with the custom sale badge settings and the compatibility code on the page with your shortcode.
Thread Starter
Defix
(@defix)
Hi!
No page builders. Using Blocksy pro and Stackable blocks. Woocommerce archive and singe products pages ok, but not working with that shortcode, if product is varable product.
TAke a look – Woo and ADP activated on site:
https://staging.muster.ee/
-
This reply was modified 3 months, 1 week ago by
Defix.
-
This reply was modified 3 months, 1 week ago by
Defix.
Hi, @defix!
Could you, please, send us our JSON system report (Pricing rules>Tools>System report>Get system report) via our help desk?
Final code for whom having same problem
add_filter('woocommerce_variation_prices', function ($prices_array, $product, $for_display) {
global $post;
if (
!is_shop() &&
!is_product_category() &&
!is_product() &&
!is_product_taxonomy() &&
!(isset($post) && $post->post_type === 'product')
) {
return $prices_array;
}
$processedProduct = adp_functions()->calculateProduct($product, 1);
if (!$processedProduct instanceof \ADP\BaseVersion\Includes\PriceDisplay\ProcessedVariableProduct) {
return $prices_array;
}
$new_prices_array = array("price" => [], "regular_price" => [], "sale_price" => []);
foreach ($processedProduct->getChildren() as $variation) {
$idx = $variation->getProduct()->get_id();
$new_prices_array['price'][$idx] = $variation->getPrice();
$new_prices_array['sale_price'][$idx] = $variation->getPrice();
$new_prices_array['regular_price'][$idx] = $variation->getOriginalPrice();
}
return $new_prices_array;
}, 10, 3);