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)
-   -   Hide related products tpl when there are none (https://forum.x-cart.com/showthread.php?t=36890)

Warwick 01-20-2008 11:38 PM

Hide related products tpl when there are none
 
Is there anybody who knows what code to use to hide/not display the related products tpl when there are no related products?

pauldodman 01-20-2008 11:49 PM

Re: Hide related products tpl when there are none
 
Have you tried:
{if $product_links eq ""}

Warwick 01-21-2008 12:05 AM

Re: Hide related products tpl when there are none
 
Problem is how to implement this, the code in product.tpl says:

Code:

{if $active_modules.Upselling_Products ne ""}
<p />
{include file="modules/Upselling_Products/related_products.tpl" }
{/if}


Not quite sure how to put the {if $product_links eq ""} in it.

Maybe something like:

---
{if $active_modules.Upselling_Products ne "" && $product_links eq ""}

<p />
{include file="modules/Upselling_Products/related_products.tpl" }
{/if}
---

But that doesn't work ...

Ene 01-21-2008 01:22 AM

Re: Hide related products tpl when there are none
 
Use:

PHP Code:

{if $active_modules.Upselling_Products ne "" && $product_links ne ""}
<
/>
{include 
file="modules/Upselling_Products/related_products.tpl" }
{/if} 


pauldodman 01-21-2008 01:34 AM

Re: Hide related products tpl when there are none
 
Just like that! I thought you had become an expert in all this by now!?!?!?

Warwick 01-21-2008 04:00 AM

Re: Hide related products tpl when there are none
 
Quote:

Originally Posted by pauldodman
Just like that! I thought you had become an expert in all this by now!?!?!?


:) Sorry, I'm an X-Adept now ... lost the eXpert ... :D

But I had an eXpert vision, the code that Eugene posted is what I mentioned before, but it doesn't work somehow :(

Ene 01-21-2008 04:03 AM

Re: Hide related products tpl when there are none
 
Quote:

Originally Posted by Warwick
:) Sorry, I'm an X-Adept now ... lost the eXpert ... :D

But I had an eXpert vision, the code that Eugene posted is what I mentioned before, but it doesn't work somehow :(


The code is different:

Quote:

{if $active_modules.Upselling_Products ne "" && $product_links ne ""}

Warwick 01-21-2008 04:07 AM

Re: Hide related products tpl when there are none
 
Thanks Eugene,

I did use your code but it doesn't work ... tried templates cleanup as well, no good I'm afraid.

Ene 01-21-2008 04:18 AM

Re: Hide related products tpl when there are none
 
Quote:

Originally Posted by Warwick
Thanks Eugene,

I did use your code but it doesn't work ... tried templates cleanup as well, no good I'm afraid.


I've checked the default X-Cart templates. X-Cart doesn't show 'Related products' section if you don't specify any upselling product.

Do you have a custom skin?

Warwick 01-21-2008 04:27 AM

Re: Hide related products tpl when there are none
 
Yes, I have a one of the X-Cart skin templates installed (Fashion Mosaic).


All times are GMT -8. The time now is 02:44 PM.

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