Zencart : How to add banners in the zencart
To add the banners in the zencart just follow the three steps.
1. Open the zencart database and insert one record in the “Configurations” table.
- Keep the configuration_id null(it will update automatically)
- Write the title for e.g.’Banner Display Group All pages left‘ in configuration_title. Note : This title will be displayed in the Configuration->Layout Settings on the Admin side.
- In configuration_key write the tag ‘SHOW_BANNERS_GROUP_SET10‘
Note: SET10 is the id of sets of banner. Upto SET9 all are the default banners of zencart.Update the SET no. everytime you want to add banners such as SHOW_BANNERS_GROUP_SET11,SHOW_BANNERS_GROUP_SET12 and so on….
- In the configuration_value write any value such as’left_banner2‘
Note : This value will be the group name of your banner and it will be added in the dropdown list of the banner groups when you will add the new banner from admin.
- Add any description in “configuration_description” field.
- Just write ‘19‘ in the “configuration_group_id” as 19 is the id for the banners.
- Just give the unique id for the “sort_order field” for the group_id 19.Generally start after id 75.The value must increment every time you add the new banners.
- Keep all other fields as it as and save the record.
2. On the admin side click on new banner button in the Banner Manager.
- Give the title for the banner such as New Banner.
- Give the url in url box if you want to add such as http://www.google.com
- Now select the group from the dropdown box.Your newly created group will be added there. Select it.
- Upload the image you want to display as banner and click on insert.
Your banner has been created now.
3. To display the banner in the site just copy the following code and paste it where you want to display the banner.
[php]
<?php
if (SHOW_BANNERS_GROUP_SET10 != ” && $banner = zen_banner_exists(‘dynamic’, SHOW_BANNERS_GROUP_SET10)) {
if ($banner->RecordCount() > 0) {
echo zen_display_banner(’static’, $banner);
}
}
?>[/php]
That’s it.You can see the banner now. I hope it works.
