[insert_php]
/*
*
* Lennox.com Product API v1.0 Example
* PRODUCT LISTING BY CATEGORY
*
* XML Source: https://lennox.com/api/v1/category//
*
* PHP 5 w/ XML transport
* Author: Ben Wilson (bwilson@powercreative.com)
* 2008/10/09
*
* Version 1.0 – Initial write
* Version 1.1 – Ratings and Reviews addition – 02/13/2013
*
* Note: the “allow_url_fopen” directive in your php.ini file must be
* set to “On” for this demo to work.
*/

/* replace “YOUR-API-KEY” with your Lennox Webservices/API Key */
$APIKEY = ‘HYvgukj’;

//fetch CATEGORY NUMBER from querystring ‘
if (!empty($_GET[‘cat’])) {
$category_id = $_GET[“cat”];
} else {
echo “This script requires a valid category ID.”; exit();
}

?>



Product List by Category – PHP 5 – Lennox.com API Prototype


Category) { ?>

Category ?>

SubCategory as $subcat) { ?>

SubCategoryName ?>


CategoryRatings->CategoryRating)) {
foreach ($subcat->CategoryRatings->CategoryRating as $rating) {
$columns++; ?>

Product as $product) { ?>

attributes()->EnergyStar==”Y”) ? ‘energyStar’:” ?>”>

attributes()->EnergyStar == “Y”) { ?>
ESTAR ICON

attributes()->Type)) == “SOUND”) { echo “dB”; } ?>

ContainsEnergyStar == “Yes”) { ?>
ESTAR ICON ENERGY STAR® Product

Products
  Name ?> Price
Guide*
  ReviewStats) <= 0) ? 'PadBot' : ''; echo ($j%2) ? ' Odd':' Even'; ?>” valign=”top”>

“>



[/insert_php]