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)
-   -   If Satatement to remove Images (https://forum.x-cart.com/showthread.php?t=61486)

BillV 11-04-2011 01:28 PM

If Satatement to remove Images
 
I am looking to remove the thumbnail images from the Products listing. I only want the images removed if the category is "126" and the product is assigned to a manufacturer.

I have many products that are assigned to categories other that cat 126 and are not assigned to a manufacturer. For these products, I want the thumbnail to show.

I have added the following to the products_list.tpl. but it does not seem to work.

{if $cat != '126'|| $manufacturers[id].manufacturer == '0' }

<a href="{$url}">{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url}</a>

{/if}

Thank you.

JWait 11-08-2011 04:57 AM

Re: If Satatement to remove Images
 
It appears your code will do the opposite of what you want, it should display the thumbnail. To test this, just temporarily add some text to the "if" statement...

{if $cat != '126'|| $manufacturers[id].manufacturer == '0' }
TEST
<a href="{$url}">{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url}</a>

{/if}

BillV 11-08-2011 06:36 AM

Re: If Satatement to remove Images
 
Thank you. I will give it a try.

JWait 11-11-2011 05:37 AM

Re: If Satatement to remove Images
 
Try this...
{if $cat != '126'|| $manufacturers[id].manufacturer == '0' }
TEST
{else}
<a href="{$url}">{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url}</a>

{/if}

If all you see for cat #126 is "TEST" then you know the code works. You can replace "TEST" with whatever you want to do with cat #126 instead of displaying the thumbnail.

BillV 11-11-2011 07:58 AM

Re: If Satatement to remove Images
 
Thank you sir.
Much appreciated.


All times are GMT -8. The time now is 11:10 AM.

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