This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Commission Junction API for WordPress

Description

This plugin is intended as a tool for affiliate marketers to add products to their pages and posts quickly and easily. This is accomplished by means of CJ’s Product Search REST API. It provides an in post product search box, as well as a shortcode to automatically display a table of products matching a search query in a post.

NOTE: This plugin requires PHP5.

Please leave your comments and feedback here on my website so I can attend to them as quickly as I can (no guarantees, though, but I will try my best).

Special thanks to Nick Ohrn of Plugin-Developer.com, who’s Amazon plugin served as both an inspiration and a source for some of the code for this plugin.
To use this plugin, you will first have to register for an account at Commission Junction web services. Once you’ve downloaded and activated the plugin, you can enter your CJ API key (from the web services account) and your site ID (from the CJ affiliate account). Enter in your preferred settings, and you’re ready to go.

This plugin works in two different ways. The first method is the post composer search box. Go to a post/page composer/editor screen. In a box below the main composition area, you will find a search box labeled “CJ API for WordPress.” Enter in some search terms, press the “Search Products” button, and you will be given a list of results. To send one of these results to the post editor, press the “Send to Editor” button next to the product listing.

To insure the best results, be sure to read up on the the guidelines for search strings (the “keywords” parameter) in the CJ API documentation (http://help.cj.com/en/web_services/product_catalog_search_service_rest.htm)

The other method is to use a shortcode. For the shortcode, you can use the “CJ” button that will appear in the TinyMCE editor to add the base shortcode, or enter it as follows:

[cjapi keywords=””]

The keywords parameter is entered in by default, but you can select other parameters as you see fit. These parameters are displayed in the following list. For more information on these parameters, please see the API documentation once again.

List of Search Parameters

  • advertiser-ids
  • serviceable-area
  • keywords
  • lowprice
  • highprice
  • maxresults
  • sortby
  • sortorder
  • isbn
  • upc
  • manufacturer-name
  • manufacturersku
  • advertisersku
  • lowsaleprice
  • highsaleprice
  • currency

The shortcode results are cached for the time period (in seconds) set in the “Result Cache Duration” section of the parameters. After this time has elapsed, the plugin will again query the CJ API to get the latest and greatest product results.

In this same screen, the default currency, region, and advertiser relationship status’s can be set. It is highly recommended that the “Advertiser Relationship” be set to “Joined,” so that the results returned will result in sales commissions.

To format the returned product results, the result template used can be modified to suit the proper display. By modifying the ”Result Row Template” field in the plugin settings, one can display the desired parameters in the search results. This is accomplished by means of a set of template tags which are substituted for the returned values in the search query. The list below shows the available tags for modifying this template. Once again, the API docs at CJ have the details of what each parameter contains.

List of Template Tag Search Result Parameters

  • %advertiser-id%
  • %advertiser-name%
  • %buy-url%
  • %catalog-id%
  • %currency%
  • %description%
  • %image-url%
  • %in-stock%
  • %isbn%
  • %manufacturer-name%
  • %manufacturer-sku%
  • %name%
  • %price%
  • %retail-price%
  • %sale-price%
  • %sku%
  • %upc%

The “Result Row Style” parameter allows the user to style the table generated by the shortcode results. Modify the default CSS as you see fit to get the style of table that matches your own site.

FAQ

Where can I find informaiton about the search options and result fields for the product search?

You can check out the Commission Junction REST API docs

I have a feature request/bug report, where can I submit it?

You can leave any comments you might have at my CJ API plugin page on my site.

Changelog

0.1

  • Initial version, barebones feature set in place.

0.2

  • Bug fixes for advertiser status and template parsing functionality.

Contributors & Developers

This is open source software. The following people have contributed to this plugin.

Contributors

Browse the code