VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum

We are currently unable to provide proper support!

We are very sorry to announce that we are currently very busy working on some huge, very time-consuming and time-sensitive projects, so currently we are unable to provide proper support in our forums! We hope that after the conclusion by the end of July we will be able to properly answer all open support requests.

Sorry for the inconvenience and thank you for your understanding!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

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:

Please Log in or Create an account to join the conversation.

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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1

VM - Shopping cart

 x 

Cart empty

Login Formular