Blog

How To Remove Digg Digg Floating Share Bar From WooCommerce Products

How To Remove Digg Digg From WooCommerce ProductsI love the Digg Digg social sharing plugin for WordPress and put it on just about every site that I build (including this one).

It floats nicely down the page and is such a slick looking way to get people to interact with your blog posts on social media.

But there’s a couple of shortcomings with the plugin and the guys from Buffer (who now own the plugin) obviously don’t have a boat load of extra time dedicated to fixing them.

One such shortcoming is that it doesn’t handle custom post types very well, in particular for me the main annoyance was having Digg Digg’s floating share bar show on all WooCommerce product pages.

I came up with this short code snippet to get it to stop showing on any WooCommerce related page, feel free to use it in your functions.php:

function dd_exclude_from_woocommerce() {
	if(is_woocommerce()) {
		remove_filter('the_excerpt', 'dd_hook_wp_content');
		remove_filter('the_content', 'dd_hook_wp_content');
	}
}
add_action('template_redirect', 'dd_exclude_from_woocommerce');

How To Change The PayPal Icon In WooCommerce

WooCommerceHere’s a quick tutorial that might help you increase conversions on your WooCommerce shopping cart.

If you’re using PayPal as the payment gateway (like many people do, including myself), then you’re likely to have noticed the dodgy little icon displayed on the cart.

This is a great place to put a more informative icon that shows just how many payment options you can process with PayPal. Many people aren’t even aware that you can process credit cards using PayPal and might completely abandon your cart if you don’t show them the right credit card symbols.

I put together the following graphic and code snippet which you can use on your WooCommerce checkout.

Here’s the new icon image we’ll be using which includes all the credit cards that PayPal accepts (right click and save):

acceptedCards

Make sure you keep the naming of the file consistent with the following code snippet. For tidyness I’ve placed this image in my theme’s directory under a subdirectory called “images”, if you’re using the following code verbatim you’ll want to do the same.

Copy and paste the following code into your functions.php:

function replacePayPalIcon($iconUrl) {
	return get_bloginfo('stylesheet_directory') . '/images/acceptedCards.png';
}
 
add_filter('woocommerce_paypal_icon', 'replacePayPalIcon');

Now take a look at your new and improved cart with it’s sexy little credit card icons. If this code snippet helped you out let me know in the comments.

ThirstyAffiliates Now Available On WordPress.org

ThirstyAffiliatesFor those that don’t know or are new to this blog a couple of years ago I developed and launch a premium plugin aimed at affiliate marketers called ThirstyAffiliates.

ThirstyAffiliates basically lets affiliate marketers using the WordPress platform manage all their affiliate links from a central location which aids in updating links, organising them into categories and various other things like importing and exporting between blogs.

For the past two years or so it’s been a 100% paid solution and something that has sold fairly well for me given I was spending max about an hour on it a week (mostly doing support).

In short it’s been in maintenance mode, that is until now.

If you’ve been following along with some of my recent posts on this blog you’ll see that I’ve been doing a lot of “how to” style posts giving little snippets of code for dealing with WooCommerce (amongst other things).

That’s because behind the scenes we have been ramping up to a relaunch of the ThirstyAffiliates website and releasing the plugin on WordPress.org and all of that happened on Monday.

Why release it on WordPress.org?

A while back in an effort to add value to the core plugin and to create some higher priced plans I created a number of “add-ons” to ThirstyAffiliates which were essentially standalone plugins that hooked into the feature set of the plugin and extended it.

These add-ons proved to be very popular and upped our sales significantly while allowing us to compete with other similar premium plugins on the market.

I was doing some brainstorming earlier this year thinking of ways to increase the potential of the business and the idea caught on that we should re-evaluate how we “sold” the plugin.

Essentially all the value is in the add-ons so I decided that rather than keep selling the core plugin we’ll expand the user base, get more people interested and provide them with ways to bolt on extra functionality.

With the old business model, I could only make so many permutations of pricing plans and add-on packs before it would start to get overwhelming. Selling the add-ons by themselves is much more flexible.

So, the main two reasons behind the move:

  1. It doesn’t restrict how many add-ons we can make (I have some really great ideas brewing for new ones and we plan to release 1 per month)
  2. And more importantly, it doesn’t restrict revenue potential in the future and will encourage people to buy from us again and again as we release new add-ons.

Where can you get ThirstyAffiliates?

You can either goto the main site or grab the plugin directly from WordPress. It’s proving to be quite popular already and we’ve had a warm reception from the community.

Of course I’m still working out the kinks in my sales system and business model for that matter, but the early days and success I’ve seen this week is promising.

If you are using the plugin already or have downloaded it and enjoy it I’d really appreciate a 5-star review on the plugin page.

How To Add Currency Code As Suffix To Prices In WooCommerce

WooCommerceIf you’re looking for a way to modify the price so that your currency code becomes a suffix to your prices in WooCommerce you’ve come to the right code snippet tutorial.

I’m going to show you how to make prices that look like this:

$49

Into this:

$49 AUD

When I was relaunching my site for ThirstyAffiliates we brought the shopping cart experience home with WooCommerce.

During the process I changed my pricing to AUD (Australian Dollars) but because the currency symbol ($) is the same as USD I thought it might cause some confusion if the first place they saw AUD was in PayPal when they got through to process their payment.

I’ve written previously about changing the currency symbol in WooCommerce to include your currency code, but it leaves the prices looking a little unnatural like this “AUD$49”.

The first step is easy enough, create a function to filter the price format in WooCommerce.

WooCommerce makes this ridiculously easy with it’s ample hooks and filters API, we just jump into the “woocommerce_price_format” action.

Here’s the code snippet which will add the suffix to all your prices throughout the site (copy and paste into your functions.php):

function addPriceSuffix($format, $currency_pos) {
	switch ( $currency_pos ) {
		case 'left' :
			$currency = get_woocommerce_currency();
			$format = '%1$s%2$s ' . $currency;
		break;
	}
 
	return $format;
}
 
add_action('woocommerce_price_format', 'addPriceSuffix', 1, 2);

I also wanted the ability to just show the currency code suffix on prices in the cart and checkout pages, leaving my product pages and listings all unaffected.

To do this you need to wrap this add_action with another function that only gets called on those pages.

We use two new actions to call our function to add the action for modifying the price format. Tricky stuff!

Here’s the full code snippet for restricting the formatting to cart and checkout (copy and paste into your functions.php):

function addPriceSuffix($format, $currency_pos) {
	switch ( $currency_pos ) {
		case 'left' :
			$currency = get_woocommerce_currency();
			$format = '%1$s%2$s ' . $currency;
		break;
	}
 
	return $format;
}
 
function addPriceSuffixAction() {
	add_action('woocommerce_price_format', 'addPriceSuffix', 1, 2);
}
 
add_action('woocommerce_before_cart', 'addPriceSuffixAction');
add_action('woocommerce_review_order_before_order_total', 'addPriceSuffixAction');

Hope this helps you, if it does feel free to leave a comment 🙂

How To Change the Price Of $0 Items To ‘FREE’ In WooCommerce

WooCommerceIf you are using WooCommerce (which has fast become my E-Commerce plugin of choice for WordPress), then sometimes you’ll run into the issue where you want to use the word “FREE” as the price when a product is $0.

I ran into this issue recently because I’ll probably be looking at including some free add-ons to ThirstyAffiliates eventually and wanted to make sure the templates would look proper when the price was set to 0.

I came up with this little snippet of code that you can just drop into your functions.php file in your theme. You’ll need WooCommerce installed as well, of course.

add_filter('woocommerce_get_price_html', 'changeFreePriceNotice', 10, 2);
 
function changeFreePriceNotice($price, $product) {
	if ( $price == wc_price( 0.00 ) )
		return 'FREE';
	else
		return $price;
}

(adjust and tested for WooCommerce 3.0+)

Hope this helps if you’re looking to do the same and have your prices show as “FREE” instead of an ugly $0.

How To Do Tiered Affiliate Commissions In Affiliates WordPress Plugin

Tiered Affiliate CommissionsI’m building out a new website for my core product ThirstyAffiliates at the moment and as part of the process we’re moving the affiliate program internal (I’ll be sending out an email about this shortly to my affiliates).

Previously it was run as part of my e-junkie shopping cart, but I made the executive decision to bring the shopping cart experience back home and that means I will lose my built in affiliate program that I had with them.

Don’t get me wrong I still love their shopping cart and actively recommend it. It’s a very light and effective tool for selling a limited number of products and I’m actually still using it for my other product Simple Page Tester. But there’s some bigger things afoot with ThirstyAffiliates which means it wasn’t practical to use this time (more on that in another post soon, I promise).

Anyhow, I stumbled onto a neat plugin called Affiliates which lets you run an affiliate program very effectively from your WordPress website and it has a bunch of handy integrations with various WordPress shopping carts freely available (I’m using the WooCommerce one).

I did run into one hitch though and I posted a comment on the Affiliates website recently asking if it was possible to do a tiered commission structure in the Pro version and if so I’d upgrade happily from the free version.

To my great surprise Antonio replied less than 3 hours later and informed me that it was indeed possible and that I wouldn’t even need to upgrade to Pro to do it. Edit: My mistake, you do actually need to upgrade to Pro, but it’s a steal at $59 and you get a lot more features including another one I was after for importing users from my existing program.

He proceeded to give me the following code snippet (which I modified a little bit):

class MyCustomReferralMethod {
 
	/**
	 * Registers a custom referral amount method.
	 */
	public static function init() {
		if (class_exists('Affiliates_Referral')) {
			Affiliates_Referral::register_referral_amount_method(array(__CLASS__, 'setCommissionTiers'));
		}
	}
 
	/**
	 * Custom referral amount method implementation.
	 * @param int $affiliate_id
	 * @param array $parameters
	 */
	public static function setCommissionTiers( $affiliate_id = null, $parameters = null ) {
		$result = '0';
 
		if (isset($parameters['post_id'])) {
 
			$affiliate_id = $parameters['affiliate_ids'][0];
			$referrals = affiliates_get_affiliate_referrals($affiliate_id);
 
			if ($referrals < 10) {
				$commission = 0.3;
			} else if ($referrals < 20) {
				$commission = 0.4;
			} else {
				$commission = 0.5;
			}
 
			$result = bcmul($commission, $parameters['base_amount'], 2);
 
		}
 
		return $result;
	}
}
 
add_action('init', array('MyCustomReferralMethod', 'init'));

Just drop that bad boy right into your functions.php file in your theme.

The tiered affiliate commission structure I wanted was:

  • 1-9 sales: Your commission rate is 30%
  • 10-19 sales: Your commission rate is 40%
  • 20+ sales: Your commission rate is 50%

If you’re selling a product and want to setup an affiliate program in-house like me on your WordPress based website I suggest you check out the Affiliates plugin (I’m using the WooCommerce Pro Integration version).

You can use the above code to do something similar if you like and if you need to adjust any of those numbers just play with the $commission variable in that hairy looking IF statement (0.3 = 30%) and the boundaries for the $referrals variable to adjust the number of sales.

Hope you enjoy the snippet.

How To Change The Currency Symbol Of A Currency In WooCommerce (And Have It Still Work In PayPal)

WooCommerceA while back I had to deal with a requirement for an e-commerce website I was building for a customer that needed to have the currency code along with the currency symbol.

This was to avoid confusion with USD and AUD which both use the $ symbol.

To get past this we wanted to change the symbol to AUD$ instead of just $.

All the current work arounds that I could find would change it, but it would stuff up the payment as it went through to PayPal because it couldn’t find the proper currency code.

Here’s how to change the currency display symbol without changing the code or messing up the currency when it goes through to PayPal:

add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
 
function change_existing_currency_symbol( $currency_symbol, $currency ) {
     switch( $currency ) {
          case 'AUD': $currency_symbol = 'AUD$'; break;
     }
     return $currency_symbol;
}

I originally posted this solution in the WordPress.org forums against this post because the OP had a very similar requirement. Hope this helps someone out there with a similar issue!

How To Setup A Review Website With WordPress

Build a review website with WP ReviewsIf you’ve been wondering how to setup a review website and you’re using the WordPress platform you’ve come to the right guide.

Today I’m going to take you through one of the most profitable types of niche websites: the review website.

Doing reviews is something that has a high enough barrier to entry that people tend to still steer away from setting them up on a whim.

With Google cracking down on thin niche websites that have very little content, setting up a review website is a good way to pad out those sites by adding useful content that your visitors will love.

Setting Up Your Review Website With WordPress

I recommend using WordPress in a lot of cases and rather than telling you how great it is like everyone else, I’m just going to assume you know why it’s a good platform to use.

If you aren’t familiar with WordPress but you’ve been considering using it for setting up a review website then here’s some reasons why you should use it over other platforms:

  1. Easy to setup quickly – you don’t waste time on setting up the site which means you can get started with the important stuff like writing reviews
  2. Very extensible – you can extend it to more than just a blog, which is what WordPress is sometimes pigeon held as. For example, today you’ll see how to setup proper review posts with rich snippets.
  3. Separation of front end and functionality

Why Would You Start A Review Website

There’s two main reasons I can identify for why you would want to start a review website:

The first is if you have experience with specific types of products in a niche and you feel that there’s an audience for reviews of those products.

The second is that review websites are a great strategy for expanding the content of a niche website. So if you have a website in a particular niche already that could benefit from product reviews it’s a good way to enhance your visitor’s experience on your website so you’re not just putting out a “thin” content website.

Review websites are also a great monetization technique. If you’re into affiliate marketing like I am then you’re always looking for different ways to get products in front of visitors.

A genuine, well written review is a fantastic way to:

  • Build trust leading up to asking them to click a link
  • Provide pre-sale information
  • Provide opinions about the quality of the product which can influence the customer’s thinking

Important Point: Be Genuine

It’s really important that your reviews are genuine. Don’t just spit out low-quality review pages that don’t add anything to the conversation of your niche.

Google has been cracking down on websites using bogus reviews to monetize their sites and it’s because these types of reviews don’t help anyone.

Your goal should be to provide a genuine, well written review that provides the customer with the necessary information to help their purchase.

Making Sure You Have Rich Snippet Information

Rich snippets are what lets Google display the little rating stars on their search results. It’s also what shows things like people’s photograph next to results.

These little rating stars really increase the click through rate of your review posts on your website. I’ve seen a massive increase in click throughs on review posts since implementing rich snippets.

For example, if you Google “bluehost pro” you’ll find my big review post on Bluehost’s Pro service. It doesn’t rank #1 all the time, but it still gets a good click through rate because of the rich snippets showing the rating stars (I gave it 5 stars by the way).

How To Make A Review Post With Rich Snippets In WordPress

The first step after you’ve setup your base WordPress installation is to install a plugin for handling the reviews.

There’s a number of plugins you can use but I recommend checking out Author hReview which is a plugin by Hesham Zebida of FamousBloggers.net.

I’ve been using the pro Author hReview plugin on a number of my review websites and also the website you’re reading now (which is what drives the rich snippets here).

It’s very easy to use and setup and once you have it setup it takes care of all the nitty gritty code bits for you.

To evaluate the plugin I recommend you check out the lite version which is in the WordPress.org plugins area.

The lite version is good for sporadic review posts, but if you’re setting up a full review website you’ll want to check out the new release that Hesham just made today which is the next step up.

Setting Up A Full Reviews Website

If you’re getting into setting up a full reviews website and you want a solution to take care of everything then you’ll probably want to check out WP Reviews (released officially today).

WP Reviews is the best way to build a rating and reviews website with WordPress, hands down.

I had a play around with it on my test website and setup a few review posts. I’ll be looking to roll this out to most of my review websites in the very near future.

Here’s a couple of screenshots of what it can do:

Big sexy review box at the top of review posts
Big sexy review box at the top of review posts

This is an example review that I made of a Premium Bird Cage product (a fake product). As you can see the plugin can output a nice big meta box at the start of your review containing all the vital information that people need at their finger tips.

There’s the review summary along with the editor rating, and you can even setup different criteria of how you rated the review which I thought was really cool.

As you can see, the WP Reviews handles taking user ratings as well which is a nice touch for review websites.

Users don’t have to be logged to rate, and the plugin even takes care of disallowing multiple clicks so they can only rate once. It does this by tracking IPs and also using cookie tokens.

It also puts a call to action button which you can alter the text and colour of.

Pros and Cons list
Pros and Cons list

When you’re adjusting the details of your review you can easily setup a Pro’s and Con’s list which is a feature many other review systems overlook.

These little pro and con boxes give your visitors a snapshot of your review without them having to read through the article straight away.

I know when I look through a review of a product for the first time I usually skip to the end to see if there is a Pro & Cons list before going back and reading through the rest of the review. The plugin lets you output this information right at the top so people can see your opinions at a glance.

Review box at end of post
Review box at end of post

Finally, at the end of your post once your visitor has finished reading through your review there’s a smaller box to sum up. This lets you remind them that they can buy the product now.

You could link this button to a product page where you sell the product itself or in many case you’ll want to hook this up to your affiliate link.

This plugin plays nicely with ThirstyAffiliates as well, my affiliate link management plugin for WordPress, I use the combo to great effect on my review websites.

Setting Up The Review Details

Actually setting up the details of your review is quite simple.

You write your review as you would any other blog post, but instead of just leaving it there there’s a new meta box underneath the main post editor that lets you fill in review information.

Once you start filling in the information it switches on the review functionality of the post and gives you all the options for outputting the review data like I’ve done for my example product above.

Review Meta Box on post edit screen
Review Meta Box on post edit screen

The interface is pretty straight forward, just go through the tabs turning on the bits you want to display for this review.

Extra Features

There’s a couple of extra features in WP Reviews WordPress plugin that are worth mentioning:

Central listing

In the lite and other versions of the previous plugin Author hReview you don’t have a main listing of all the reviews so if you have a big site like mine where there’s hundreds and hundreds of posts they can get lost if you ever need to go back and amend things.

In WP Reviews though, because it’s made for running a site that is focused on doing reviews, there is a central listing of all the reviews in the system.

Central listing of all reviews
Central listing of all reviews

Rich Snippet Testing

Link straight to rich snippet testing tool

Accessible from the central listing is a link directly to the rich snippet testing tool by Google which lets you verify your rich snippets and fix any mistakes so you can go back and adjust your review.

The rich snippet testing tool by Google shows you a preview of exactly how your review will show up in the search results. It’s nice to see how it will change when you adjust your review settings so you can really make your reviews pop when they come up in the SERPs.

Google Rich Snippet Testing Tool
Google Rich Snippet Testing Tool

 Adding Review Content To Your Review Website

As you’ve seen with this setup it can be quite simple to add reviews to your website and have all the appropriate rich snippet data generated for you along with some pretty snazzy looking user interface boxes.

Just one final word on content quality, as you can see from the following posts people, companies and even Governments are getting serious about fake reviews:

If you are thinking that building a review website filled with fake reviews is a great way to make quick money online then think again.

In all cases that I’ve had success with building review websites, they have been cases where the reviews have been written by me about products that I care about and have some knowledge about.

This personal touch actually makes the reviews stand out more and avoids any penalties that could be had from manufacturing dodgy reviews.

I highly recommend using the WordPress and WP Reviews plugin if you’re going to follow the strategy of adding reviews to your existing website or building a review website from scratch. It’s certainly the easiest way to get going with all the proper rich snippet code, it gives you maximum flexibility and looks great to boot.

Check out WP Reviews and get a 50% discount

For the launch of WP Reviews I’ve been speaking with the creator Hesham about it and he’s agreed to provide a discount coupon code for the launch period for 20% off.

In addition to this, the plugin itself is already 30% off the regular price at the moment on their website, so if you’re thinking about setting up a review site or adding a review portion to your website then I suggest grabbing a copy before 10th of June, 2013.

Use the coupon code “WPR20”

Click here to get your copy of WP Reviews with discount

Do you have any experience creating review websites or do you plan to build one? Let me know in the comments about your plans. Building review websites has been incredibly rewarding for me, I would love to hear about other people’s experience with them.