View Single Post
  #3  
Old 11-04-2015, 11:31 AM
  McGuireArmyNavy's Avatar 
McGuireArmyNavy McGuireArmyNavy is offline
 

Member
  
Join Date: Oct 2013
Posts: 29
 

Default Re: Calling additional category as well as main category

I know it's been a while, but since this is the thread that showed up while I was searching for this, I will post my solution here.
I'm sure that someone more experienced has a more elegant solution, but here is what I did in 4.6.4
[edited to add] On /product.php, around line 89 [end edit]
after
PHP Code:
if ($cat 0) {
    
$is_product_cat func_query_first_cell("SELECT productid FROM $sql_tbl[products_categories] WHERE productid='$productid' AND categoryid='$cat'");

I added:
PHP Code:
$sec_cat func_query("SELECT categoryid FROM $sql_tbl[products_categories] WHERE productid='$productid' AND main='N'");
$smarty->assign('sec_cat'$sec_cat); 

Then, on the product page (/common_files/customer/main/product.tpl around line 50) i put this
Code:
{foreach from=$sec_cat item=sub} {if $sub.categoryid eq "???"}<p>LOREM IPSUM</p>{/if} {/foreach}
obviously replace ??? with the categoryid you're looking for, and the LOREM IPSUM paragraph with whatever you want to show on the page.
__________________
X-Cart Gold 4.6.4
www.mcguirearmynavy.com
Reply With Quote