Lee Willis

January 2, 2012
by Lee
3 Comments

Sorting the list of downloadable files in WP e-Commerce

Those of you who run stores with downloadable products may well have struggled with the following problem. If you try an attach an existing file to a product (Either because the same file is supplied with different products, or you have product variants that you need to set downloads against), then you may well have run into the following:

This list is a bit of a nightmare to find the file you want. It’s not sorted by anything obvious – not name, and not date-modified as far as I can tell. Finding a file is a bit of a scroll-and-hope affair. Much better to have a nice, ordered list like this:

This is an itch I’ve been wanting to scratch for a while now, and it turns out the code is pretty simple. Just drop the following in your theme’s functions.php file and revel in the glory of a nice, ordered file list.

function site_plugin_custom_sort_function ( $a, $b ) {
  return strtolower($a['display_filename']) > strtolower($b['display_filename']);
}

function site_plugin_sort_download_list ( $download_list ) {
  // Sort the multidimensional array
  usort($download_list, "site_plugin_custom_sort_function");
  return $download_list;
}
add_filter ( 'wpsc_downloadable_file_list', 'site_plugin_sort_download_list' );

November 9, 2011
by Lee
0 comments

Capital D dangit…

Just a short post I promise.

I’m pleased to announce that I’ll shortly be joining the fabulous team over at Hydrant. If you haven’t heard of them before, they’re a growing Drupal agency with big ideas. Can’t wait!

PS. Yes, I said Drupal ;)

 

November 5, 2011
by Lee
21 Comments

Show Personalisation Info during checkout with WP e-Commerce

WP e-Commerce‘s nifty personalisation feature allows your customers to add “personalisation” information to their order – whether that’s a t-shirt slogan, a message for jewellery engraving, or maybe just text for a gift card. The default behaviour though is that the information isn’t shown in the cart – or during checkout.

If you want to do that – check out this new plugin:

WP e-Commerce Show Personalisation

Screenshots below:

August 20, 2011
by Lee
102 Comments

Product Options for WP e-Commerce

The WordPress e-commerce solution from getshopped.org already features a powerful “variations” system that allows you to have different versions of products. This allows you to set colours, sizes or other attributes that make sense for your store. It also allows those choices to affect stock availability, pricing and a whole raft of other variables.

For some store owners this is great, but for others it’s all a bit too complicated – all they need to do is let customers choose from the available options and have those choices recorded against the sale.

Welcome to the “WP e-Commerce Simple Product Options” plugin.

The plugin allows you to set up multiple “option sets” and then options within them. Then for each product you create you can choose which option sets and options customers can choose for it, and then have the customers choices recorded against the product sale.

March 28, 2011
by Lee
3 Comments

Debugging Problems with the Campaign Monitor Widgets

Some people have had problems setting up the Campaign Monitor Signup Widgets, getting the widget up, but then receiving the “Sorry, we weren’t able to sign you up.” message.

In most cases this is down to one of two issues:

  • An incompatibility of PHP version – the plugin requires PHP 5.2 or above.
  • Incorrect API details – the plugin needs to use the Account ID, and List ID, not the Client

So – these should always be the first things to check. If you’re still having problems, then the guide below explains how to see what error messages are being generated. To diagnose this you’ll need a copy of “Firefox”, and the “Firebug” extension. (Note: You can also do similar with Chrome, and its developer tools if you know your way around them instead).

To start, open the page with the widget on, and open up firebug. Switch to the “Net” panel – you should see something like this (Click for bigger version):

Submit the form, and you should see a “request” logged in the net panel – it’s an HTTP POST request – so should start with POST, like this:

Click on the + symbol to the left of the POST to see the details of the request:

Click on the “Response” to see what data the AJAX POST is outputting – the error message should give you an idea of what’s not working.

March 1, 2011
by Lee
0 comments

Adding custom post type archives to your sitemap

The snippet below is a modification to Yoast’s excellent WordPress SEO plugin to include custom post type archives to the XML sitemaps it produces. Hope you find it useful.

            $post_type_archive_link = get_post_type_archive_link($post_type);
            if ($post_type_archive_link) {
                $url = array();
                $url['loc'] = $post_type_archive_link;
                $url['pri'] = 0.8;
                $url['chf'] = 'weekly';
                $this->write_sitemap_loc( $f, $url, $echo );
            }

Just add this snippet inside wp-content/plugins/wordpress-seo/sitemaps/xml-sitemap-class.php inside the function generate_sitemap. The code should go just inside the loop through the custom post types, e.g. after this chunk:

           if ( isset($options['post_types-'.$post_type.'-not_in_sitemap']) && $options['post_types-'.$post_type.'-not_in_sitemap'] )
                continue;
            if ( in_array( $post_type, array('revision','nav_menu_item','attachment') ) )
                continue;

Once you’ve added the code – just rebuild your Sitemap by visiting Seo » Dashboard » (Re)build XML Sitemap.

February 24, 2011
by Lee
1 Comment

Always Show The Admin Bar in WordPress

WordPress 3.1 is now out and one of the most talked about features is the “admin bar”. WordPress.com users have had something similar for a while, and it seems to be one of those “love it or hate it” features. (If you’re not a fan of the admin bar – then check out Scott Kingsley’s excellent Admin Bar Disabler.)

Personally I’m a big fan of the feature, it makes the whole system just that little bit easier to use for non technical people with it’s simple menus for adding new posts, managing comments, and being alerted to updates:

However, the admin bar only shows up when you’re logged in – which means that your users have to go to login before they’ll see it. That’s fine if you tick the “Remember Me” box when logging in – but I’m not sure I’m happy to recommend to people that they stay permanently logged in.

So, one of the first things I thought of with the new feature was “Wouldn’t it be great if the admin bar was always there”.

Announcing the “Always Show The Admin Bar” plugin.

This handily ensures that the admin bar is always visible for anyone who’s previously logged into the site. It’s a neat solution for providing site editors / admins with an easy to use way to log in, while not cluttering up your site for everyday visitors with an intrusive login form.

If you like it – you should donate here:


January 11, 2011
by Lee
56 Comments

Campaign Monitor Ajax Subscription Widget for WordPress

I’m a big fan of Campaign Monitor for managing email lists and campaigns. I recently set up a list for a friend, and I agreed to put a small subscription form in his sidebar at the side of his WordPress site, but also have a dedicated page for people to visit to sign up – so that he could share the link to the page on Twitter, Facebook etc.

Now, Campaign Monitor make it pretty easy to create a sign-up form, but by default the form will take you off your original site, onto a Campaign Monitor “Thank you for subscribing” page. I wanted to see if I could improve on that a little, so, having worked with the Campaign Monitor API before for a Joomla! / Campaign monitor integration I sat down to see what we could do.

The result is the Ajax Campaign Monitor Forms plugin for WordPress.

Adding a form as a Widget

Currently it’ll let you create a widget in any of your sidebars, add in your list ID, and account ID, choose whether to show the “Name” field as well as “Email”:

The result is a mini-form in your sidebar, that submits the request via Ajax without the user leaving your site.


Adding a form inline in a post or page

You can also add a form as a shortcode to your posts and pages. Simply click on the “Campaign Monitor” button that appears above the post editor:

You’ll be asked to insert your API key details:

and a shortcode will be placed into your post to display the form:

January 3, 2011
by Lee
3 Comments

Integrating WordPress with Bing Shopping

Disclaimer: The title of this post could easily have been one of a hundred different choices – “How to push developers away from your API”, “Why Microsoft are still living in the 1990s”, “Customer Support 101″ or even “Bring Back Steve Ballmer’s Developers, Developers, Developers

A while ago, I added code to the WP e-Commerce project so that it could provide Google Merchant Centre feeds (It’s the thing that powers Google’s “shopping results”). It’s been my experience over the last few years that having an effective feed is a good source of traffic, and an avenue that’s often neglected by other e-Commerce providers – so can be a “quick win” SEO tactic.

The fact that Bing now offer something similar recently came to my attention, and it would make sense to expand WP e-Commerce’s support to include Bing Shopping feeds as well as Google Merchant Centre. So, I skim-read the integration guide to see the size of the task at hand, everything looks good (Apart from their choice of format by the way which is, erm, a bit shocking to say the least – but hey – it does the job I guess).

I signed up for an Microsoft AdCentre account (Which requires you to hand over your credit card details, despite the fact the service is free – erm….). Now, the service currently is for US stores only, and I’m in the UK. But hey, WP e-Commerce is a global product, and I know a large portion of those users are in the US – so no problem there.

So – I followed the instructions in the Integration Guide which told me to click “Bing Shopping Account Management” in my Adcentre account, but I don’t have that link. No worries – I’m sure I saw mention of a Merchant Help Forum in the integration guide – so off I headed.

At this point my suspicion was that the problem was my geography (I did contemplate lying on the registration form and entering “US” – but I played it straight and entered “UK”). So I posted the following enquiry:

Hi,

I’m looking to add support for Bing Shopping feeds to a WordPress ecommerce platform. Unfortunately while many of the users are US-based, I’m not. I’ve signed up for an adcentre account – but I don’t see Bing Shopping under “Tools” – is this because I registered with a UK address? If so – how can I get access so I can test the integration?

Thanks in advance

Short, and to the point. No official reply from Microsoft, but that’s not really surprising, but there was a helpful reply from one of the regulars letting me know that it wasn’t an issue that had cropped up before, and helpfully pointing me at a contact page for “Questions about Bing Shopping” – sounds perfect.

So – I fired off the exact same question, and 22 hours later (I don’t consider that a bad turnaround time for something like this) the following arrived as a reply from the “Bing Shopping” support team:

Hello Lee,

Thank you for contacting Microsoft Customer Service.

Based on your message, you would like to suggest to add support for Bing shopping feeds. Let me see what I can do for you today.

As a Customer Service Representative, I am here to assist you in finding the right place to get help with your questions and provide resources to resolve your concern.

Lee, for this kind of concern what may I suggest is to contact Bing Support Professional for better assistance regarding on your concern. You may contact them through this link: https://support.discoverbing.com/eform.aspx?productKey=bing&ct=eformts&scrx=1&st=1&wfxredirect=1

I hope the above information is helpful, and please contact us if you have any additional customer service questions.

Thank you,

Hm, not great. They clearly don’t understand my question, and I now have to contact a second (More generic) support team with my question.

I’m now being made to chase around different departments because Microsoft (You know, that big multi-billion dollar company) apparently can’t pass a customer support issue between teams themselves.

Also – it’s evident that the support team don’t have the right skills / knowledge / experience to answer the question. If you’re a company offering APIs to developers they need a different level of support than your end-users. You need to make sure that your support staff are sufficiently skilled and experienced for the audience they’re supporting – or that they know that it’s OK to escalate an issue if required, and the right place to send it to – not that it’s more important to close the call than actually answer the question.

The response included an invitation for feedback on how my issue had been handled. Obviously I was disappointed, and so I replied to this request for feedback, hoping that someone would take my issue on and find me the right answer:

I’d just like to register my disappointment with responses I’ve received.

I’m a UK-based WordPress developer, trying to provide an integration between one of WordPress’s leading e-Commerce system WP e-Commerce, and Bing Shopping.

I’ve read the integration guide, and am happy I can modify the software to produce a feed. I’ve signed up for a Microsoft adcentre account, but it appears I’m unable to submit feeds (Even test ones) as I’m not in the US.

I raised this as a question on the forum http://community.microsoftadvertising.com/forums/p/68015/95480.aspx and one of the forum visitors helpfully pointed me to the “Contact Us: Questions about Bing shopping” contact page which seemed to be a sensible place to get in touch (See case number quoted above).

The result was a completely unhelpful response directing me to a generic Bing contact page – to which I’ve forwarded my enquiry – but if the dedicated “Bing Shopping” contact page couldn’t get an answer to my query – I’ll be very surprised if this does.

So:

  • I’m disappointed that you seem to have no interest in supporting developers looking to drive customers to your products, based purely on their geography
  • even more disappointed in the lack of support received when I raised this with what seems like the appropriate group
  • mortified that I have to chase round re-submitting my request to various different groups

I’ll confess it’s a bit grumpy, but I think you’ll find the answer fascinating (Emphasis mine):

Hello Lee,

Thank you for contacting Microsoft North America Customer Service.

From the information you have provided in your message, I understand that you are located in United Kingdom and looking for obtaining the Windows Defender download. The Customer Service team you have reached is for North America.  There are significant differences between North American versions of Microsoft products and those localized for your country.

You will be best assisted by the Microsoft subsidiary that specializes in your version of Windows Defender. You can reach them at (+44) 0844 800 2400 or by visiting: http://www.microsoft.com/worldwide/phone/contact.aspx?country=United%20Kingdom

Wish you a very Happy and Prosperous New Year.

So, this was supposed to be “feedback” about the level of support I received. My disappointment, and areas of complaint weren’t even acknowledged (Never mind actually addressed), and I got pointed to a Windows Defender download (If anyone can explain how that could ever possibly have been the right answer to my question I’ll buy them a beer!)

But what about the request I forwarded to the generic Bing Support team? Maybe they came back with a helpful answer? …

Hello Lee,

My name is XXXXXX. Your e-mail was escalated to me and I would like to assist you with your concern on adding support for Bing Shopping feeds to a WordPress ecommerce platform. I understand the importance of your concern.

For issues and concerns on Bing Shopping UK, please contact Ciao help team at support@ciao.co.uk.

We appreciate your continued support as we strive to provide you with the highest quality service available. Thank you for using Bing.

Sincerely,
XXXX
Bing Technical Support

I’d already explained in my contact that I wanted to post information for US stores, and the forum thread I linked through covered ciao.co.uk and why that wasn’t the right area to look at.

Suffice to say I won’t be integrating with Bing Shopping anytime soon and I pity anyone who has to deal with Bing Support …

December 27, 2010
by Lee
0 comments

WordPress Classified Ads Widget

I’ve recently been doing some work with some plugins from the guys and girls over at WPMU DEV. The most recent one has been using their plugin that adds Classified Ads to WordPress. I caught the plugin just as it underwent a major upgrade from an “old-style” plugin that used custom tables to a newer version that used custom taxonomies, and custom post types.

On balance, this is a huge improvement, however a coupe of features that were in the previous version, and that I want to use on my current project went AWOL. Fortunately, because the plugin now uses standard WordPress functionality for storing its data – these are pretty easy to knock together. So – my first major need was for a widget to show “recent ads” in a sidebar. Here’s a screenshot of the widget in action:

If you want to give it a try out – you can grab it here – just install it as a standard WordPress plugin, activate it, and the widget will be available under Appearance > Widgets in your WordPress admin area.