Posts

Woocommerce : working with automatic emails

Woocommerce, the most popular ecommerce extension for wordpress, comes with a very efficient HTML template based automatic email system. The first thing to look for when customizing wordpress automatic emails is to go to the woocommerce/settings/emails area, where you can customize the subject of the emails for creating new account, new order, etc... If you want more customization , you have to go your theme and override the default woocommerce email templates.

After that you can test how mails react with the following extensions

woocommerce themes with thumbnail image slider in loop

Displaying many images for one single product is a default feature of woocommerce product interface : in its primary setup, woocommerce displays the single product page with the featured image in main display, layed out above thumbnails of product gallery images. But within the category pages,  or more generally within the product loop, woocommerce displays only the single image. One interesting feature is to allow user to view all product images within the category page (or within all products loops), either via a carousel or a lightbox. Here is a selection of themes that integrate this feature natively. All these themes share the same following features : they integrate visual composer, and most of them show off the quick view feature, provided by free quick view plugin

 

OXYGEN : woocommerce boostrap theme with product slider and quickview in default archive page

woocommerce-theme-thumbnail-slider-oxygen

 

POLARIS : woocommerce boostrap theme with product slider and quickview in default archive page

woocommerce-theme-thumbnail-slider-polaris

The alternative : product list hover

VENEDIS

 

woocommerce-theme-thumbnail-slider-venedis

woocommerce order product list

The latest version of woocommerce adds a feature to the order list  :  the Purchased column describes items purchased for that order : the number of items is displayed and a click on the line displays all order products.Interesting behaviour when there are many products per order : if you have one or two product per average order, it might be better to display everything in the column, to get a whole view of various recent orders , like a sales report:

woocommerce-order-sales-reportthe code is very simple, use the manage_shop_order_posts_custom_column action to add some text to the purchased column :

 

 

Woocommerce : how to choose your theme

There are thousand of free and premium themes available for woo commerce. Before choosing one, make sure you have checked a few important things

  • most professional wordpress / woocommerce themes are responsive : they can display your website in mobile phones. But you do need to check the websites on all formats including IPADS, Iphones, and Android. Prepare a list of all resolutions devices can have, including windows powered phones that can turn out very tricky if someone uses internet explorer (see below)
  • after you have checked the theme on various sizes, check it on various browsers : a wordpress theme that works on Internet explorer 8 is the sign of very good HTML standard compliance, so you need to be able to check on various versions of Internet Explorer, which means many computers available !
  • Have a look at the stylesheet : it should be not too big and include not too many extra useless formatting.  But a good woo commerce theme comes with its own woo commerce stylesheet, and removes the original woo commerce style sheet

Woocommerce product admin category persistence

Can be a long task to edit products within woocommerce.

the code below can be integrated in a plugin or within your theme : it will store the last selected product  category filter in the product admin and restore it at next display of product page

add_filter( 'init', 'wpse34956_persistent_posts_list_mode' ,1);
function wpse34956_persistent_posts_list_mode() {

// take into account post types that support excerpts
$post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : '';

if (is_admin() && $post_type=="product")
{
if ( isset( $_GET['product_cat'] ) ) {
// save the list mode
update_user_meta( get_current_user_id(), 'product_cat' . $post_type, $_GET['product_cat'] );
return;
}

// retrieve the list mode
if ( $product_cat = get_user_meta( get_current_user_id(), 'product_cat' . $post_type, true ) )
{ $_GET['product_cat'] = $product_cat;}

}
}

How to recreate woocommerce pages

When you activate woocommerce plugin, a message box pops up at the top of the wordpress dashboard, inviting you to let the plugin automatically create specific woocommerce pages : shopping cart, order page, user page, etc... You can also remove the notice if you want to create the pages yourself. But if you change your mind and would like woocommerce to create the pages there is a tip that is documented on a stackoverflow conversation, it's very simple :

What ended up working for me was adding "&install_woocommerce_pages=true" to the Settings page URL.

 

woocommerce hack : free shipping incentive sales

When configuring woocommerce for wordpress shopping rates, you can opt for a combination of flat rate and free shipping with  minimum amount. by default woocommerce shopping cart will not behave perfectly. First hack will let the shopping cart shipping method selection update automatically when minimum order for free shipping is reached. Second hack will display an incentive message wehn minimum amount for free shipping is not reached. Everything is coded via filters and actions, and will work with woocommerce 2.0 and above

first hack : update shipping display choice when free shipping  minimum amount is reached

second hack : display incentive message when minimum amount is not reached, including display of minimum amount and remaining amount to add to shopping cart. Very efficient ! 

 

woocommerce : non available zero products

The woommerce defaut behaviour for products where price is not set is to disable the add to cart button  : my customer wanted this behaviour for product that have zero mentionned. Default woocommerce makes zeo product free!, but we decided to disable shopping cart for those too. very simple thanks to filters and template system:

 

  • in your functions .php , add

     

  • then create in your theme te following files 
    • /woocommerce/single-product/add-to-cart/simple.php
    • /woocommerce/loop/add-to-cart.php
    • and modify the first conditionnal test to make woocommerce display "not available" if price is zero :