X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Display Manufacturer Name on Products Page (https://forum.x-cart.com/showthread.php?t=56459)

jvolvovski 11-08-2010 07:09 AM

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

cflsystems 11-08-2010 07:45 AM

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

jvolvovski 11-08-2010 07:48 AM

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

cflsystems 11-10-2010 04:05 PM

Re: Display Manufacturer Name on Products Page
 
You will have to edit a php file for that, most likely include/search.php

jvolvovski 11-10-2010 04:08 PM

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.

cflsystems 11-10-2010 04:15 PM

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]");
}

missing 11-18-2010 11:41 AM

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>

jvolvovski 11-19-2010 09:37 AM

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

alexisc67@msn.com 11-19-2010 10:05 AM

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

Snowrev 11-19-2010 12:08 PM

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?


All times are GMT -8. The time now is 12:25 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.