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 Question (https://forum.x-cart.com/showthread.php?t=34925)

hoosierglass 10-25-2007 06:04 PM

Featured Products Question
 
Is there a way to turn off featured products from showing up on the main page and the categories page when there are no items that are added to the featured products?

I want to do this without commenting it out of the home.tpl if possible. If not then I guess I will comment it out.

pauldodman 10-26-2007 01:21 AM

Re: Featured Products Question
 
If you have no featured products in admin, then by default nothing is going to show up anyway.
If you don't have any featured products, what are you getting to show up???

hoosierglass 10-26-2007 03:19 AM

Re: Featured Products Question
 
The featured products menu with menu box title and contents of "There are no featured products."

chamberinternet 10-26-2007 03:45 AM

Re: Featured Products Question
 
The message is displayed via the language variable {$lng.txt_no_featured}

If you just comment that message out from featured.tpl... then it wont be shown.

This way featured products will be displayed if you have products assigned, else no message will be displayed.

Regards

Shafiq :sK

hoosierglass 10-26-2007 03:58 AM

Re: Featured Products Question
 
What I am trying to do is not even show the featured items menu box. I didn't know if there is a way to shut it down without commenting it out of the home.tpl file. Like best sellers can be turned on or off, I just wanted to know if featured items menu can be turned on and off.

chamberinternet 10-26-2007 03:59 AM

Re: Featured Products Question
 
Well it's not a module like bestsellers, so i guess you can only comment it from the code.

Unless someone here has a better idea ?

chamberinternet 10-26-2007 04:02 AM

Re: Featured Products Question
 
Thinking about it now .. It might be worth the guys @ XC to convert it as a module in a future release, so it can be enabled/disabled easily

Comments ?

Shafiq :sK

balinor 10-26-2007 04:11 AM

Re: Featured Products Question
 
You just need to move the {if} statement around a little:

Replace this:

Code:

{capture name=dialog}
{if $f_products ne ""}
{if $total_pages gt 2}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
{include file="customer/main/products.tpl" products=$f_products featured="Y"}
{if $total_pages gt 2}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
{else}
{$lng.txt_no_featured}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra='width="100%"'}


with this:

Code:

{if $f_products ne ""}
{capture name=dialog}
{if $total_pages gt 2}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
{include file="customer/main/products.tpl" products=$f_products featured="Y"}
{if $total_pages gt 2}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
{else}
{$lng.txt_no_featured}

{/capture}
{include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra='width="100%"'}
{/if}


hoosierglass 10-26-2007 07:55 AM

Re: Featured Products Question
 
That was quite an interesting effect Balinor!

That put the featured items menu above the head template and in the center main of home where featured products go it just gave the text label for no featured products.

I do appreciate the effort though.

balinor 10-26-2007 08:13 AM

Re: Featured Products Question
 
Huh? Just meant update customer/main/featured.tpl, not moving things above the head template!

hoosierglass 10-26-2007 08:52 AM

Re: Featured Products Question
 
That is all I did and then the featured menu bar with title dialog appeared at the top of the screen on customer side and the txt label for no featured products appeared below the welcome text.

balinor 10-26-2007 09:38 AM

Re: Featured Products Question
 
So you moved the initial {if} statement to the top, and the closing if under everything? That sounds like you didn't move one or the other...

hoosierglass 10-26-2007 11:19 AM

Re: Featured Products Question
 
I cut and pasted what YOU posted. :-)

MoonDog 10-27-2007 09:31 PM

Re: Featured Products Question
 
I think the {else} statement might be giving you the problem.

Just remove
Code:

{else}
{$lng.txt_no_featured}

from Balinor's code and then it should be working fine.

- MoonDog -

hoosierglass 10-29-2007 04:53 AM

Re: Featured Products Question
 
Good catch MoonDog! That worked like a charm.

The shocker is finding Balinor is faulable!

Seriously thanks for all the help from everyone.
Mike

balinor 10-29-2007 04:56 AM

Re: Featured Products Question
 
Hey I'm only human...sorry for the error.

MoonDog 10-29-2007 05:33 PM

Re: Featured Products Question
 
hoosierglass,

Glad you got it working.

Quote:

The shocker is finding Balinor is faulable!

Actually he's not. I remembered this {if} , {else} code from one of his posts.
I think it's post #13,684...; no wait that's not it. It's post #16,834....; No not that one either. It's ..........:-)

Seriously speaking though, when I go on the forums I also open up a blank text file. When I see code I like or that I may be able to use, I cut and paste it to my text file. I now have quite a few text files on my drive with copied code. Since I'm new to x-cart I play around with the code I copied and see what it can do. I would say that about 80% of the code I copied was posted from Balinor. Thanks Balinor.

- MoonDog -

Still looking, post #11,582.......mmmm.....post #15,721?.....

YBA 11-23-2007 03:21 AM

Re: Featured Products Question
 
Hello

I am trying to do the same thing - ie remove the featured products from the home page.

Which tpl file do I need to edit? Is it /customer/main/featured.tpl


All times are GMT -8. The time now is 01:12 AM.

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