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


All times are GMT -8. The time now is 01:24 PM.

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