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)
-   -   Displaying Manufacturer Details (https://forum.x-cart.com/showthread.php?t=56990)

almatesic 12-10-2010 06:36 AM

Displaying Manufacturer Details
 
I've been racking my brain on how to display more than just the manufacturer's name in the product details page. I would like to display URL of the manufacturer for starters. It would also be nice to know how to display the other fields as well onto the product details page.

Please help....and thank you in advance.

almatesic 12-10-2010 10:40 AM

Re: Displaying Manufacturer Details
 
In product.php I added the following code.
Code:

$manufacturer = func_query("SELECT * FROM xcart_manufacturers WHERE  manufacturerid = 1");
$smarty->assign("m_url", $manufacturer[0]["url"]);


I would think since i hard coded the query i would pull at least one record and assign the m_url variable with something I know exists.

Then in product_details.php i added
Code:

{ m_url }.

However nothing shows up.

This comes back to my original question how can i show the proper manufacturer url for the corresponding product.

I've been searching and reading up and nothing seems to be working.

What am i doing wrong?

thanks,
al

cflsystems 12-10-2010 11:03 AM

Re: Displaying Manufacturer Details
 
{$m_url }.

almatesic 12-10-2010 11:08 AM

Re: Displaying Manufacturer Details
 
I'm sorry I have that in my code...

{ $m_url }

cflsystems 12-10-2010 11:11 AM

Re: Displaying Manufacturer Details
 
Have you looked at $manufacturers array how it is structured?

almatesic 12-10-2010 12:14 PM

Re: Displaying Manufacturer Details
 
no i have not and not sure even how to display that to figure that out.

almatesic 12-14-2010 04:33 PM

Re: Displaying Manufacturer Details
 
Can anybody help me show to display the manufacturer array so i can display what information i want on the product details page.

Thanks in advance.

cflsystems 12-14-2010 05:10 PM

Re: Displaying Manufacturer Details
 
in that same php file after the manufacturers code you put from above

x_load ('debug');
func_print_r($manufacturer);

almatesic 12-14-2010 05:25 PM

Re: Displaying Manufacturer Details
 
Here is my array....

Code:

Debug [0/0]: Array
(
    [0] => Array
        (
            [manufacturerid] => 1
            [manufacturer] => Hubert
            [url] => http://www.imdb.com/name/nm0209168/
            [descr] =>
            [orderby] => 10
            [provider] => admin
            [avail] => Y
            [meta_description] =>
            [meta_keywords] =>
            [title_tag] =>
        )


)

almatesic 12-15-2010 04:04 PM

Re: Displaying Manufacturer Details
 
So i displayed the manufacturer array.

Code:

Debug [0/0]: Array
(
    [0] => Array
        (
            [manufacturerid] => 1
            [manufacturer] => Hubert
            [url] => http://www.imdb.com/name/nm0209168/
            [descr] =>
            [orderby] => 10
            [provider] => admin
            [avail] => Y
            [meta_description] =>
            [meta_keywords] =>
            [title_tag] =>


Then in products.php i assigned the variable m_url using the following code:
Code:

$smarty->assign("m_url", $manufacturer[0]["url"]);

Finally i call it in product_details.tpl by doing the following:

Code:

{ $m_url }



However its not displaying. What am i doing wrong here? I've tried many things and so on, but nothing.

Please help and thanks in advance.

almatesic 12-16-2010 06:57 PM

Re: Displaying Manufacturer Details
 
Is there anybody can help me on this issue. What am i doing wrong???

cflsystems 12-16-2010 07:39 PM

Re: Displaying Manufacturer Details
 
Try this as "" are probably messing up with the second parameter

$smarty->assign("m_url", $manufacturer[0]['url']);

Or you can do this if only url is what you need

$smarty->assign("m_url", func_query_first_cell("SELECT url FROM xcart_manufacturers WHERE manufacturerid = 1"));


All times are GMT -8. The time now is 02:00 PM.

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