store.php
Previous Topic  Next Topic 

Store.php is the default storefront file for Squirrelcart. This is the page that your customers will see when shopping on your site. When your customers navigate your store, they never leave this page. Squirrelcart dynamically changes the content that the customer sees, based on the links and buttons that they click.

 

Renaming store.php

 

Although your storefront page is named store.php by default, it can be renamed. Here's how:

 

1. Rename File

 

Rename the actual store.php file to your new name. The file must still end in ".php". If you name it "index.php", it can take the place of your main index file, and become your homepage.

 

 

2. Update config.php file

 

You will need to tell Squirrelcart the new name of your storefront page. This is done by changing the "$cart_page" variable in your "squirrelcart/config.php" file. Open it in an HTML editor, and change it from "store.php" to your new file name.

 

 

Customizing

 

Customizing the store.php file requires that you have working knowledge of HTML. We will go through each line of PHP code in the store.php file below, and explain exactly what it does. In the examples below, the HTML is depicted in gray, and the PHP code is depicted in green. The explanations are in red, and apply to the PHP code displayed in green directly below. We will not discuss the HTML tags. If you are unfamiliar with them, we suggest you purchase a good reference book on HTML.

 

Overview of PHP code in store.php file

 

The line below includes your config file. It must always be the first line. 

<? include "/PATH/TO/YOUR/WEBROOT/squirrelcart/config.php";?>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
<html>
<head>
<title>Squirrelcart Demo Store</title>

 

The line below includes the stylesheet for the store. You should not move this line. It needs to be inside your <head> tag, as it is in this example. Modifying this file is discussed in the CSS Stylesheet topic, in the "Customizing : Themes" section.

<? stylesheet("store.css"); ?>
 
</head>
<body>
<div align="center">
<table width="800" border="0">
<tr>
<td valign="top" width="150" style="padding-top: 3">

 

The line below displays the navigation that appears on the left of the storefront. The design of this is controlled by the "window.php" template. 
For more info on templates, see the templates section.

<? eval(content_container("Left Navigation"))?>
 
</td>
<td width="100%" valign="top">
<table width="100%">
<tr>
<td class="content" style="padding: 0">
<img src="images/sc_logo_80_percent.jpg" alt="Squirrelcart">
<img src="images/demo_store.jpg" alt="Demo Store">
</td>
</tr>
</table>

 

The section below adds the contents of the page "home.php" if someone accesses your store.php page for the first time, before clicking on any links. For example, if they go to http://yoursite.com/store.php, they will see the contents of home.php in this section. If they click a link to view something in the cart, they will not see this section. Instead, they will see the section below the "} else {" part of the code. The home.php file is discussed in detail in the next topic.

<?
if ($SESSION['show_home_page']) {
include "home.php";
} else {
?>
 
<table width="100%" border="0">
<tr>
<td style="padding-bottom: 3; padding-top: 0">

 

The line below shows "bread crumb" navigation. These are links to previous pages that you have been to, in this format:
Page 1: Page 2: Page 3... They only show up when viewing products.

<? include "$cart_isp_root/crumb_navigation.php" ?>

 
</td>
</tr>
<tr>
<td class="content">

 

 

The section below displays the main content section of the cart. This is where the products are displayed, where checkout occurs, and all other major functionality of the cart takes place 

<? include "$cart_isp_root/cart_content.php"?>

 
</td>
</tr>
</table>

 

The line below ends the section that displays only when the customer has clicked on a link on your store.php page, which began with the line "} else {" above. 

<? } ?>

 
<br>

</td>

<td valign="top" width="150" style="padding-top: 3">

 

The section below displays the right hand navigation, which by default will display a preview of the category you are viewing, your top ten best selling items, etc.... 

<? eval(content_container("Right Navigation")) ?>

 
</td>
</tr>
</table>
</div>
 

The section below displays a link back to Squirrelcart, which can be customized in your store settings. 

<? squirrelcart_link() ?> 

 
</body>
</html>

 

The section below should not be modified, and should always be at the bottom of this page.

<? 

// session variable storage....do not remove or move this section! it must be after your closing HTML tag
$HTTP_SESSION_VARS['sc'] = $SC; 
?>