Top Navigation Menu

Add Simple & Virtual Products to WooCommerce

Add Simple & Virtual Products to WooCommerce
Create an eCommerce Store with WordPress & WooCommerce

Continuing with our series “Create an eCommerce Store with WordPress & WooCommerce”.

Create an eCommerce Store Part 4A > Part 4B

This WooCommerce Video:

  • Change Single Product Image Size
  • Install the Plugin Regenerate Thumbnails; so our new images sizes get applied to images we have already uploaded.
  • Configure Taxes
  • Configure Shipping
  • Add a Simple Product
  • Add a Virtual Product

Links use in the video:

Regenerate Thumbnails

Need the Canvas Theme?

Get the Free Canvas theme to follow along with this course.

Visit for FREE Video Tutorials for Web & Graphic Design

Code Snippet to Hide All Other Shipping Options When Free Shipping is Available:

Put this in your Child functions.php

/**     * woocommerce_package_rates is a 2.1+ hook     */    add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );         /**     * Hide shipping rates when free shipping is available     *    * @param array $rates Array of rates found for the package     * @param array $package The package array/object being shipped     * @return array of modified rates     */    function hide_shipping_when_free_is_available( $rates, $package ) {    	    	// Only modify rates if free_shipping is present     	if ( isset( $rates['free_shipping'] ) ) {     	     		// To unset a single rate/method, do the following. This example unsets flat_rate shipping     		unset( $rates['flat_rate'] );     		     		// To unset all methods except for free_shipping, do the following     		$free_shipping          = $rates['free_shipping'];     		$rates                  = array();      		$rates['free_shipping'] = $free_shipping;    	}    	    	return $rates;    }     


No comments yet.

Leave a Reply