VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: Cart page : how to display "free shipping" ?

Cart page : how to display "free shipping" ? 06 Jun 2017 14:10 #1

Dear Reinhold,

I use your advanced plugin on my marketplace (woocommerce/wc vendors)

My question concerns the shipping amount displayed in the shopping cart page.
When the shipping cost is >0, the amount is displayed.
But when the shipping is free, the amount is not displayed (just the name of the "Shipping By Rules Methods").

Is there a solution to display a message like "free shipping" when it's offered ?

Many thanks in advance.
Attachments:
The administrator has disabled public write access.

Cart page : how to display "free shipping" ? 19 Jun 2017 00:30 #2

Dear Vedia,
This is the default behaviour of WooCommerce (i.e. shipping costs of 0 are not printed). The displayed text (i.e. the suppression of the shipping cost for free shipping) is done in WooCommerce's templates/cart/cart-shipping.php file, which calls the function wc_cart_totals_shipping_method_label to create the displayed name of the shipping method. That function (file wc-cart-functions.php) has an explicit check "if ( $method->cost > 0 ) {", i.e. it is hardcoded to append the shipping costs only if they are larger than 0.

The only way I can see around this issue is to implement the filter woocommerce_cart_shipping_method_full_label (called at the end of the wc_cart_totals_shipping_method_label) and insert the HTML for the free shipping text if $method->cost==0...

That would mean implementing a tiny wordpress plugin to provide an implementation of that filter.
As I said at the beginning, this is a general WC problem and has nothing to do with our plugin.

Best regards,
Reinhold
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular