User guide

Installation & Setup 23
AShop Software © Copyright 2002 - 2010
This will show only the customer profile links:
<?php
// Show shopping cart buttons...
$layout = 6;
include "includes/topform.inc.php";
?>
Displaying the product list or search results
The catalogue.php script shows the list of products for a selected category while the search.php script
shows the results of a search. They can either be used standalone or as part of a modular storefront
script. To use them in a storefront script add the following code:
<?php
// Show product list or search results...
$topform = "off";
$categories = "off";
if($searchstring) {
$search = "index.php";
include "search.php";
} else {
$catalog = "index.php";
include "catalogue.php";
}
?>
By adding the line: $topform = "off", the output will not include a box at the top of the list, with a search
field, the subtotal of the shopping cart contents and the View Cart/Checkout buttons.
By adding the line: $categories = "off", the output will not include a categories list to the left of the
products/search results. Use this if you want to place the categories using the categories list module
instead.
The $search parameter must be set to the filename of the script that shows the search results and the
$catalog parameter must be set to the filename of the script that shows the product list. Both should be
set to "index.php" when you use the default storefront script.
Using Custom Modules
The storefront script can of course show any other module or dynamic content you want to use. As an
example of this the default index.php script includes a SimplePie RSS reader, which can show news
feeds from an external site or even article links from your own blog. This is the code that runs this script:
<?php
// Demonstrates how to include a news feed reader on your storefront...
$feedurl = "http://www.ecommercetimes.com/perl/syndication/rssfull.pl";
include "includes/simplepie.inc.php";
$feed = new SimplePie();
$feed->set_cache_location("./updates");
$feed->set_feed_url($feedurl);
$feed->init();
if ($feed->data) {
$items = $feed->get_items(0,5);
foreach($items as $item) echo " &nbsp;<img src=\"images/bullet.