Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Display Manufacturer Name on Products Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-08-2010, 07:09 AM
 
jvolvovski jvolvovski is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 46
 

Default Display Manufacturer Name on Products Page

Hi,
I am trying to show the Manufacturer name (and link to the manufacturer) on the products pages.

In the products_t.tpl adding
Code:
<a href="manufacturers.php?manufacturerid={$product.manufacturerid}">{$product.manufacturer}</a>
doesn't produce any results.

If I put the same code in the product.tpl page, it displays the manufacturer correctly.

Any ideas how I can add it to the products page? Is there something missing from the php file?

Thanks,
Jenny
__________________
Version 4.3.2
Reply With Quote
  #2  
Old 11-08-2010, 07:45 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Display Manufacturer Name on Products Page

Manufacturer name may not be included in the products array on that page. You can look in the debugger what's available. If it's not included products.php must be modified to include manufacturer
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 11-08-2010, 07:48 AM
 
jvolvovski jvolvovski is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 46
 

Default Re: Display Manufacturer Name on Products Page

How would I go about including it in the array?

It seems that - {$product.manufacturerid} is included, just not the Manufacturer name.

Thanks,
Jenny
__________________
Version 4.3.2
Reply With Quote
  #4  
Old 11-10-2010, 04:05 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Display Manufacturer Name on Products Page

You will have to edit a php file for that, most likely include/search.php
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 11-10-2010, 04:08 PM
 
jvolvovski jvolvovski is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 46
 

Default Re: Display Manufacturer Name on Products Page

Do you know what I need to add to the php file? Any specific instructions would be appreciated.
__________________
Version 4.3.2
Reply With Quote
  #6  
Old 11-10-2010, 04:15 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Display Manufacturer Name on Products Page

BACKUP FIRST. THIS IS NOT TESTED.

Try adding this in products.php just before
$smarty->assign("cat_products", $products);

if (!empty($products)) {
foreach ($products as $k=>$v)
$products[$k]['manufacturer'] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid = $v[manufacturerid]");
}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 11-18-2010, 11:41 AM
 
missing missing is offline
 

Newbie
  
Join Date: Sep 2010
Posts: 4
 

Default Re: Display Manufacturer Name on Products Page

@cflsystems, your code worked like a charm! Here's the full code I used

In products.php below: $smarty->assign('cat_products', isset($products) ? $products : array());
HTML Code:
if (!empty($products)) { foreach ($products as $k=>$v) $products[$k]['manufacturer'] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid = $v[manufacturerid]"); }

Then add the following code into your product_details.tpl page where ever you want it
HTML Code:
<a href="manufacturers.php?manufacturerid={$product.manufacturerid}">{$product.manufacturer}</a>
__________________
Missing Design*
x-cart version 4.4.0
Reply With Quote
  #8  
Old 11-19-2010, 09:37 AM
 
jvolvovski jvolvovski is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 46
 

Default Re: Display Manufacturer Name on Products Page

That worked perfectly for me as well.

Any ideas how I would do it on the invoice page? as well as the cart summary on the last step of the fast lane checkout?

Thanks again for your help.
Jenny
__________________
Version 4.3.2
Reply With Quote
  #9  
Old 11-19-2010, 10:05 AM
 
alexisc67@msn.com alexisc67@msn.com is offline
 

Newbie
  
Join Date: Nov 2010
Posts: 5
 

Question Re: Display Manufacturer Name on Products Page

Hi,

This is very interesting. I am trying to pull the manufacturer to the products_list file and tried your code. It didn't work.

Does your code need to be changed to get what I need?

Thanks,
Alexis
__________________
X-Cart Gold 4.3
Reply With Quote
  #10  
Old 11-19-2010, 12:08 PM
 
Snowrev Snowrev is offline
 

Member
  
Join Date: Oct 2010
Posts: 24
 

Default Re: Display Manufacturer Name on Products Page

Any idea how you would display the manufacturer logo and link to manufacturer page on the products page instead of the name?
__________________
John Centi
SNOWREV
SUBURBAN BLEND
X Cart 4.4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:43 AM.

   

 
X-Cart forums © 2001-2020