How to get a users Roles and how to list all WordPress roles in PHP

This code is handy if you want to find out a users role/s. You could expand it and check if a user has a given role or similar. $user_info = get_userdata(2152); echo ‘Username: ‘ . $user_info->user_login . “\n”; echo ‘User roles: ‘ . implode(‘, ‘, $user_info->roles) . “\n”; echo ‘User ID: ‘ . $user_info->ID . … Read more

Plugins that can help to increase sales and conversions in Woocommerce 2017

automating sales in Woocommerce

There are many great plugins that can help to increase sales in Woocommerce in this blog post I’m going to talk about 2 very effective plugins in this space: AutomateWoo and SumoMe .   AutomateWoo for increasing sales in Woocommerce AutomateWoo has a lot of great features that can be setup to work automatically based on certain triggers, … Read more

How to do Ajax in WordPress

updated 10th Jan 2018 Write a javascript function to trigger the ajax call jQuery(‘#button_or_something’).on(“click”, function() { jQuery.ajax({ url: ajax_object.ajax_url, data: { action: ‘like_or_not’, /* this is appended to add_action on server side */ id: ’99’ }, type: ‘GET’, success:function(response){ //alert(‘back from ajaxe ‘+response); /* if you want to update something based on the response text … Read more

Woocommerce – Converting grams to kilograms ( product weights)

If your using product weights in Woocommerce, you might find you want to change from grams to kilograms at some stage. There are 2 parts to this: Part 1: Firstly in wp-admin you need to change a setting on the Woocommerce (below). However this doesn’t automatically convert grams to kilograms. Part 2: Converting existing products … Read more

How to speed up Woocommerce (and WordPress)

  Speed tuning in WordPress and Woocommerce This post contains details of how to supercharge your WordPress website. Here are some speed tuning tips for getting your Woocommerce store loading quickly and keep customers on your site (slow loading = loss of customers). Check file load times In firebug look at the console requests (eg … Read more