Managing special offers
Publishing special offers is a good way to decorate your online storefront:

Special offers with bright pictures will surely catch your visitors' attention.
Publishing and managing special offers is easier than you can imagine. To do this we only have to maintain a list of products which will appear in the special offers list. This list can be stored in a single table with following structure:

offerID is a primary key which identifies special offer entry.
productID refers to a certain product from PRODUCT table.
sort_order indicates position of this entry in the special offers list shown to customers in storefront.
To add a product to the special offers list we click
link in the "Categories and products " department of administrative area.
It brings the page
admin.php?dpt=catalog&sub=special&new_offer=[productID]
(where [productID] is ID of the product which we are adding to the special offers list) and executes following PHP code (includes/admin/sub/catalog_special.php)
|
That is all. The product has been added to the special offers list and will now appear in the storefront homepage highlighted products.
Presenting special offer products in both back end and storefront homepage can be done by fetching a list of these products using following SQL query:
SELECT productID FROM `SPECIAL_OFFER` ORDER BY sort_order;
and then fetching each product information from this list:
SELECT name, Price FROM `PRODUCT` WHERE productID=$each_productID_from_the_previous_query;



0 comments:
Post a Comment