Remove ‘(Free)’ label text for WooCommerce Shipping and Handling

# This is post #2 of 31 in the challenge “31 Ways to Customize WooCommerce

This snippet show you how to remove (Free) label text for WooCommerce Shipping and Handling section in WooCommerce checkout and cart page.

Currently if the cost of your shipping method is $0, it will display text “(Free)”. But sometimes there is case where you have an option of shipping which is paid by the customer upon pickup or receival, so the value of the shipping for store owner is 0 but is not FREE for customer.

Before

(Free) text at Shipping and Handling row if shipping cost is 0

(Free) text at Shipping and Handling row if shipping cost is 0

Continue reading

How to Add a 5% Surcharge to Your WooCommerce Cart / Checkout

# This is post #1 of 31 in the challenge “31 Ways to Customize WooCommerce

This snippet mostly explained how you can add a 5% surcharge to WooCommerce cart / checkout based on conditions.

Option 1 (Add 5% surcharge for all) :

add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge_all' );

function woocommerce_custom_surcharge_all() {
  global $woocommerce;

  if ( is_admin() && ! defined( 'DOING_AJAX' ) )
    return;

  $percentage = 0.05; //change this value for surcharge percentage
  $surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ) * $percentage;

  $woocommerce->cart->add_fee( 'Surcharge (5%)', $surcharge, true, 'standard' );
}

Continue reading

WooCommerce Product Badge

WooCommerce Product Badge

WooCommerce Product Badge” – A free WooCommerce plugin that let you display ‘New’, ‘Sale’ (Save %) and ‘Featured’ badge at shop and product page.

In WooCommerce Sidebar Menu, there will be a new submenu link called ‘Product Badge’ where you can:

  • Enabled / Disabled the plugin
  • Show “New” Badge
  • New Product with How Many Days?
  • Show “Sale” Badge
  • Show “Featured” Badge
WooCommerce > Product Badge Option Page

WooCommerce > Product Badge Option Page

Continue reading

How to Add Learn More Button to Shop Page

Today i would like to show you how to change “Add to cart” button text at WooCommerce shop or category page. Sometimes we need to add “Learn More” button at each product so that more people will click this button and redirect to product page, and we just need to use below code to update existing “Add to cart” text or just add a new button for each product.

You need to add below code into your theme functions.php file. (Check this guideline to add code into theme functions.php)
Continue reading