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 Change Add to Cart Button Text

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

How to Add Code into WordPress Theme Functions.php

Sometimes you need to modify or update WooCommerce settings by using filter or action hook. But if you are totally newbie, do refer content below to get better understanding on how to do that.

Adter you login successfully to WordPress Admin, you can see “Appearance” sidebar menu on your left. Mouse over that and click “Editor” link. It will show “Edit Themes” page, default will be your current theme.

On your right sidebar got a list of files, do click “Theme Functions (functions.php)” link. You will see the file content, do paste below code before symbol ‘?>’ at the bottom.

For example:

add_filter('loop_shop_columns', 'custom_loop_columns');
if (!function_exists('custom_loop_columns')) {
	function custom_loop_columns() {
		return 3; //Display 3 products per row
	}
}

How to Add Payment Type to WooCommerce Admin New Email

WooCommerce will be sending out email notification to admin for any new order with completed status. Anyway, sometimes we need to know what is the chosen payment type for each order through email.

I will share the snippet below so that you can use to add payment type information to new order email for admin.

add_action( 'woocommerce_email_after_order_table', 'admin_new_order_email_payment_type', 15, 2 );

function admin_new_order_email_payment_type( $order, $is_admin_email ) {
  if ( $is_admin_email ) {
    echo '<p><strong>Payment Type:</strong> ' . $order->payment_method_title . '</p>';
  }
}

You can add those code into your theme functions.php.

Hope this will help anyone who need this.

How to show percentage or saved amount for WooCommerce product sale price

WooCommerce default display for sale price did not catch my eye as there are no mention about how many percentage or how much you saved which is the main attraction for most of the potential customers.

I will share 2 code snippet below so that you can use to optimize the display of the sale price at WooCommerce overview and product page.

 

1. Show percentage(%) saved for the product sale price

// Add save percent next to sale item prices.
add_filter( 'woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2 );
function woocommerce_custom_sales_price( $price, $product ) {
  $percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 );
  return $price . sprintf( __(' Save %s', 'woocommerce' ), $percentage . '%' );
}

Continue reading