Disable “Install the WooThemes updater plugin to get updates”

Here’s a single line code which allows you to get rid of annoying WooCommerce admin notices i.e “Install the WooThemes updater plugin to get updates for your WooThemes plugins”.

All you need to do is copy the following code snippet and paste it inside your functions.php file located inside your themes directory.

remove_action('admin_notices', 'woothemes_updater_notice');

Something you may not know: How to Hook Into WooCommerce to Trigger Something After an Order is Placed

How to Display Total Products Count in WooCommerce

This a handy WordPress code snippet which can be used to display the total products count in your WooCommerce shop. To do this, we are going to use WP_Query. 

Useful Read: How to Hook Into WooCommerce to Trigger Something After an Order is Placed

$args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1 );
$products = new WP_Query( $args );
echo $products->found_posts;

 

Do Something After The WooCommerce Order is Completed

WooCommerce comes with a built-in hook called woocommerce_order_status_completed, which allows you to execute a function as soon as the order is completed.

Quick Tip : How to Use WP-PageNavi With WooCommerce?

Within your function you an also create an instance of WC_Order class to access the details of your last order.

<?php
//hook into WooCommerce after the order is completed
add_action( 'woocommerce_order_status_completed', 'do_something' );
function do_something($order_id) {
        //creating an order object to access details of last order.
	$order = new WC_Order( $order_id );
	
}

 

How to Disable Default WooCommerce Stylesheet?

By default, WooCommerce plugin enqueues three different stylesheets. You can remove these styles, by adding the following code snippet to your functions.php file.

See Also: Declare WooCommerce support in third party theme

add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );

The above code will deregister all three stylesheets. If you want to remove a specific stylesheet, you can use the following code,

// Remove each style one by one
add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' );
function jk_dequeue_styles( $enqueue_styles ) {
	unset( $enqueue_styles['woocommerce-general'] );	// Remove the gloss
	unset( $enqueue_styles['woocommerce-layout'] );		// Remove the layout
	unset( $enqueue_styles['woocommerce-smallscreen'] );	// Remove the smallscreen optimisation
	return $enqueue_styles;
}

// Or just remove them all in one line
add_filter( 'woocommerce_enqueue_styles', '__return_false' );

 

How to Declare WooCommerce Support in Your Theme

Here’s a handy PHP code snippet which allows you to declare WooCommerce support in your custom WordPress themes.

Quick Tip : How to Use WP-PageNavi With WooCommerce

All you need to do is copy the following code and paste it inside your functions.php file.

add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
    add_theme_support( 'woocommerce' );
}

Source : http://docs.woothemes.com/document/declare-woocommerce-support-in-third-party-theme/

How to Use WP-PageNavi With WooCommerce?

WooCommerce comes with a built in pagination feature. However, you can easily replace it with more advanced WP-PageNavi plugin by adding a tiny code snippet to your functions.php file.

Quick Tip: How to Change the WooCommerce Return to Shop Button

To replace WooCommerce pagination with WP_Pagenavi, use the following code.

remove_action('woocommerce_pagination', 'woocommerce_pagination', 10);
function woocommerce_pagination() {
        wp_pagenavi();         
    }
add_action( 'woocommerce_pagination', 'woocommerce_pagination', 10);

Source : http://www.haloseeker.com/replace-woocommerce-default-pagination-with-wp-pagenavi-pagination/

How to Change the Sale badge text in WooCommerce

This is a small amount of code which allows the WordPress Theme developers to change Sale badge text in WooCommerce.

Quick Tip : Change “Add to cart” button text in WooCommerce

All you have to do is drop the following code snippet in your functions.php file located inside your theme folder.

add_filter( 'woocommerce_sale_flash', 'wc_custom_replace_sale_text' );
function wc_custom_replace_sale_text( $html ) {
    return str_replace( __( 'Sale!', 'woocommerce' ), __( 'Bestbuy', 'woocommerce' ), $html );
}

And don’t forget to replace Bestbuy with your own custom text.

Change the Sale badge text in WooCommerce

Change the Sale badge text in WooCommerce

 

How to Show Trailing Zeros on Prices in WooCommerce

Here’s a handy WordPress code snippet which allows you to display trailing zeros on prices in WooCommerce.

Quick Tip : How to Change WooCommerce Shop Page Title?

All you need to do is copy the following code and paste it inside your functions.php file located inside your theme directory.

add_filter( 'woocommerce_price_trim_zeros', 'wc_hide_trailing_zeros', 10, 1 );
function wc_hide_trailing_zeros( $trim ) {
    // set to false to show trailing zeros
    return false;
}

 

How To Change The PayPal Icon In WooCommerce

Here’s another quick trick which allows you to change default Paypal icon that appears on the WooCommerce checkout page in WordPress. To do this, we are going to use woocommerce_paypal_icon filter.

To change WooCommerce Paypal icon use the following code snippet.

Useful Read: Change WooCommerce Shop Page Title

//change paypal icon on woocommerce checkout
function ccw_change_paypal_logo($logourl) {
	return get_template_directory_uri(). '/images/paypal.jpg';
}
add_filter('woocommerce_paypal_icon', 'ccw_change_paypal_logo');

 

 

Change WooCommerce Shop Page Title

Here’s a handy WordPress code snippet which allows you to change the shop page tile in WooCommerce.

Quick Tip : Change Search Permalink in WordPress

How to Change WooCommerce Shop Page Title

How to Change WooCommerce Shop Page Title

To Change Shop page title in WooCommerce use the following code snippet.

//Change WooCommerce Shop Page Title
add_filter( 'woocommerce_page_title', 'custom_woocommerce_page_title');
function custom_woocommerce_page_title( $page_title ) {
  if( $page_title == 'Shop' ) {
    return "My Online Store";
  }
}

 

Change WooCommerce Shop Page Title

Change WooCommerce Shop Page Title