7 replies [Last post]
goodeit's picture
Offline
Joined: 05/28/2008
Juice: 322
Was this information Helpful?

Hello,
I love the uc_manufacturer add-on module, but had a quick question. Right now, the module makes the path to the manufacturer's page something like site.com/manufacturer/335. I was wondering how I could change this to use the manufacturer's name instead. Pathauto does not seem to be able to do the trick.

Starting at line 122, the function uc_manufacturer_path($term) seems to be what I want to change. It is returning 'manufacturer/'. $term->tid; but I do not know what other variables are in the $term class. What variable would I want to use?

goodeit's picture
Offline
Joined: 05/28/2008
Juice: 322
OK well using $term->name

OK well using $term->name seemed to work, but its capitalized. However, changing those lines only changes the link when you are on a manufacturer's product page, and the link only works if you have things setup in pathauto. Back to the code...

goodeit's picture
Offline
Joined: 05/28/2008
Juice: 322
Re: OK well using $term->name

upon further investigation, it appears that I need to modify the $item variable somewhere around lines 67-89. Can anyone tell me what the arg(1) means and where I can get the name from it?

goodeit's picture
Offline
Joined: 05/28/2008
Juice: 322
Re: Re: OK well using $term->name

OK, so I'm an idiot and arg(1) corresponds to the actual path in the address bar (e.g. site.com/catalog/house would be arg(0)=catalog arg(1)=house)... NOTE this disregards all pathauto/path settings.

Maybe I can just lookup the manufacturer name, now that I have the $term->tid?

(and is anyone else enjoying this as much as I am?)

EDIT: how do I lookup a $term if I know the tid??

goodeit's picture
Offline
Joined: 05/28/2008
Juice: 322
Re: Re: Re: OK well using $term->name

ok got uc_manufacturer_load(arg(1))... still working on it.

sashomi's picture
Offline
Joined: 06/19/2008
Juice: 29
Manufacturers in calagog menu

Any ideas how to put manufacturers in the catalog menu, so when I choose a category, to show all manufacturers in it?

goodeit's picture
Offline
Joined: 05/28/2008
Juice: 322
Re: Manufacturers in calagog menu

did you try using the Views module? That seems like a good bet...

venkat-rk@drupal.org's picture
Offline
Joined: 03/19/2008
Juice: 205
goodeit wrote:Hello, I
goodeit wrote:

Hello,
I love the uc_manufacturer add-on module, but had a quick question. Right now, the module makes the path to the manufacturer's page something like site.com/manufacturer/335. I was wondering how I could change this to use the manufacturer's name instead. Pathauto does not seem to be able to do the trick.

Are you sure that pathauto doesn't do the trick? This module is based on the core taxonomy module for which pathauto works great.