I opened a new ticket for this topic as requested.
I have WPC Fly Cart for WooCommerce (Premium) and WPC Free Shipping Bar for WooCommerce installed and I'm displaying the free shipping bar via shortcode at the single product page but, when changes are made to the cart, the free shipping bar added by shortcode on the single product page is not being updated.
I read on a different ticket from another user that you helped him implementing a solution for his free shipping bar added by shortcode on the checkout page but unfortunately this solution is not working for me, this is the code I'm using to insert the wpcfb on the single product page:
//Add free shipping bar before add to cart on single product page
function add_shortcode_fsb() {
if ( is_product() ) {
echo do_shortcode( '[wpcfb]' );
}
}
add_action('woocommerce_single_variation', 'add_shortcode_fsb', 0);
It does the job displaying the bar but not updating along with the cart where there's another free shipping bar displayed that does update when changes are made to the cart so it confuses customers (one bar showing something different than the other).
The only issue is that when the cart is empty and a product is added, the bar appears in the cart but not on the product page—until the page is reloaded. Is there a way to make it appear on the product page as well?
And what if we want the bar to be displayed even when the cart is empty? Is there a way to do that?
Hi!
I opened a new ticket for this topic as requested.
I have WPC Fly Cart for WooCommerce (Premium) and WPC Free Shipping Bar for WooCommerce installed and I'm displaying the free shipping bar via shortcode at the single product page but, when changes are made to the cart, the free shipping bar added by shortcode on the single product page is not being updated.
I read on a different ticket from another user that you helped him implementing a solution for his free shipping bar added by shortcode on the checkout page but unfortunately this solution is not working for me, this is the code I'm using to insert the wpcfb on the single product page:
It does the job displaying the bar but not updating along with the cart where there's another free shipping bar displayed that does update when changes are made to the cart so it confuses customers (one bar showing something different than the other).
Can you help us fix it?
Thanks!
Hi Samuel,
Please add the custom code below. (How to add custom code? ↗):
Please let me know if it works as expected.
Best regards,
Dustin
Hi Dustin,
It's working! Thank you very much.
The only issue is that when the cart is empty and a product is added, the bar appears in the cart but not on the product page—until the page is reloaded. Is there a way to make it appear on the product page as well?
And what if we want the bar to be displayed even when the cart is empty? Is there a way to do that?
Thx!
Please update our plugin to the latest version 1.4.6, clear the cache, and try again. I've fixed it.
You can also disable the snippet I sent you. It was included in the plugin update :)
Best regards,
Dustin