Hi, thanks for this module, this should be integrated in Taxonomy Menu!

For me direct install didn't work (with y a subcategory of x, I had stuff like that catalog/x/y instead of catalog/y) and I had to modify the main function like this :

<?php
/**
 * Callback for hook_taxonomy_menu_path
 */
function taxonomy_menu_path_ubercart_path($vid, $tid) {
  //setup the base path of category/vid
  $path =  variable_get('taxonomy_menu_ubercart_base_'. $vid, 'catalog');

  //if tid = 0 then we are getting the vocab item path
  if ($tid == 0) {
    return drupal_get_path_alias($path);
  }
/*
  //get the parents of the term
  $parents = taxonomy_get_parents_all($tid);
  //cycle through the parents and add them as an item on the menu
  foreach ($parents as $parent) {
    $path_tids = '/'. $parent->tid . $path_tids; 
  }*/

  return drupal_get_path_alias($path . "/" . $tid);
}
?>

Regards,
cfab

Comments

digitalfrontiersmedia’s picture

I would think this is actually by design.

tahiticlic’s picture

Perhaps, but if it is, it doesn't work (D6.14, Pathauto enabled) so there's something to correct at least.

digitalfrontiersmedia’s picture

hmmm...I am currently using Ubercart Catalog Taxonomy Menu with D6.14, UC 6.x-2.0-rc7, and Pathauto 6.x-1.1. It seems to work for me. Example in left sidebar at:
http://www.rubiconcollection.com/catalog/accessories (Note: still under development)

What version of UC are you using?

tahiticlic’s picture

I'm using Ubercart 6.x-2.2 and Pathauto 6.x-1.2

Well, as I've just tested it, the drupal_get_path_alias call is not needed, but the rest is, in my case at least.

arpieb’s picture

I'm also having the same problem in a hierarchical taxonomy for UC2. I originally installed this module onto D6.14 + UC 6.x-2.0-RC7 and it worked fine. Now I have upgraded to UC 6.x-2.2 due to the security issues, and recently had to rebuild the menus due to some changes in the terms. Now I'm getting the same results cfab is getting - what used to result in a URL like http://isettasrus.com/dev/catalog/18 is now being generated as http://isettasrus.com/dev/catalog/16/18 where tid 16 is the parent term, which breaks UC's catalog browsing code.

Is it possible that UC2.2 changed some assumption that this module was operating under from the RC7 version to 2.2...?

-R

timcooper’s picture

It would appear that adding drupal_get_path_alias is in fact necessary if you are using URL Aliases

fred0’s picture

Assigned: Unassigned » fred0
Status: Active » Fixed

First, my apologies for being awol on this issue. For some reason I am not getting email notifications of new issues. Anyway, cfab and arpieb are correct in that taxonomies with parent terms are not aliasing properly. However, while the proposed solution may work, it is not the correct approach here. We do not need to call for the alias in the code since Pathauto will alias any path that it has a match for in its list. To that end, what we actually need to do is make this module generate valid paths for the Ubercart catalog.
I have committed a fix and those changes should appear within 12 hours. Please test the update and let me know if it fails to solve your problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.