View Single Post
  #4  
Old 11-13-2011, 04:28 PM
  XCart4Life's Avatar 
XCart4Life XCart4Life is offline
 

Advanced Member
  
Join Date: Feb 2010
Posts: 62
 

Default Re: Manufacturer on Product List / Recommended

Ok I almost slammed my head into a wall too trying to figure this one out. Okay so here's the solution for X-Cart 4.4.4.

FORGET ABOUT PRODUCT.PHP!!! All the other posts are saying to add to that file and it doesn't do anything.

Edit:
/products.php
<---- That's products.... with a 'S' on the end

Find this at the bottom of the file:

PHP Code:
$smarty->assign('cat_products',      isset($products) ? $products : array()); 

Add this magical rare code above that line:
PHP Code:
if ($products)
    foreach (
$products as $k => $v)
$products[$k]['manufacturer'] = func_query_first_cell("select manufacturer from $sql_tbl[manufacturers] where manufacturerid = '$v[manufacturerid]'"); 

Now edit:
/skin/your_skin/customer/main/products_list.tpl (if you are using single column)
/skin/your_skin/customer/main/products_t.tpl (if you are using multi column)

Add this code where you want the manufacturer name to appear:
PHP Code:
{if $product.manufacturer ne ""}
    <
div class="brand">Brand: {$product.manufacturer}</div>
{/if} 

That makes it work on the regular category pages. But if you want it to appear on the search pages read on.


Edit:
/search.php


Find this line all the way at the bottom:

PHP Code:
// Assign the current location line
$smarty->assign('location'$location); 

Add this code above:

PHP Code:
if ($products)
    foreach (
$products as $k => $v)
$products[$k]['manufacturer'] = func_query_first_cell("select  manufacturer from $sql_tbl[manufacturers] where manufacturerid =  '$v[manufacturerid]'"); 

And that's all. This mod is free!
__________________
X-Cart Pro v4.2.2 [Win]
X-Cart Pro v4.2.3 [Win]
X-Cart Pro v4.4.4 [Win]
Reply With Quote