Where does this path segment in the category URL come from?

Started by bcohen0, June 30, 2017, 02:31:44 AM

Previous topic - Next topic

bcohen0

Virtuemart 3.2.2:  In the category accordion menu in my site, the menu links have a path segment that my main menu does not have, and it's causing me some difficulty. For example, the top menu selection might link to, index.php/products/product_cat    , whereas the link for the menu item in the category accordion menu says index.php/shop/products/product_cat .    That element "shop" also shows up in the breadcrumbs, and is selectable, and when it's selected it goes to a particular view that I don't want.  Can someone tell me, is it my template which is inserting "shop" into the url, or is this something that Virtuemart does?   


bcohen0

OK, so What I am noticing is that only SOME of my menu subitems get this "shop" path segment stuck into them. The rest of them look proper. I just created some new subitems, and they don't have this problem. And, oddly, some submenu items don't have this "shop" path segment stuck into them, when they are under parent items that do! Now, I'm wondering if this is the result of an upgrade to virtuemart?  Please can some guru comment?

bcohen0

OK, further on down the road now, I have discovered that the problem occurs only for category elements for whom manufacturers have been selected. When I de-select the manufacturer, the problem goes away.  I've traced it into the com_virtuemart/router.php, but not farther, yet.  Are manufacturers NOT intended to be placed on categories, but only on individual products?

bcohen0

Even further down the road, now, the problem happens in com_virtuemart/router.php, around line 840:

      self::$_instance->query = $query;
      if(!empty($query['Itemid']) and $query['Itemid']!=self::$_instance->Itemid){
         self::$_instance->Itemid = $query['Itemid'];
         self::$_instance->setMenuItemId();
      } else {
         //self::$_instance->Itemid = vRequest::get('Itemid',false);
         //vmTrace('No item id in query');
      }

There is a Menu in _instance that has an id that isn't getting updated. $query['Itemid'] is 121, and by this point in the code, the $_instance->Itemid has been set to 121. Therefore this code isn't executed, and setMenuItemId() isn't called. It has an id setting of 192 at the time. Later on, it is queried for the Menu, and so is sent that 192, instead of the 121 that I need it to be.

Being a noob, I'm perfectly willing to accept that there's a good reason for this. I'd like to know it though.

And thank you for moving this post where it belongs. I'm so new, I didn't know that's what this was about until now.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum