X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Manufacturers in SUB-categories..... (https://forum.x-cart.com/showthread.php?t=14147)

IndieDepot 05-23-2005 12:00 PM

Manufacturers in SUB-categories.....
 
Just trying to get each products Manufacturer listed in the Sub-Categories rather then listing the SKU#

Anybody know the code to pop in the 'products.tpl' or 'products_t.tpl' file to make that happen?

Much obliged'...

- Shannon

eleven 06-10-2005 12:27 PM

This code should work
 
It took a while but I think i figured it out. This code works for me (X-Cart 4.0.13)

in include/search.php add this code after
$products[$k]['fulldescr'] = str_replace("\n","
",$products[$k]['fulldescr']);

Code:

                                #
                                # Add Manufacturer information
                                #
                                if (!empty($active_modules["Manufacturers"])) {
                                        $idholder = $products[$k]['manufacturerid'];
                                        $products[$k]['manufacturer'] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid = '$idholder'");       
                                }



In products_t.tpl:
Code:

Manufacturer: {$products[product].manufacturer}

IndieDepot 06-10-2005 12:34 PM

works like a charm!

this should be moved to completed free mods.

- Shannon

balinor 06-10-2005 12:45 PM

Done!

Ryano 06-10-2005 05:26 PM

What exactly does this do? Very interested. Couldn't figure out what the change does though. Thanks.

eleven 06-10-2005 05:40 PM

what does it do?
 
On the thumbnail pages, it displays a product's manufacturer and links to the manufacturer's page. Previously (as far as I know), you could only do that on the product detail pages.

Ryano 06-10-2005 06:25 PM

Oh Ok I see how it works now. Cool mod. Thanks for sharing!

tiju 06-15-2005 09:41 PM

Re: This code should work
 
The code is not working for me, i have xcart pro- 4.0.13.
the correct templete for modifications is...products_t.tpl or products.tpl

thanks



Quote:

Originally Posted by eleven
It took a while but I think i figured it out. This code works for me (X-Cart 4.0.13)

in include/search.php add this code after
$products[$k]['fulldescr'] = str_replace("\n","
",$products[$k]['fulldescr']);

Code:

                                #
                                # Add Manufacturer information
                                #
                                if (!empty($active_modules["Manufacturers"])) {
                                        $idholder = $products[$k]['manufacturerid'];
                                        $products[$k]['manufacturer'] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid = '$idholder'");       
                                }



In products_t.tpl:
Code:

Manufacturer: {$products[product].manufacturer}


balinor 06-16-2005 03:53 AM

The mod was written for Gold, it may take some tweaking for Pro...

magnifold 06-16-2005 09:19 AM

location?
 
i can't even find products_t.tpl

I put the code for products.tpl and when i preview it gives error:

Fatal error: Smarty error: [in ./main/products.tpl line 10]: syntax error: invalid attribute name: '=' (Smarty_Compiler.class.php, line 1512) in /www/e/eyeballstore/htdocs/store/Smarty-2.6.3/Smarty.class.php on line 1082

using X-cart gold 4.0.13

maildodge 06-24-2005 11:02 AM

I was searching ages for something like this. All the other posts just didnt seem to work.

This was simple and works great. Thanks :D

KCAutosound 06-25-2005 04:05 PM

I was trying to put this into the product.tpl as well so I would display under the product name but all it shows is Manufacturer: as if it isn't grabbing from the database. Any ideas?
[/b]

dgrif 06-26-2005 04:00 PM

I tried this and it didn't change anything. It didn't give me any errors.
Is there a certain place I am suppose to add the code to product_t.tpl?

Thanks for any help.

Donna

casey 09-11-2005 05:50 PM

Same problem
 
Quote:

Originally Posted by KCAutosound
I was trying to put this into the product.tpl as well so I would display under the product name but all it shows is Manufacturer: as if it isn't grabbing from the database. Any ideas?


Same problem here...Nothing happens and I NEED this. Anyone?

The only thing I can think of is that when I was pre-savvy I changed "Manufacturers" to "Designers" in the search and replace lang variables on the backend instead of using webmaster mode. :?

casey 09-11-2005 06:15 PM

restored
 
::fixed::

and I'd be glad to post what I did but it was a variation of trial and error fom many of the posts here.

LouOffroad 09-11-2005 06:50 PM

Quote:

Originally Posted by KCAutosound
I was trying to put this into the product.tpl as well so I would display under the product name but all it shows is Manufacturer: as if it isn't grabbing from the database. Any ideas?
[/b]


In product.tpl after
Code:

{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR>
{/if}


Place this code
Code:

{if $product.manufacturer eq 0}
{else}
<TR><TD align="left" valign="middle">{$lng.lbl_manufacturer}:</TD><TD>{$product.manufacturer}</TD></TR>{/if}



This works for us in 4.0.12 perfectly. Granted this will not show under the product name but will show under the DETAILS section of the product page. You'll have to play with it a bit but put the code where you want in product.tpl. Should work anywhere.

NOTE: This code will not display a manufacturer if one is not assigned to that particular product.

Cheers!

Amy 07-13-2006 06:30 AM

anyone have any success with this for Pro yet?

gastu 12-11-2006 04:33 PM

Re: Manufacturers in SUB-categories.....
 
no work in 4.1.x


All times are GMT -8. The time now is 09:52 PM.

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