Quote:
Can somebody help me to use If condition to hide a category thumbnails, but only if category name is called for example: LED diodes?
|
Open up subcategories_t.tpl (located in /skin/common_files/customer/main)
Find the following code (Around line

:
Code:
{if $subcategory.is_icon}
<a href="home.php?cat={$subcategory.categoryid}"><img src="{get_category_image_url category=$subcategory}" alt="{$subcategory.category|escape}" width="{$subcategory.image_x}" height="{$subcategory.image_y}" /></a>
{else}
<img src="{$ImagesDir}/spacer.gif" alt="" width="1" height="{$subcat_img_height}" />
{/if}
and replace it with the following:
Code:
{if $subcategory.is_icon}
{if $subcategory.category NEQ "LED diodes"}
<a href="home.php?cat={$subcategory.categoryid}"><img src="{get_category_image_url category=$subcategory}" alt="{$subcategory.category|escape}" width="{$subcategory.image_x}" height="{$subcategory.image_y}" /></a>
{/if}
{else}
<img src="{$ImagesDir}/spacer.gif" alt="" width="1" height="{$subcat_img_height}" />
{/if}
So basically, if the current subcategory is not called "LED diodes" then display the image.
Quote:
Other if statement I want to use is for home page featured products. I want to rename it to New Products, but only at home page. For all other pages I wan to leave it as Featured Products. Any idea?
|
If it's only for the homepage then yes...
The featured products section is driven via customer/main/featured.tpl
If you make a copy of the file and call it something like featured_home.tpl and make the custom changes you want here.
Then amend customer/main/welcome.tpl (Which is the site's frontpage) to include featured_home.tpl instead of featured.tpl.
HTH
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4
Chamber Internet - Lancashire, United Kingdom
http://www.chamberelancs.co.uk