VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: ExSpirit on May 01, 2015, 11:38:18 AM

Title: Display all Manufacturers not only one
Post by: ExSpirit on May 01, 2015, 11:38:18 AM
If I use $product->mf_name only one manufacturer is shown, even though I have 5 of them. How can I display all 5 of them?
Title: Re: Display all Manufacturers not only one
Post by: PRO on May 01, 2015, 19:34:52 PM


create a module  "Manufacturer module"
publish it


in the template you want it to show.


<?php jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule( 'mod_virtueMart_manufacturer');
$attribs['style'] = 'xhtml';
echo JModuleHelper::renderModule( $module, $attribs );
?>
Title: Re: Display all Manufacturers not only one
Post by: ExSpirit on May 03, 2015, 11:08:59 AM
Sorry, I didn't write that correctly. I don't want to display all Manufacturers which are in VM, I want to display all Manufacturers which product has.
Title: Re: Display all Manufacturers not only one
Post by: ExSpirit on May 04, 2015, 11:52:25 AM
For start I can get IDs of those by using $product->virtuemart_manufacturer_id, but how do I get their names/links?
Title: Re: Display all Manufacturers not only one
Post by: GJC Web Design on May 04, 2015, 13:37:12 PM
guess you have to do a query to find the names from the manu lang tables by id
I see no function for this in the manu model (name by id)
Title: Re: Display all Manufacturers not only one
Post by: ExSpirit on May 04, 2015, 16:18:59 PM
Could you please write some sample which I can use at my template files for that?
Title: Re: Display all Manufacturers not only one
Post by: GJC Web Design on May 04, 2015, 16:55:33 PM
standard Joomla db query

https://docs.joomla.org/Selecting_data_using_JDatabase

Title: Re: Display all Manufacturers not only one
Post by: ExSpirit on May 04, 2015, 18:24:28 PM
OK, I will try that today.

p.s.: Is there any way to modify the URL /component/virtuemart/manufacturers/manufacturer-name so that it would only be /man/manufacturer-name?
Title: Re: Display all Manufacturers not only one
Post by: PRO on May 04, 2015, 19:57:18 PM
Quote from: ExSpirit on May 04, 2015, 18:24:28 PM
OK, I will try that today.

p.s.: Is there any way to modify the URL /component/virtuemart/manufacturers/manufacturer-name so that it would only be /man/manufacturer-name?

make a joomla link to the manufacturers page

make the alias    "man"



Title: Re: Display all Manufacturers not only one
Post by: ExSpirit on May 04, 2015, 21:15:17 PM
I did that but it always gives me "/man/manufacturer/manufacturer-name" on all next links. I don't know why middle "manufacturer" is there.