Author Topic: products and catagories 3 levels deep have wrong breadcrumbs (SOLVED)  (Read 6524 times)

daneboulton

  • Beginner
  • *
  • Posts: 12
Hi I'm relatively new to virtuemart but have been able to get by on the project I'm working on thanks to these forums :)
For starters I am running Joomla 1.5.15 and Virtuemart 1.14

I already applied this vmAppendPathway hack to fix the issue with breadcrumbs showing double
Code: [Select]
function vmAppendPathway( $pathway ) {
      global $mainframe;
      
      // Remove the link on the last pathway item
      $pathway[ count($pathway) - 1 ]->link = '';
      
      if( vmIsJoomla('1.5') )
      {
         if(count($pathway)>1)
         {   $cmsPathway =& $mainframe->getPathway();
        
         $i=0;
            foreach( $pathway AS $item) {
               if($i>=2)
               {   $cmsPathway->addItem($item->name, str_replace('&', '&', $item->link) );
               }
               $i=$i+1;
            }
        
        
         }
      } else {
         $tpl = vmTemplate::getInstance();
         $tpl->set( 'pathway', $pathway );
         $vmPathway = $tpl->fetch( 'common/pathway.tpl.php' );
         $mainframe->appendPathWay( $vmPathway );
      }
   }
however I have another issue. On any category or product page that goes beyond 2 levels of  catagories the breadcrumbs adds a the same two path links that shouldn't be there.

Examples on a normal working page with only 2 layers of categories:
Home->Products->Servers->AMD Servers  
or
Home->Products->Servers->AMD Servers->sample product

these display fine but when I go one more level deep it messes up

Example of non working breadcrumb:
(How it actually displays currently)
Home->Products->Storage->AMD->Servers->AMD Servers->Legacy AMD Servers
Home->Products->Storage->AMD->Servers->AMD Servers->Legacy AMD Servers->sample product

(what is should display as)
Home->Products->Servers->AMD Servers->Legacy AMD Servers
Home->Products->Servers->AMD Servers->Legacy AMD Servers->sample product

to summerize the problem on any category page or product page that is 3 levels of categories deep Storage->AMD-> is added to the breadcrumbs regardless whether or not that category or product have anything to do with the storage category.

Any help as to a solution would be greatly appreciated.

uglyfashion

  • Beginner
  • *
  • Posts: 43
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #1 on: March 24, 2010, 16:22:56 pm »
I also have this problem.  If I find anything I'll let you know, if you could pay me the same favour I would be grateful.

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #2 on: March 24, 2010, 21:20:07 pm »
Did you create Joomla menu link directly to "AMD Servers" somewhere?

uglyfashion

  • Beginner
  • *
  • Posts: 43
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #3 on: March 29, 2010, 16:51:04 pm »
On my page I have made some joomla menu links to categories, could this have caused a problem with the breadcrumbs?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #4 on: March 29, 2010, 20:55:44 pm »
yes, likely that is the problem. You need to convert that "AMD Servers" vm category link to a "Store" or "Shop" or (whatever you want to name your shop). Remove the category setting under Advanced Parameters for that menu link. You can then move that link to another menu if you wish. Then create a new "AMD Servers" link as you had it set.

Essentially, Joomla needs a "master" link for VM, and that "master" link is created on the first J! menu link you create to VM... in this case it was "AMD Servers". So just rename it, etc, and re-create the AMD Servers link. Now the renamed "store" link will be your master (still) and store breadcrumbs work right Home -> Store -> blah-blah

uglyfashion

  • Beginner
  • *
  • Posts: 43
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #5 on: March 30, 2010, 00:14:15 am »
Hey forest, I confused you there.  I wasn't the initial poster!

I have a similar problem though.  As I stated.  The website I'm on I have renamed the category "lights" and yet it still comes up as "lights" when I look at any product. 

I appreciate your patience in explaining stuff so far, but I'm still a little lost.  Should I now rename the category as "store" and then remove all products and put them in a new category?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #6 on: March 30, 2010, 01:11:09 am »
Do not rename categories in VM. Vm categories are not the issue here.

The issue is how Joomla handles VM. Checkout the ITEMID of your VM urls. They should all share one itemid. This itemid is "1" by default, and will change if you create any Joomla Menu Link to VM component. Joomla will now use the Itemid of this 1st menu link created to VM. This link should not be to a category, or product, etc (No Menu Parameters). Just name it store, or shop, etc.

Now if you did not do this, and instead just started creating a bunch of VM links to categories or products, then you need to find the menu item that Joomla has assigned to VM. Again, just look at the links in VM for a common itemid. Find the Joomla menu link with that itemid, and rename it to "store" (whatever), and REMOVE any link parameters you may have added.


uglyfashion

  • Beginner
  • *
  • Posts: 43
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #7 on: April 02, 2010, 16:35:27 pm »
Hi Forest.  Thank you for your continuing support despite the adversity of my own sweet ignorance.

Having hovered over my menu links, the ones that are created with your mod, they have the common theme of itemid 60.  That must be what you're talking of, however, none of my Joomla menus have this item id.  My Joomla menus all have parameters linking them to categories, except one which has an Item ID 0f 80 and is called "our shop".

Would it be best if I deleted all of these links and started again with them?

if it would help to see the site please take a look www.propermods.com

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #8 on: April 03, 2010, 10:14:22 am »
There is one with the ID of 60, unless you set 60 to be your Store ID Override in my menu mod.

You need to go into your Joomla Menu administration, and look at each menu item for the itemid of 60. It's there. It's not pulling 60 out of thin air.

daneboulton

  • Beginner
  • *
  • Posts: 12
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #9 on: April 06, 2010, 23:10:18 pm »
Hey thanks for the reply!! for some reason I stopped getting emails for replies to this post and so I thought no one had replied but anyways I'm trying to figure out what you said.

As you stated above I found the common item id of 100022 still not clear what I'm supposed to do.

I did create a joomla menu link to my categories in VM the menu item with id of 100022 is my AMD Storage link linked to the AMD Storage category in VM.

also to give you an idea of whats not working here is an example of a working page with correct bread crumbs
http://www.batiming.com/test/mazdatechnew/products/servers/amd.html

and here is a broken page
http://www.batiming.com/test/mazdatechnew/products/storage/amd.html?page=shop.browse&category_id=130
what it should say is Home>products>workstations>intel>legacy intel workstations

but this only happens on 3rd level categories





Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #10 on: April 06, 2010, 23:24:41 pm »
Change the AMD link to be called "Store" or "Shop" and remove the category reference in parameters.

Then create a new link called AMD, just as you had it with the category reference.

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #11 on: April 06, 2010, 23:27:16 pm »
You have same problem as this guy:
http://forum.virtuemart.net/index.php?topic=67767.0

daneboulton

  • Beginner
  • *
  • Posts: 12
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #12 on: April 07, 2010, 00:20:30 am »
that seemed to work I set it to "products" instead of "shop"  only issue is that no it looses its parent category so it displays as

home>products>legacy intel workstations
instead of
home>products>workstations>intel>legacy intel workstations

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #13 on: April 07, 2010, 00:39:04 am »
You need to play with this more and search forum/read documentation. I can't give a better explanation.

daneboulton

  • Beginner
  • *
  • Posts: 12
Re: products and catagories 3 levels deep have wrong breadcrumbs
« Reply #14 on: April 07, 2010, 00:51:21 am »
ok I'll keep searching but thanks for all your help!!! you definitely gave me a big push in the right direction :)