A free sidebar widget based on the Affiliate Window V3 API

I’ve just written a sidebar widget that sits in your WP sidebar and displays 5 products based on a custom field called ‘sidebarquery’

You can see it in action at the bottom right of this page (ignore the sony walkman widget, as thats not Awin, thats POR), the custom field has the keywords ‘ipod nano’ in it, and as you will see, it does what you’d expect of it.

You simply download the zip file, then upload the folder within it to your plugins directory, then activate it, set the parameters (currently just your awin ID and your API password),

sidebar panel

sidebar panel

drag the widget to whichever sidebar you want to use it on, then add a custom field ‘sidebarquery’  to each post with the keyword/s you want

Download it here


This is protected content.

Comments

29 Comments on A free sidebar widget based on the Affiliate Window V3 API

  1. gadget on Wed, 14th Oct 2009 3:34 pm
  2. Brilliant. Simply brilliant. Thank you.

  3. basu on Wed, 14th Oct 2009 4:05 pm
  4. I can’t find the link to download!

  5. basu on Wed, 14th Oct 2009 4:10 pm
  6. Sorry, I have found, but look like this is only a part of full working application :(

  7. apimonkey on Wed, 14th Oct 2009 4:32 pm
  8. I don’t know what you mean, it works as a standalone sidebar widget, thats what it is, thats all it is. :)

  9. mansolo on Thu, 15th Oct 2009 3:43 pm
  10. Hi,

    Just tested on 2.8.4 and got an error message -

    ‘Invalid argument supplied for foreach() in home/…../public_html/…../wp-content/plugins/awinsidebar/freesidebarwidgets.php on line 124

  11. apimonkey on Thu, 15th Oct 2009 6:12 pm
  12. Hi, what was/were the keyword/s that you used?

  13. mansolo on Fri, 16th Oct 2009 7:04 pm
  14. shoes

  15. apimonkey on Fri, 16th Oct 2009 7:14 pm
  16. Have you enabled the V3 in your Awin interface, or, have you enough quota?

  17. mansolo on Fri, 16th Oct 2009 7:18 pm
  18. oops!

    I’ll try again later & let you know how I got on.

  19. hicliner on Mon, 19th Oct 2009 1:58 pm
  20. I have enabled V3 and used the V3 API password in AWIN
    But nothing tried numerous words etc. Any suggestions?

  21. apimonkey on Mon, 19th Oct 2009 2:05 pm
  22. Hi hicliner, have you checked this on a post in your blog (the products won’t show on the homepage)

  23. gadget on Fri, 23rd Oct 2009 12:08 pm
  24. @Mansolo.
    I get that error message when I’ve run out of Quota – are you still on 500 or have you exceeded your limit?

  25. mansolo on Sun, 25th Oct 2009 11:05 am
  26. Thanks for you comments gadget,

    checked SW V3 Communiity in AW

    Remaining operations:
    500

    Checked constants.inc.php variables again & OK
    Also generated a new password but same error.

    Fault may be with AW.

  27. mansolo on Mon, 9th Nov 2009 7:26 pm
  28. Hi,

    Glad to report that the sidebar widget now works – no idea why it suddenly started to work but it does.

  29. apimonkey on Mon, 9th Nov 2009 7:37 pm
  30. Thats both bizarre and good news, I assume you didn’t change anything.

  31. kiddaclo on Sat, 14th Nov 2009 10:14 am
  32. Hi,

    Great Plug-in!

    One thing, it’s showing fine in all my posts and category pages but not on my homepage. Any ideas?

    Cheers.

  33. apimonkey on Sun, 15th Nov 2009 12:25 pm
  34. Hi Chris, it’s designed not to show on the homepage, however, if you want to show product on the homepage, then adjust the code like so:

    On or about line 103 in freesidebarwidgets.php change this line

    if ($thissidebarquery<>” and !is_home()) {

    to this

    if ($thissidebarquery<>” ) {

    I can’t really remember why I didn’t have product showing on the homepage, but, theres the fix.

    Tony

  35. kiddaclo on Mon, 16th Nov 2009 8:14 pm
  36. Hi Tony,

    That’s great, thanks for the fix.

    I also wanted the widget have a single title sitewide, I don’t really know php very well but can’t help messing! I had a look in the code and just changed it to this:

    echo $before_widget;
    $clo .= ‘Widget Title’;
    echo $before_title. $clo. $after_title;
    foreach($oResponse->oProduct as $details){

    It seems to all work ok, is there a problem doing it like this?

    Chris.

  37. apimonkey on Mon, 16th Nov 2009 8:38 pm
  38. Chris, this site is all about diving into the code, thats why I don’t encode or lock it.

    As you have seen, there are the $before_title and $after_title variables which change depending on your themes sidebar styling, so creating another variable to hold your title is fine, although, I would just insert the title like this:

    echo $before_title. ‘Widget Title’. $after_title;

    I know it’s just one variable, but, if it’s not going to be re-used, then there’s no need to set the variable. (good coding practice)

    Tony

  39. Shrewdie on Wed, 25th Nov 2009 6:15 pm
  40. I have a website on V2 but have the coding to upgrade to V3, which has been fully tested. I havent done that as yet because there is no difference (V3 might load marginally quicker) between both versions as far as I’m concerned as I don’t use any of the templates etc.

    Is there anyway I could get the carousel to work say on a blank html page using V3 API password etc – if it could work there it could be added to my site.

  41. apimonkey on Wed, 25th Nov 2009 6:43 pm
  42. The carousel? You mean this page? Carousel I’ll get round to updating it to work with V3 at some point, so much code, so little time :)

  43. stalkio on Tue, 12th Jan 2010 8:57 pm
  44. You’re a genius. Thank you!!

  45. simonok on Wed, 17th Mar 2010 10:40 pm
  46. Where is the download? where it says download its not a link?

  47. simonok on Wed, 17th Mar 2010 11:46 pm
  48. sorry found it!

    Great work, Any chance you can advise me how to make this work outside the widget structure, I don’t use widget’s

    Would be nice to be able to add it to a blog post.

  49. apimonkey on Thu, 18th Mar 2010 1:49 am
  50. It’s a widget, so, it won’t work outside the widget structure. There is a commercial version available for £23 which is a fully featured wordpress plugin

    http://www.wpaffiliateplugins.com/index.php/about/affiliate-window-wordpress-plugin/

  51. simonok on Thu, 18th Mar 2010 8:02 am
  52. That looks wicked, just what I’m after, I’ll but that when I get home tonight. Thank you.

  53. simonok on Thu, 18th Mar 2010 8:03 am
  54. Buy it rather.

  55. Fi on Fri, 14th May 2010 11:00 am
  56. Hi! Is this free plugin still available – cannot locate the download link. Thanks. Fi

  57. apimonkey on Fri, 14th May 2010 11:20 am
  58. Hi Fi, yes, it’s here: Awin API Sidebar Widget The download link is just above the comments on this page :)

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.