Shop - Browse Category
On the left side of the shop pages we show the category list. When the customer clicks on a category on the left side she can see all products in that category. The shop main page include this navigation from include/leftNav.php and as mentioned before, the one responsible to get the list of categories for this navigation is the formatCategories() function in library/category-functions.php In summary here is what formatCategories() do :
This function is actually a bit too complex for handling two level deep categories. However in the future i want this shop to handle categories more than two level deep so i made this function so it can cope with that. Okay, let's not talk about this function too much and move on with the code for leftNav.php Source code : include/leftNav.php <?php
if (!defined('WEB_ROOT')) { exit; } // get all categories // format the categories for display // for second level categories we print
extra spaces to give
The categories are printed as unordered lis ( <ul> ). I guess you already know that unordered list usually shows up like this :
But thanks to CSS ( Cascading Style Sheet ) we can alter how the browser display the list and give them than boxy look. I must admit that i'm a beginner to css and i learn this from projectseven.com, so if you want to know how the css works you can visit the site later. Next up is the product browsing. |
| cheap professional Commercial carpet cleaning here | Personalized debt consolidation plans | |
|
|
Online Shop - Main Page | PHP MySQL Shopping Cart Tutorial : Online Shop - Browse Category | Online Shop - View Product List |
|
At long last i'm finally able to update this site. Now the shopping cart can handle payment through paypal. As always you have any critiques, questions, comments or problems about this tutorial please tell me. Click here to send your feedback. And if you like this tutorial please link to this site. It will really help a lot :-) |
PHP MySQL Shopping Cart Tutorial
Copyright © 2005 - 2010 www.phpwebcommerce.com