View Single Post
  #4  
Old 11-04-2015, 12:10 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Calling additional category as well as main category

I haven't tested this but should point you in the right direction for a bit more elegant solution.

Open include/func/func.product.php

FIND:

Code:
$product['categoryid'] = $categoryid;

AFTER ADD:

Code:
// SD - Check if product is in new category $product['is_new'] = (func_query_first_cell("SELECT categoryid FROM $sql_tbl[products_categories] WHERE productid='" . intval($product['productid']) . "' AND categoryid='384'") > 0 ? 'Y' : 'N'); // / SD - Check if product is in new category

Open include/search.php

FIND:

Code:
$products[$k]['taxed_price'] = $v['taxed_price'] = $v['price'];

AFTER ADD:

Code:
// SD - Check if product is in new category $products[$k]['is_new'] = (func_query_first_cell("SELECT categoryid FROM $sql_tbl[products_categories] WHERE productid='" . intval($v['productid']) . "' AND categoryid='384'") > 0 ? 'Y' : 'N'); // / SD - Check if product is in new category

Then in your templates on your product listings or your product details page you can use:

Code:
{if $product.is_new eq 'Y'}Show Icon{/if}
Reply With Quote