Separate Category Tree and Product Listing Areas
|Top Previous Next|
The category tree and product listing area of the catalog may be inserted into PHP pages as separate components. An unlimited number of unique catalog pages with different file names may be created using this method.
Custom Catalog Page Layout
The category tree and product listing areas can be placed separately within each web page.
The product listing area can be included separately...
...and the category tree can be included separately.
PHP tags are used to include the product listing and/or category tree as separate components within local web pages. The includes will work in files ending with .php extension.
Include the Product Listings
Include the following PHP code in the source code for the body of the page where the product listings are to appear. Change the parameters as instructed.
$search = "find.html"; $categories = "off"; $catalog = "shop.html"; include "catalogue.php";
The include catalogue.php"; parameter must point to the catalogue.php script, which is in the directory where AShop V is installed. If this new page is in the same directory as catalogue.php, set it as shown above. If catalogue.php is in a different directory, set the path accordingly. For example, "../catalogue.php" (to go up one directory) or "store/catalogue.php" (to go down to a specific directory).
Set the $catalog parameter to the same page (where this PHP include is located) or to a different page where catalogue.php is also included with this method.
Show or Hide Category Tree (Within Product Listing Area)
Search Box Options
$search = "off"; $categories = "off"; $catalog = "shop.html"; include "catalogue.php";
IMPORTANT! For search results to appear in the same catalog page, an if statement must be added in the php code.
$search="shop.html"; $categories = "off"; $catalog = "shop.html"; if (!$searchstring) include "catalogue.php"; else include "search.php";
Include the Category Tree
Include Category Tree In Catalog Page
Include the category tree in the same page where catalogue.php is included by inserting this PHP tag into the page.
Include Category Tree In Site Navigation
The category tree may be included in site navigation by adding a catalogue.php="shop.html" parameter. This parameter points to the page where the product listings are to appear. For example, when the category tree is in a page that does not have any way to show products and a category is selected, the product listings for that category need a place to appear in a page. In these examples the product listing page is shop.html. Change this to match the actual product listing page(s) in your site.
Insert the following php statement to include the category tree in a page where the catalogue.php include is NOT present in the same page. IMPORTANT! The $catalog variable must precede the categories.inc.php include in this php statement.
<?php $catalog = "shop.html"; include "includes/categories.inc.php"; ?>
This example will make all links in the category list open in the shop.html page. Change the $catalog= variable to match the actual page in the site. The page that the catalog= variable points to must either be catalogue.php or it must have the catalogue.php include in the page so that the product listings (for the selected category) will appear in the body of the page.
To include the category tree in a subdirectory below the directory where AShop is installed, add a chdir(""); parameter.
Example 1: Category include is in a page one directory below the AShop root.
chdir("../"); $catalog = "../shop.html"; include "../includes/categories.inc.php";
Example 2: Category include is in a page above the "ashop" directory.
chdir("ashop"); $catalog = "ashop/shop.html"; include "ashop/includes/categories.inc.php";
Web Sites That Use Frames
The separate category tree and product listing includes can be used in frames, but the Continue Shopping button and the Check out and View cart pages will NOT work when located in a different frame. Frames are not supported by our technical service.