Project:
UbercartCategory:
feature requestPriority:
normalAssigned:
UnassignedStatus:
fixedI have pathauto setup to create nice path aliases for taxonomy links, however Ubercart doesn't use them. Instead it creates it's own paths at "manufacturer/#" and "catalog/#/term".
The two attached patches make it so UC checks to see if aliases are registered for the taxonomy terms, defaulting to the current behavior if there isn't an alias.
** UPDATED ** See comment below. Changed to Feature Request, as UC urls should be customizable (either through pathauto or internally).

Re: Manufacturer and Catalog links don't honor path aliases
Guess I should have thought this through a bit more... I see why UC is using their own urls -- because a custom page is created and UC isn't sending the visitor to the taxonomy listing page.
I still see the fact that you can't customize your manufacturer and catalog urls as a problem, but the fix will be more complicated and require that uc_manufacturer and uc_catalog hook into pathauto to create aliases automatically for their internal urls.
I'll see what I can code up...
Re: Re: Manufacturer and Catalog links don't honor path aliases
Thanks for raising the issue... I'd PM Lyle if I were you. I think he's working on the code, too.
Re: Re: Manufacturer and Catalog links don't honor path aliases
I discovered that using hook_link_alter() works better than hook_term_path because it allows the path module to alias both the taxonomy pages and the catalog pages. The links on the node to the taxonomy terms will be overridden to point to the appropriate catalog page. I debated for a while about that, and I think it's a reasonable thing for the catalog module. Most sites that use the catalog won't be using the taxonomy pages much, so there shouldn't be a lot of confusion.
Re: Re: Re: Manufacturer and Catalog links don't honor path alia
How would we use hook_link_alter() in the module? Maybe I'm not understanding the concept... let's use uc_manufacturer as an example:
There are two links in the system for a manufacturer, the taxonomy term link ("taxonomy/term/#" leading to the taxonomy listing page) and the uc_manufacturer link ("manufacturer/#" leading to the UC manufacturer page). My original patch was:
<?php$path = drupal_get_path_alias('taxonomy/term/' . $term->tid);
if ($path == ('taxonomy/term/' . $term->tid)){
$path = 'manufacturer/'. $term->tid;
}
return $path;
?>
and the idea was to lookup the path alias and use that instead of "manufacturer/#", however obviously this then pointed the user to the taxonomy term page, not the UC page. hook_link_alter() would allow us to redirect "taxonomy/term/#" to "manufacturer/#", but I still think we need to allow users to redefine how "manufacturer/#" itself is output.
We could do this internally as a setting, but for the most flexible option, I think we can register with pathauto to allow users to create an alias for our urls using the available tokens.
I still think using hook_link_alter() is a good idea, but AFAIK it's not a solution to the original problem (unless we also included the code I posted above, which would lookup the path alias -- but the user would still need to setup a pathauto recipe for manufacturer term links). Alternatively, I think implementing a uc_manufacturer_pathauto($op) function might give the option to customize our links.
Re: Re: Re: Re: Manufacturer and Catalog links don't honor path
You can't do it with pathauto, but the path module in Drupal core lets you manually create aliases for any Drupal path. hook_link_alter() allows that to happen without any special coding on my part. I just put 'manufacturer/'. $tid in the 'href' field, and any alias that exists is used. Get the latest code from Bazaar to see what I've done.
Now that URL aliasing works on the catalog, I can actually implement all the pathauto features and simplify a settings page at the same time. Awesome.
Pathauto for catalog pages
...is here.
Re: Re: Re: Re: Re: Manufacturer and Catalog links don't honor p
I don't think I was very clear... the point I was making is that we should implement the pathauto hooks so that users can rewrite uc links. It appears you've just done that, so I look forward to checking it out.
taxonomy links?
If these are taxonomy links implemented via hook_term_path then perhaps this issue will help provide support: http://drupal.org/node/188606
Re: Re: Re: Re: Re: Re: Manufacturer and Catalog links don't hon
Yep, the new pathauto feature in uc_catalog is just what I was looking for. Thanks! I'd still like to see the same in uc_manufacturer, but it the catalog feature is great (except for the small bug I found and posted here
Re: Re: Re: Re: Re: Re: Re: Manufacturer and Catalog links don't
Is this feature included in Ubercart beta?
Or i must use this patches?
Re: Re: Re: Re: Re: Re: Re: Re: Manufacturer and Catalog links d
It's in beta 2 at least. It was probably in the first beta though.
Re: Re: Re: Re: Re: Re: Re: Re: Re: Manufacturer and Catalog lin
How hard would this be to adapt for uc_manufacturer. I've been looking hard for this kind of functionality, but utterly failed at incorporating pathauto into uc_manufacturer myself.
I think that there really only needs to be one "manufacturer" page, between browsing the taxonomy pages and viewing the pages generated by uc_manufacturer (which are now different). That would help keep things consistent and make aliases easier.