4 WP Snippets to Rock Your Online Store Sales

If you have an online store built on the WordPress platform and are looking for ways to boost your sales, this is the post for you.

Following are 4 tested and proven WordPress Tips that I’ve learnt from my own experience running my online digital designs store.


1. Add Images to Your RSS Feed

Typically, your WordPress site’s RSS feed includes only your post title and text content – and no images! Yes. It’s hard to believe but true. So if you’re posting your RSS feed on some other site or are using the feed to send newsletters to your Feedburner subscribers, they are only receiving your textual content without your post’s featured image. And let’s face it, featured image plays a key role in attracting visitors to read your post. So having it show up in your subscribers’ emails is a must.

Here’s a code you can add to your Functions.php. Not, the main theme’s Functions.php but to the child theme. Child theme is basically a new theme you create to overwrite specific files in your main/parent theme. For more info on how to use child themes, click here.

/* Add images to rss for feedburner */ function featuredtoRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '<div>' . get_the_post_thumbnail( $post->ID, 'full', array( 'style' => 'margin-bottom: 15px;') ) . '</div>'. $content; } return $content; } add_filter('the_excerpt_rss', 'featuredtoRSS'); add_filter('the_content_feed', 'featuredtoRSS');


2. Add Custom Posts to RSS feed

By default, only your regular posts show up in your RSS feed and not your custom posts – custom posts being any posts other than your blog posts e.g. portfolio items, products etc. So if you’re using shopping plugins like Woocommerce, Easy Digital Downloads etc. for your store, there’s a good chance your newly published products/projects are not showing up in your feed and therefore in your subscribers’ emails at all!

To add your desired custom posts types to yur feed, customize and add the following code to your child theme’s Functions.php

/* Adding custom posts to rss feed */
function myfeed_request($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = array('post', 'product', 'portfolio');
return $qv;
add_filter('request', 'myfeed_request');

In this example, I have added both ‘Product’ and ‘Portfolio’ post types to my feed. You can edit these as per your need.


3. Disable Billing Details for Digital Products

Woocommerce, by default, shows a long billing info form while checking out your cart. Now if someone’s trying to buy a non-shippable product on your site, the billing/shipping details don’t matter. However, still having to fill out the entire form can possibly drive your customer away.

So here’s a smart little code you can paste into your functions.php
The code disables the billing info fields ONLY when there’s not a single shippable item in your customer’s cart. If there IS a shippable item, then all the billing fields will automatically activate.

/* remove specific woocommerce checkout form fields */ function patricks_billing_fields( $fields ) { global $woocommerce; // return the regular billing fields if we need shipping fields if ( $woocommerce->cart->needs_shipping() ) { return $fields; } // we don't need the billing fields so empty all of them except the email unset($fields['billing']['billing_company']); unset($fields['billing']['billing_address_1']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_phone']); return $fields; } add_filter( 'woocommerce_checkout_fields', 'patricks_billing_fields', 20 );


4. Move the ‘Add to Cart’ button Up

When visitors land on your single product page and like the product, you want them to find the ‘Add to cart’ or ‘Buy now’ button right in front of their eyes, don’t you?

Research shows that most people do not take the time to read the descriptions under product images unless reading them are absolutely necessary to understand the product features.

Paste the following code in your functions.php to move the ‘Add to Cart’ button above the product description, just below the price (by default but may vary from theme to theme)

/** woocommerce: change position of add-to-cart on single product **/ remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 13 );


If you’re an online shop owner…

You probably have some tips for our readers learnt through your own personal experience. Please do share them so we can benefit from them.