Virtue Mart Breadcrumb problem

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
ljk
Joomla! Guru
Joomla! Guru
Posts: 756
Joined: Sat Jan 28, 2006 11:51 pm
Location: West Kelowna, BC
Contact:

Virtue Mart Breadcrumb problem

Post by ljk » Tue Dec 23, 2008 3:20 am

Hello,

I am using Joomla 1.5.8, VM 1.1.2 and have Joomla SEF on.

I have turned on breadcrumbs and they work as expected on the Joomla pages, but on any VM page I am getting the breadcrumb trail duplicated. If I go to Category 1 page I get Home > Category1 > Category1. If I go to Category1 subCategory1 I get Home > Category1 > subCategory1 > Category1 > subCategory1. See attached image.

I am using the Joomla menu system to access the Category pages. In my menu I have Category1 as a VM type menu item with the category ID set, under it as a sub menu item I have subCategory1 set as a VM type menu item with the category for it set.

When I go into a product only the top category is repeated in the breadcrumb, but none of the subcategories are repeated. See attached image.

Is there some setting that you need to change, to get the categories not to show twice?
How are others solving this breadcrumb issue?

Thanks.

Additional info:
- it doesn't seem to matter whether you have SEF on or off, same problem
- when you click into a sub-category from the category page of VM, so it uses the VM link rather than using the Joomla menu link you only get the category duplicated not the subCategory duplicated as well. It looks like this might have something to do with the Itemid. When you make the new menu items for the subCategory and subsubCategory you get a new Itemid, but when VM makes the link, the Itemid of the Category is used for the subCategory and subsubCategory. If the Itemid is the same as the Category's Itemid you don't get the subCategory duplicated in the breadcrumb, but if you used the menu link, which uses a different Itemid then you get the Category and subCategory duplicated.
If there is not Itemid on the URL, then the Category is not duplicated in the breadcrumb.
You do not have the required permissions to view the files attached to this post.
Laurelle
Keashly.ca Consulting
http://www.keashly.ca

User avatar
ljk
Joomla! Guru
Joomla! Guru
Posts: 756
Joined: Sat Jan 28, 2006 11:51 pm
Location: West Kelowna, BC
Contact:

Re: Virtue Mart Breadcrumb problem

Post by ljk » Fri Feb 13, 2009 1:22 am

Upgraded to Joomla 1.5.9 and VM 1.1.3, and this is still a problem.

Added this hack: http://forum.virtuemart.net/index.php?t ... .msg161352 to get the correct menu itemIds on the category and product links, but the path in the breadcrumbs are still being duplicated.

Anyone solved this problem yet?
Laurelle
Keashly.ca Consulting
http://www.keashly.ca

Counterpart
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Nov 12, 2007 4:09 am

Re: Virtue Mart Breadcrumb problem

Post by Counterpart » Fri Feb 13, 2009 1:59 am

i get the same problem. i just turned them off.

saurav_rocks
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Feb 20, 2009 8:11 am

Re: Virtue Mart Breadcrumb problem

Post by saurav_rocks » Tue Feb 24, 2009 6:57 pm

Hi friends.. I did solved this issue.. Hope it would help you too...
Go to administrator\components\com_virtuemart\classes\mainframe.class.php
and line number 363 :
$cmsPathway->addItem( $item->name, str_replace('&', '&', $item->link) );

JUST COMMENT IT...
:D

Thanks and Regards
Saurav...
(laturkar.saurav@gmail.com)

User avatar
ljk
Joomla! Guru
Joomla! Guru
Posts: 756
Joined: Sat Jan 28, 2006 11:51 pm
Location: West Kelowna, BC
Contact:

Re: Virtue Mart Breadcrumb problem

Post by ljk » Tue Feb 24, 2009 9:22 pm

Hi Saurav,

Thank you for your suggestion, it helps a lot, but there is one problem with that solution, when you get down to the actual product details level, the breadcrumb does not display the product name on the end of the breadcrumb.

Did anyone find a way to solve that problem?

Thanks.
Laurelle
Keashly.ca Consulting
http://www.keashly.ca

User avatar
dabattaah
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 236
Joined: Mon Sep 12, 2005 6:49 pm
Location: Raalte
Contact:

Re: Virtue Mart Breadcrumb problem

Post by dabattaah » Sat Feb 28, 2009 1:43 pm

What do you mean with comments? Like this <!-- Hello --> ??

When I do that i get a error on my page:

Code: Select all

Parse error: syntax error, unexpected '<' in /home/kikkeweb/domains/kikkekinderkamers.nl/public_html/webwinkel/administrator/components/com_virtuemart/classes/mainframe.class.php on line 363
Bart Pronk
Bart Online http://www.bart-online.nl (KvK 56332793)
Joomla People Portal http://people.joomla.org/my-page/bartpronk

Gespecialiseerd in webdesign en Internet marketing

User avatar
ljk
Joomla! Guru
Joomla! Guru
Posts: 756
Joined: Sat Jan 28, 2006 11:51 pm
Location: West Kelowna, BC
Contact:

Re: Virtue Mart Breadcrumb problem

Post by ljk » Sun Mar 01, 2009 4:15 am

Hello,

<!-- xxx --> is the form for html comments. This is a php file, so you need to use php comments:
/* code */

Cheers
Laurelle
Keashly.ca Consulting
http://www.keashly.ca

saurav_rocks
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Feb 20, 2009 8:11 am

Re: Virtue Mart Breadcrumb problem

Post by saurav_rocks » Sun Mar 01, 2009 4:25 pm

Hi ...dabattaah

Plz put a PHP comment
For Multi line use :- /* ---CODE----- */
For Single line use: - // -------CODE---------

Regards
Saurav
(laturkar.saurav@gmail.com)

User avatar
GarlicBred
Joomla! Intern
Joomla! Intern
Posts: 86
Joined: Fri Dec 22, 2006 2:56 am
Location: Adelaide, Australia

Re: Virtue Mart Breadcrumb problem

Post by GarlicBred » Tue Mar 10, 2009 9:04 pm

Thanks Saurav, works for me on VM 1.1.3 too
Is now on line 725

sure wish we had the product name as well ...
The greater our command over language, the sharper are the tools with which we disect reality.

snippio
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri May 08, 2009 12:01 am

Re: Virtue Mart Breadcrumb problem

Post by snippio » Fri May 08, 2009 12:32 am

Hello,

Just replace the function vmAppendPathway (in mainframe.class.php) by this one (starts on line 354):

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>0)
{ $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 );
}
}

This is a 100% fix. It works for unlimited productlevels and the Virtuemart breadcrumb keeps working.

Make me happy and please report whether this was a usefull tip!!!

Bye!
Thijs

nativerun
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon May 11, 2009 9:36 am

Re: Virtue Mart Breadcrumb problem

Post by nativerun » Tue May 12, 2009 9:49 pm

Snippio,

You are the best!
I have, without success, spend so much time figuring out those breadcrumbs.
Your hack is almost perfect, but if I link a virtuemart subcategory to a joomla submenu the breadcrumbs still double. It seems like it is till getting both the itemid from the menu and from the subcategory.

Do you know if there is a simple solution for this? You are so close already.

Thanks

hilby42
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed May 20, 2009 12:41 am

Re: Virtue Mart Breadcrumb problem

Post by hilby42 » Wed May 20, 2009 12:49 am

Has anyone found a solve to this, I am having the same issue. Snippio's code worked halfway but when I use the link from the Joomla sub-menu the VM sub-category doubles. When I use the navigation from the VM category page no doubling. Unfortunately, I need both the Joomla menu in addition to the category page. Maddening!
Thanks for any help out there.

lemon
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed May 20, 2009 12:56 am

Re: Virtue Mart Breadcrumb problem

Post by lemon » Wed May 20, 2009 1:10 am

Hi there,

I found amending the vmAppendPathway function to be as follows worked for me:
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();
//seemed to be getting an extra category
if ($cmsPathway->_count >= 2)
unset ($cmsPathway->_pathway[1]);

foreach( $pathway AS $item) {
$cmsPathway->addItem($item->name, str_replace('&', '&', $item->link) );
}
}
} else {
$tpl = vmTemplate::getInstance();
$tpl->set( 'pathway', $pathway );
$vmPathway = $tpl->fetch( 'common/pathway.tpl.php' );
$mainframe->appendPathWay( $vmPathway );
}
}

It removes the category link from the end of the cmsPathway before appending all the virtuemart links.
I don't promise it will work in all situations, but hope that helps someone. :)

hilby42
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed May 20, 2009 12:41 am

Re: Virtue Mart Breadcrumb problem

Post by hilby42 » Wed May 20, 2009 1:23 am

Thanks Lemon!

That worked for the sub-category, but now my main category is doubling ...suggestions?

lemon
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed May 20, 2009 12:56 am

Re: Virtue Mart Breadcrumb problem

Post by lemon » Wed May 20, 2009 1:46 am

Hmm, I only have 3 categories, but just tried adding subcategory with products - and the breadcrumbs are still behaving..
What 'page' are you on when you're seeing the double up?

hilby42
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed May 20, 2009 12:41 am

Re: Virtue Mart Breadcrumb problem

Post by hilby42 » Wed May 20, 2009 1:58 am

lemon-
On the sub category page--I played around with the spelling on the menu and the VM Categories and found the second entry or the double is coming from the VM category entry.
Thanks for all the help!

SuzanneMarie
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Sun Mar 22, 2009 10:49 am

Re: Virtue Mart Breadcrumb problem

Post by SuzanneMarie » Thu May 21, 2009 1:27 pm

Joomla 1.5.9 - VM 1.1.3 - Apache/2.2.11 (Win32) - PHP 5.2.8 - MySQL client version: 5.0.51a - PHP extension: mysql


Interesting reading, however my problem with breadcrumbs isn't duplication, it is just that the breadcrumb line doesn't go to the right page.

If I select an item in my shop that gives the following breadcrumb line, it all works fine and the product gets displayed.

Home >> RailMags Shop >> Magazines >> Railway Modeller 2000s >> Railway Modeller 2001 March

If I click on Home, then it's good, it goes to the Home page. 'the local URL shows as http://www.engender.co.uk/andibrad/joomla/

If I click on RailMags Shop, then it goes to that page which is my VirtueMart front. 'the local URL shows as http://www.engender.co.uk/andibrad/joom ... lmags-shop

However, if I click on Magazines, or click on Railway Modeller 2000s, then I get a 404 error. 'the local URL shows as http://www.engender.co.uk/andibrad/joom ... &Itemid=18

It loses the 'index.php' somewhere and cannot find its way.

Is this something inherent in breadcrumbs, or is it something I haven't set up in config properly? I have looked all over config and can't find a solution.

Similarly, I have installed the cart module and clicking checkout gives a 404 error. I can't remove an item from the cart without getting a 404 error either.

Please note, if you look at this poblem, that all URLs are local to my own computer, I am loathe to roll this out on my proper website until this silly problem is resolved.

Sorry if this seems confused, but I find it hard to explain problems here.
Thanks for reading.

Suzanne

jan99
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed May 20, 2009 9:32 pm

Re: Virtue Mart Breadcrumb problem

Post by jan99 » Thu May 21, 2009 2:02 pm

I had the same problem.
Thank you!
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

SuzanneMarie
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Sun Mar 22, 2009 10:49 am

Re: Virtue Mart Breadcrumb problem

Post by SuzanneMarie » Fri May 22, 2009 8:45 am

I guess no one knows then. Oh well, off to get rid of VirtueMart from my website

jjepson
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri May 29, 2009 6:58 pm

Re: Virtue Mart Breadcrumb problem

Post by jjepson » Fri May 29, 2009 7:00 pm

This worked for me.

Code: Select all

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();
			if($cmsPathway->_pathway[0]->name =="Shop")
			{
			  unset($cmsPathway->_pathway[0]);
			}
			$i=1;
			foreach( $pathway AS $item)
			{
				$skip=0;
				foreach( $cmsPathway->_pathway AS $itemtemp)
				{
					if($itemtemp->name == $item->name)
					{
						$skip=1;
						$break;
					}
				}
				if(!$skip)
				{
					$cmsPathway->addItem($item->name, str_replace('&', '&', $item->link) );
				}
			}
			$pathway[ count($pathway) - 1 ]->link = '';
		}
	} else {
	$tpl = vmTemplate::getInstance();
	$tpl->set( 'pathway', $pathway );
	$vmPathway = $tpl->fetch( 'common/pathway.tpl.php' );
	$mainframe->appendPathWay( $vmPathway );
	}
	}

SuzanneMarie
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Sun Mar 22, 2009 10:49 am

Re: Virtue Mart Breadcrumb problem

Post by SuzanneMarie » Fri May 29, 2009 10:19 pm

I am sure it did, thanks for replying, but I have no idea how to use what you have replied with.

I have already deleted VirtueMart from my system.


Suzanne.

froglegs
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Nov 18, 2005 2:33 pm

Re: Virtue Mart Breadcrumb problem

Post by froglegs » Wed Oct 21, 2009 4:35 pm

Thanks much - this hack worked just dandy!

KeesieH
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Oct 29, 2009 7:41 pm

Re: Virtue Mart Breadcrumb problem

Post by KeesieH » Thu Oct 29, 2009 7:43 pm

I am still having problems even with these hacks...

The problem to me seems to be simple. when i select a link in my joomla menu (linking to a VM catagory page) it copies those links in the breadcrumbs. For example:

[Menu]
lorum
|_ ipsum (this links to VM kitchen -> food -> bread)

The bread crumbs ALWAYS begin with lorum -> ipsum

so i get this: lorum -> ipsum -> Kitchen -> food -> bread

HOW DO I REMOVE (make invisble) the Joomla breadcrubs/pathway, so that only the VM breadcumbs show?

merryterry
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Dec 04, 2009 1:26 pm

Re: Virtue Mart Breadcrumb problem

Post by merryterry » Fri Dec 04, 2009 1:29 pm

Thank you, lemon! Your solution worked for me.

robeysan
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Sep 22, 2009 9:03 pm

Re: Virtue Mart Breadcrumb problem

Post by robeysan » Tue Feb 02, 2010 11:13 pm

snippio wrote:Hello,
Just replace the function vmAppendPathway (in mainframe.class.php) by this one (starts on line 354):
<CODE><.CODE>
This is a 100% fix. It works for unlimited productlevels and the Virtuemart breadcrumb keeps working.
Make me happy and please report whether this was a usefull tip!!!
Bye!
Thijs
In order to get snippo's code to work (Remove Duplicate Breadcrumbs) I had to change the conditions of his if statement so that it didn't start adding links to the $pathway right away.

Since I had two categories that were duplicating i had to change

Code: Select all

if($i>0)
					{	$cmsPathway->addItem($item->name, str_replace('&', '&', $item->link) );
					}
to this

Code: Select all

if($i>=2)
					{	$cmsPathway->addItem($item->name, str_replace('&', '&', $item->link) );
					}
This keeps VM from adding the first two virtuemart pathway items to $cmspathway.

This works for me because all of my shop categories are only nested 1 deep, that being said you will probably have to customize this code for your specific needs...



Replace the function vmAppendPathway (in mainframe.class.php) by this one (starts around line 354):

Code: Select all

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 );
		}
	}

goltoof
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Sat Jun 16, 2007 2:37 am

Re: Virtue Mart Breadcrumb problem

Post by goltoof » Fri Feb 12, 2010 3:18 am

I was disheartened to see this topic end abruptly after trying everything in it to no avail.

Then I found this at the VM forum and it fixed my issue:
http://forum.virtuemart.net/index.php?topic=58555.0

marion04
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Oct 16, 2006 7:28 pm

Re: Virtue Mart Breadcrumb problem

Post by marion04 » Mon Mar 08, 2010 12:27 pm

Thank you so much robeysan - the fix in the VM forum did not help - your code did!

da3020
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Mar 11, 2010 10:07 pm

Re: Virtue Mart Breadcrumb problem

Post by da3020 » Thu Mar 11, 2010 10:14 pm

jjepson's method works fine for me. And product name at end still displayed.
ThankYou!!! :D

info24h
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Mar 22, 2010 8:38 am

Re: Virtue Mart Breadcrumb problem

Post by info24h » Mon Mar 22, 2010 8:44 am

It very easy:

referent it:

http://www.info24h.net/joomla/duplicated-breadcrumbs

Dont forgot thanks me :-[
Best regard

markmerk
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Oct 20, 2009 2:16 pm

Re: Virtue Mart Breadcrumb problem

Post by markmerk » Wed Jun 16, 2010 6:56 pm

I have 4 nested categories and worked OK!!
Changing

Code: Select all

if($i>=2 
to

Code: Select all

 if($i>=4
Thanks robeysan and all!


Locked

Return to “Extensions for Joomla! 1.5”