• Integer vitae nulla!

    Integer vitae nulla!

    Suspendisse neque tellus, malesuada in, facilisis et, adipiscing sit amet, risus. Sed egestas. Quisque mauris. Duis id ligula. Nunc quis tortor. In hendrerit, quam vitae mattis interdum, turpis augue viverra justo, sed semper sem lorem sed ligula. Curabitur id urna nec risus volutpat ultrices....

  • Suspendisse neque tellus

    Suspendisse neque tellus

    Suspendisse neque tellus, malesuada in, facilisis et, adipiscing sit amet, risus. Sed egestas. Quisque mauris. Duis id ligula. Nunc quis tortor. In hendrerit, quam vitae mattis interdum, turpis augue viverra justo, sed semper sem lorem sed ligula. Curabitur id urna nec risus volutpat ultrices....

  • Curabitur faucibus

    Curabitur faucibus

    Suspendisse neque tellus, malesuada in, facilisis et, adipiscing sit amet, risus. Sed egestas. Quisque mauris. Duis id ligula. Nunc quis tortor. In hendrerit, quam vitae mattis interdum, turpis augue viverra justo, sed semper sem lorem sed ligula. Curabitur id urna nec risus volutpat ultrices....

Sunday, 27 February 2011

Bringing Product Catalog to Customer

Bringing products catalog to customers

Presenting products catalog to customers is much like presenting products and categories in back end.

To navigate in products catalog customer can use a category tree:

When clicking a certain category link,

customer is directed to

index.php?categoryID=X

where X is the integer ID of the catego- ry, e.g. 5. Script should perform following operations if categoryID parameter is passed:

  1. Validates categoryID parameter value and transforms it to an integer number to avoid SQL injections vulnerability. More about your store security .
  2. Searches for a requested category in the database.
  3. If category was not found in the database, visitor is redirected to storefront homepage (index.php).
  4. If category was found, visitor is shown a list of products within selected category with the ability to order certain products.

A list of products within current category can be easily fetched from the database using following SQL query:

SELECT * FROM `PRODUCT` WHERE categoryID = `$current_categoryID`;

Clicking a certain product link brings visitor detailed product information page - index.php?productID=XX.
XX indicates unique integer ID of the product.
Just like with the category, script should validate productID parameter value, search for a product in the database, and then fetch all required information from the database and present it to visitor:

Clicking "Add to cart" button will add this product to customer's shopping cart.

0 comments:

Post a Comment