View Single Post
  #9  
Old 04-21-2011, 04:17 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Adding a link to category from product listing

1. create a new Smarty modifier plugin -> "include/templater/plugins/modifier.getcatnamebyid.php" with the following content:
PHP Code:
<?php

if (!defined('XCART_START')) { header("Location: ../../../"); die("Access denied"); }  

function 
smarty_modifier_getcatnamebyid($categoryid) {  
        global 
$sql_tbl

        
x_load("category");

        
$category func_get_category_data($categoryid);

        return isset(
$category["category"]) ? $category["category"] : "";


?>

2. add something like this:
Code:
{$smarty.get.cat|getcatnamebyid}

into the "skin/common_files/customer/main/product.tpl" template.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote