Prev | Current Page 254 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"


CHAPTER 5 ?–  CREATING THE PRODUCT CATALOG: PART 2 163
Remember the StoreFront class in presentation/store_front.php, where you have a
member named $mContentsCell that you fill with different details depending on what part of
the site is being visited? When a department or a category is being visited, the department
componentized template is loaded, and it takes care of filling that space. We still haven??™t done
anything with that cell for the first page, when no department or category has been selected.
In the following exercise, you??™ll write a template file that contains some information about
the web site and shows the products that have been set up as promotions on the first page.
Remember that the product table contains a field named display. Site administrators will set
this field to on_catalog for products that need to be displayed in the first page.
Exercise: Creating the first_page_contents Componentized Template
1. Start by creating the Smarty design template file. The presentation/templates/first_page_
contents.tpl file should have these contents:
{* first_page_contents.tpl *}


We hope you have fun developing TShirtShop, the e-commerce store from
Beginning PHP and MySQL E-Commerce: From Novice to Professional!



We have the largest collection of t-shirts with postal stamps on Earth!
Browse our departments and cateogories to find your favorite!


{include file="products_list.


Pages:
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266