Wiki

New Case Case Status
Log In

Wiki

 
Using DS from an existing PHP …
  • RSS Feed

Last modified on 7/2/2010 7:59 AM by User.

Tags:

Using DS from an existing PHP script

You can display a Price Box from  existing PHP pages you may have by using the PHP client library found in the 'extra/apiclient' folder. See the example 'index.php' file in that folder for an example. This has just two PHP lines!

Firstly :

require_once 'dsapic_lib.inc';

this includes the PHP client stuff (assumes this file is copied out the extra/apiclient folder to the site you are integrating DS with) and then :

dsapic_pricebox('http://example.co.uk', 'apple banana +pear | min_price=10 max_price=100', 'myref', 'Apple Banana');

makes the actual request to display a pricebox.

The first parameter is the URL to your DS installation, the second is your DS query in 'shortcode' format, the third parameter is any click reference you want to pass and the last parameter is the search string to use for the Amazon API.