X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Featured products: Disabled on some pages (https://forum.x-cart.com/showthread.php?t=14835)

mikalou 06-27-2005 01:45 PM

Featured products: Disabled on some pages
 
I would like to disable featured products on static pages that I've created and on built-in pages like the Terms & Conditions and Privacy Policy page but at the same time I dont want to disable it on pages like the home page, product, or category pages.

I cant seem to track down where this can be done. :-k Anybody? :D

balinor 06-27-2005 06:17 PM

Unless you have changed something, the featured products already work this way. They display on whatever category/sub-category you add them to in the 'Categories' section of your admin area, but don't display on the help pages, static pages or any pages that you have not added them to.

mikalou 06-28-2005 10:19 AM

After further checking into this problem, I discovered that you're right. I did change something that allowed the featured products page to be displayed on all pages.

Here's what I did to accidentally create the problem and then solve it, in hopes that my plunder will help someone else: :D

Last week, I edited customer/home.tpl, so that the placement of my featured products was displayed more near the center of the home.php page. To accomplish this, I simply moved the following line of code:
{include file="customer/main/featured.tpl" f_products=$f_products} further up. However, the new location of this code effectively placed it outside of the conditional statement: {if $main eq "catalog" and $current_category.category eq ""}
which caused my problem of having the featured products being displayed on all pages.

To solve the problem, I simply surrounded the featured products code with the conditional.
{if $main eq "catalog" and $current_category.category eq ""}
{include file="customer/main/featured.tpl" f_products=$f_products}
{/if}

Doing this seems to have corrected the problem. Thanks for pointing this blind man in the right direction.


All times are GMT -8. The time now is 05:17 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.