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

How to Remove WooCommerce Product SKU and Price

How to hide woocommerce sku and price

Sometimes you need to hide extra information such as product SKU and price for your WooCommerce store.

Today, i would like to share how you actually can achieve above situation. Let’s get started by giving you 2 examples:

1. You would like to hide product SKU
2. You would like to hide product price

First, you need to open your functions.php file at your current theme folder (wp-content/themes/[THEME]/functions.php)
You can download functions.php file from FTP, edit then upload again, OR you can go to WordPress Admin -> Appearance -> Editor, and click functions.php to edit then save.

Put below code to bottom of the file:

Tips #1 : Hide Product SKU at All Product Page

if(is_product())
{
  add_filter( 'wc_product_sku_enabled', '__return_false' );
}

Continue reading

WordPress 3.9 Smith

WordPress version 3.9 has been releases and have around 700K people like out site, named “Smith” in honor of jazz organist Jimmy Smith. Bows available for download or update in your WordPress dashboard.

There are few advanced functions that make this version better than before:

A smoother media editing experience

editor

1. Improved visual editing

The updated visual editor has improved speed, accessibility, and mobile support. You can paste into the visual editor from your word processor without wasting time to clean up messy styling. (Yeah, we’re talking about you, Microsoft Word.)

image

2. Edit images easily

With quicker access to crop and rotation tools, it’s now much easier to edit your images while editing posts. You can also scale images directly in the editor to find just the right fit.

dragdrop

3. Drag and drop your images

Uploading your images is easier than ever. Just grab them from your desktop and drop them in the editor.

Continue reading

How to Limit Customer Buy One Product Only with WooCommerce

How to Limit Buying One Item Only in WooCommerce

I have started using WooCommerce since year 2012 and i like it because it provides me many customized options to suit my needs or client requirement.

Case Study:One of the possible situation is where i need to disable the shopping cart. In this way, the customer only can buy one item, if the customer goes to another product and tries to buy it, the cart will be cleaned and the last item added.

 
Continue reading