VirtueMart Forum

VirtueMart 2 + 3 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: Genius WebDesign on January 21, 2015, 21:31:16 pm

Title: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on January 21, 2015, 21:31:16 pm
Hello,

Another SEO /SEF related issue..

In my current VM project (VM 3.0.0) I have set the cart page to a menu item with root ALIAS "indkobskurv", as I always do with my VM shops.
The idea is to make the cart page associated with a menu item, for menu item specific module assignments, and to always show the cart page with this URL address:  www.mysite.com/indkobskurv

And this works as intended, well almost..
Let me try to explain this as simple as I can:

The first problem is that in all instances the cart URL is generated with /cart  trailing to the URL, as this example:  www.mysite.com/indkobskurv/cart
It should only be: www.mysite.com/indkobskurv

The second problem is a bit more complicated to explain..:
When I click on "Go to cart" from the front page, then the cart URL is:  www.mysite.com/indkobskurv/cart
When I click on "Go to cart" from any Joomla article landing page, then the cart URL is:  www.mysite.com/indkobskurv/cart
But.. when I click on "Go to cart" from any VM category page or product detail page, then the cart URL is:  www.mysite.com/categoryalias/subcategoryalias/cart
(categoryalias and subcategoryalias are of course any given VM category alias for the page that I was on when clicking "Go to cart")

So, it seems that the "Go to cart" link that VM produces changes according to category and/or product detail page, and it does not follow the native Joomla menu item routing behavior.
This needs to be fixed
And, as I mentioned, I need to remove the trailing /cart from the URL.
My goal is simply to make the cart page adhere to a specific Joomla menu item and resolve to: "www.mysite.com/indkobskurv"  in all instances and under all circumstances.

Please someone advice how I fix these issues.
It is very important that I fix this because I need to be able to assign modules and other content specifically for the VM cart page.

P.S.
This may be a problem that only exists in VM3 (and not in VM2xx) because I have never seen this problem before on any previous Virtuemart project I have worked with.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: GJC Web Design on January 22, 2015, 01:24:37 am
have u tried VM3.0.3?  many bug fixes

2nd .. to assign modules to the cart pages I always use either a snippet in the template (detect the view) or there is a module available (advanced VM module or something)
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on January 22, 2015, 14:36:37 pm
Thanks for the answer.
No, I have not tried v3.0.3
Where do I find this upgrade?
On the VM main site there is only 3.0.2...

Regarding module assignment it is very inappropriate that you cannot assign modules to the cart page using the Joomla core menu item system, don´t you think?
Especially when this worked fine in previous versions of Virtuemart.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: jenkinhill on January 22, 2015, 15:01:32 pm
Where I need to assign modules to the cart page I use a hidden menu item for the cart.

VM3.0.3?  As with all files it is on http://dev.virtuemart.net/projects/virtuemart/files
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on January 22, 2015, 16:28:56 pm
"Where I need to assign modules to the cart page I use a hidden menu item for the cart. "

That is exactly what I´m doing, but as you can see I´m having some trouble with the SEF URL.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on January 22, 2015, 16:37:57 pm
To be more specific, when the system generates the "go to cart" URL with:

Code: [Select]
JRoute::_("index.php?option=com_virtuemart&view=cart")
it should always resolve to the alias of the menu item assigned to the cart view, correct?
But in my case it does not always do this.
For some reason, when I´m on product details page or on category page the menu item alias is not in effect.

So this seems to be an issue related to the VM routing framework.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on January 22, 2015, 17:04:53 pm
I have now upgraded VM to the latest version (v3.0.3) and the problem remains the same.

Please advice.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on January 22, 2015, 17:07:36 pm
If some of the developers want to investigate this I´m willing to provide full access to my test site, ofc. both back end and front-end.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: ceitean on February 12, 2015, 23:43:51 pm
Is there any news regarding this issue?  It's not just a SEO problem as one cannot control the designated menu item for the cart location, thereby modules will show in the cart depending on the category view layout and (not looking at all the different urls) the site will look untidy unless one adds the same modules to the actual cart menu item.
thanks
 
Title: Re: Checkout page / Cart page SEF URL problems
Post by: ceitean on March 18, 2015, 14:06:39 pm
Hi again,

Another revisit to this question. Is it just me who has this problem? I'am surprised because if its a general problem, and not something I have completely missed, its a major issue for the use of VM3 as one cannot assign a (hidden) menu item to the cart.
see also:
http://forum.virtuemart.net/index.php?topic=127886.0

thanks, andrew

during testing of VM3.0.0 to VM 3.0.6
J!3.3-3.4
PHP 5.4.31

Title: Re: Checkout page / Cart page SEF URL problems
Post by: jjk on March 18, 2015, 23:09:15 pm
The idea is to make the cart page associated with a menu item, for menu item specific module assignments, and to always show the cart page with this URL address:  www.mysite.com/indkobskurv

I think the only thing you have to do to achieve this is to replace the string "varekurv" in the file da-DK.com_virtuemart.sef.ini with your "indkobskurv" in a language override.

However, to me it makes no sense to insist on a SEF url for a cart view, unless you want Google and other search engines to index your cart view, with the eventual risk that the page is being indexed including one of your customer's data. I've set my cart to NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET
Title: Re: Checkout page / Cart page SEF URL problems
Post by: ceitean on March 19, 2015, 02:46:18 am
Quote
I think the only thing you have to do to achieve this is to replace the string "varekurv" in the file da-DK.com_virtuemart.sef.ini with your "indkobskurv" in a language override.

However, to me it makes no sense to insist on a SEF url for a cart view, unless you want Google and other search engines to index your cart view, with the eventual risk that the page is being indexed including one of your customer's data. I've set my cart to NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET

Thanks for your answer jjk; my issue is not really about SEF url's. I also noindex the cart pages for the same reason you are mentioning (however, since the cart is never assigned to an item (because of the router problem), your no-indexing will have no effect as far as i see and the bots will index them anyway, as the cart is located at the end of all categories and subs across your site). 
Another consequence, as noted earlier in posts, since the cart is added to the current category, one cannot build a clean cart with a customized view (specific sales pitches, or just a clean cart with no other modules). 

I looked at the router now for a few minutes (w/o debugging ide) and see that i must re-set the $query['Itemid']). This fixed my problem.

Code: [Select]
case 'cart';

if ( isset($jmenu['cart']) ) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}

$segments[] = $helper->lang('cart') ;

break;


from this:

Code: [Select]
case 'cart';
if(!isset($query['Itemid'])){
if ( isset($jmenu['cart']) ) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}
}
$segments[] = $helper->lang('cart') ;

break;

line 249.
This is a quick hack that should be corrected properly (although too late for me tonight).

andrew
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Milbo on April 05, 2015, 09:18:13 am
Regarding module assignment it is very inappropriate that you cannot assign modules to the cart page using the Joomla core menu item system, don´t you think?
Especially when this worked fine in previous versions of Virtuemart.

Maybe the reason is not the VM version, maybe it is the joomla version. Do you have the same problem with j2.5? The router changed drastically in j3
Title: Re: Checkout page / Cart page SEF URL problems
Post by: AH on April 05, 2015, 10:56:39 am
Still the same behaviour in VM 3.0.7 and as noted:-

Quote
one cannot build a clean cart with a customized view (specific sales pitches, or just a clean cart with no other modules). 
Title: Re: Checkout page / Cart page SEF URL problems
Post by: kgrzybowski on April 10, 2015, 07:30:39 am
Hi,

I'm having quite the same issue on J 3.4.1 and VM 3.0.7, in cart module (on my homepage) my href to cart looks like this: /cart/cart
but if I'm on any product page it looks this way: /some-category/some-other-category/product-name-details/cart
and on my vm default view it looks: /shop-default-page/cart

I have menu position assigned to cart and it's always present at the top of the page and it's fine there, I mean it's always /cart as it should be, so SEF is wrong only in cart module and in cart popup window (after adding product to cart).

Best regards,
Chris
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on April 10, 2015, 10:46:14 am
For max,
The virtuemart router is bugged, i have changed back to old way (virtuemart 2.6) for the cart and solved my problem.
the code is similar to the code Posted by: ceitean, i have give the same reply for another case in the forum.

in vm 2.6
Code: [Select]
if ( isset($jmenu['cart']) ) $query['Itemid'] = $jmenu['cart'];
else {
$segments[] = $helper->lang('cart') ;
$query['Itemid'] = $jmenu['virtuemart'];
}
in vm 3.0.6.2
Code: [Select]
if(!isset($query['Itemid'])){
if ( isset($jmenu['cart']) ) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}
}

I don't have found why someone have change this in  the 3.0.x version ? For the old version, you can always fix your problems on adding a hidden menu link, not for the the new version.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: kgrzybowski on April 10, 2015, 12:05:51 pm
For max,
The virtuemart router is bugged, i have changed back to old way (virtuemart 2.6) for the cart and solved my problem.
the code is similar to the code Posted by: ceitean, i have give the same reply for another case in the forum.

in vm 2.6
Code: [Select]
if ( isset($jmenu['cart']) ) $query['Itemid'] = $jmenu['cart'];
else {
$segments[] = $helper->lang('cart') ;
$query['Itemid'] = $jmenu['virtuemart'];
}
in vm 3.0.6.2
Code: [Select]
if(!isset($query['Itemid'])){
if ( isset($jmenu['cart']) ) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}
}

I don't have found why someone have change this in  the 3.0.x version ? For the old version, you can always fix your problems on adding a hidden menu link, not for the the new version.

Yes! This fixed my issue, thank you very much!
Title: Re: Checkout page / Cart page SEF URL problems
Post by: HenrikS on April 18, 2015, 05:09:50 am
I have the same problem, if I enable SEF the registration is not working, if i disable it everything is ok but the urls are crap.

Is there any ETA on when this will be fixed in the router.php file since it has been a problem since VM2.?

I am running Joomla 3.4.1 and VM 3.0.7.4 on a fully updated server with cpanel.

And yes, aio-plugins are also fully updated.

The fix posted here does not work on my installation.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Milbo on April 19, 2015, 13:20:50 pm
Is there any ETA on when this will be fixed in the router.php file since it has been a problem since VM2.?
No, there is a misunderstanding. Vm3 does not always overwrite it with the standard and also accepts the incoming itemId, which can create own problems and j3 reacts again different.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: HenrikS on April 19, 2015, 17:14:14 pm
Any idea how to get VM3 SEF and VM3 registration to work together?

Is there any plugin for this
Title: Re: Checkout page / Cart page SEF URL problems
Post by: HenrikS on April 19, 2015, 22:43:47 pm
Got it working 100% with JoomSEF and the Virtuemart plugin from them   :)

With that SEF component everything is working 100% ok ... Finally  ;)

And the router.php in VM3 does not need to be modified.

Just disable SEF in Virtuemart and let JoomSEF handle everything.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: AH on April 20, 2015, 09:00:18 am
 :'(   Joomsef is in itself another type of nightmare

I steer  clear of these plugins
Title: Re: Checkout page / Cart page SEF URL problems
Post by: HenrikS on April 20, 2015, 14:21:23 pm
I know it is, but it seems to be the only one that will work when you want SEF on your site with Virtuemart.

I tryed with many things and everytime registration dident work but with this plugon it does.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on April 20, 2015, 20:40:55 pm
What i don't understad, is why you cannot make virtuemart work on adding a new menu link to the cart.
Perhaps your site menu link are not conventional ?
Title: Re: Checkout page / Cart page SEF URL problems
Post by: AH on April 20, 2015, 20:51:48 pm
If you hide the menu link because you display the cart in a module position - the cart url varies based on the page you access it from
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on April 22, 2015, 21:09:41 pm
If you hide the menu link because you display the cart in a module position - the cart url varies based on the page you access it from

You have try my patch ? This work if you add a hidden menu link.
When i say a hidden menu, this mean adding a menulink, but not add the module for this menu.

I fixed 4 or 5 times this problem with this code and a hidden menu link
Title: Re: Checkout page / Cart page SEF URL problems
Post by: 2cool on July 06, 2015, 11:51:49 am
Hi, I'm having the same issues with cart.

/winkelwagen (=dutch for cart) is url from menu

/winkelwagen/cart (after adding products to cart)

How can ths be fixed? hidden menu or modify router??
Joomla! 3.4.3 and VirtueMart 3.0.9.4

Thanks and regards,
Pascal
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on July 06, 2015, 16:29:41 pm
Hi,
Tyr first Adding a menu link to cart(hidden or not)
Hi, I'm having the same issues with cart.

/winkelwagen (=dutch for cart) is url from menu

/winkelwagen/cart (after adding products to cart)

How can ths be fixed? hidden menu or modify router??
Joomla! 3.4.3 and VirtueMart 3.0.9.4

Thanks and regards,
Pascal
Title: Re: Checkout page / Cart page SEF URL problems
Post by: 2cool on July 06, 2015, 17:25:13 pm
Hi already have a menu link to vm cart.
Using a top menu with user info and cart.

My guess it has something to do with language, is this related to the router issue?

Regards,
Pascal
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on July 06, 2015, 17:31:31 pm
If you have a multilanguage shop, you have to set menu link to cart for each language
Title: Re: Checkout page / Cart page SEF URL problems
Post by: 2cool on July 06, 2015, 17:35:33 pm
It's not a multi language site, all set to Dutch.
But still adds /cart (english) at cart page??

Regards,
Pascal
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on July 24, 2015, 00:11:57 am
Being the one that started this thread I though I should revisit and tell you all how I fixed the problem.

In the VM router file:
/components/com_virtuemart/router.php

from line 248 - i changed this:
Code: [Select]
case 'cart';
if(!isset($query['Itemid'])){
if ( isset($jmenu['cart']) ) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}
}
$segments[] = $helper->lang('cart') ;

break;


to this:
Code: [Select]
        case 'cart';
        if (isset($jmenu['cart'])) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}

$segments[] = '';

break;


And now I have a beautiful SEF URL for the cart view that adheres to the Joomla menu item set for the cart view, and the trailing "/cart" is gone :)
Hope this comes in handy for others with the same issue.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on July 24, 2015, 01:02:25 am
Hi,
i think the right solution is:

Code: [Select]
                        case 'cart';
                                if (isset($jmenu['cart'])) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
$segments[] = $helper->lang('cart') ;
} else {
                                        // the worst
$segments[] = $helper->lang('cart') ;
}


break;
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Genius WebDesign on July 24, 2015, 13:17:47 pm
Quote
i think the right solution is

Yes indeed, your solution is better with a built in "safety net"
Title: Re: Checkout page / Cart page SEF URL problems
Post by: sandomatyas on March 16, 2016, 07:26:21 am
It seems the problem is still in the latest VM (3.0.14). I checked the source and seems the links of padedd.php are prepared in prepareContinueLink function of VmView helper. As far I can tell this function doesn't  use any JRoute call.
It builds the cart link like this:
Code: [Select]
$this->cart_link = $scheme.'://'.$juri. JURI::root(true).'/index.php?option=com_virtuemart&view=cart'.$lang;If I check the source anywere else, the cart link is prepared like this:
Code: [Select]
JRoute::_('index.php?option=com_virtuemart&view=cart');Is there maybe some reason for that?
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on March 16, 2016, 11:24:18 am
It seems the problem is still in the latest VM (3.0.14). I checked the source and seems the links of padedd.php are prepared in prepareContinueLink function of VmView helper. As far I can tell this function doesn't  use any JRoute call.
It builds the cart link like this:
Code: [Select]
$this->cart_link = $scheme.'://'.$juri. JURI::root(true).'/index.php?option=com_virtuemart&view=cart'.$lang;If I check the source anywere else, the cart link is prepared like this:
Code: [Select]
JRoute::_('index.php?option=com_virtuemart&view=cart');Is there maybe some reason for that?
This was to Fix some problem for some user.
But old version was not a problem at the moment the menu was set corretly and new version have another problem now.
The Joomla menu itemID is not set and you cannot modifiy the cart render now !
So menu , modules ... are same as in HOME page
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Ghost on March 16, 2016, 13:56:37 pm
Try this fix http://forum.virtuemart.net/index.php?topic=133113.msg461925#msg461925
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on March 16, 2016, 18:15:34 pm
WHat i do, is overide of YOURSITE/components/com_virtuemart/views/cart/tmpl/padded.php
And i add after
Code: [Select]
defined('_JEXEC') or die('Restricted access');this line
Code: [Select]
$this->cart_link = jroute::_('index.php?option=com_virtuemart&view=cart');This permit to not hack the core and solve the problem for itemId missing.
Note: if itemId is in a menu only visible from registred user, this is not working !
Title: Re: Checkout page / Cart page SEF URL problems
Post by: chehonte on October 27, 2016, 10:33:07 am
component/com_virtuemart/helpers/vmvew.php

in line 132 and 142

replace with:

line 132) $this->continue_link = JRoute::_ ('index.php?option=com_virtuemart&view=category' . $categoryStr.$ItemidStr, FALSE);
line 142) $this->cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart'.$ItemidStr, FALSE);
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on October 27, 2016, 11:37:21 am
component/com_virtuemart/helpers/vmvew.php

in line 132 and 142

replace with:

line 132) $this->continue_link = JRoute::_ ('index.php?option=com_virtuemart&view=category' . $categoryStr.$ItemidStr, FALSE);
line 142) $this->cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart'.$ItemidStr, FALSE);
THe idea is not bad, but it's better to overide in template this in component/com_virtuemart/views/cart/tmpl/padded.php as i explained in another post
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Milbo on November 02, 2016, 08:28:59 am
The problem are the different methods to setup a joomla menu, in special when there are different languages used.

For example, the most laziest setup is a menu for "all languages" and then extra menues for any language. There you need to setup only the homepage menu item. Any other menu items use then the fallback from the "all language" menu. So in case you have 2 language, you get 3 menues. Others just create 2 complete menus.

and a lot people do not setup any menu item to the cart, because they only show the cart module. So when the menu setup is correct, we can show sefed links, else it creates nonsense. An hidden config is maybe the right solution.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Milbo on November 02, 2016, 08:33:47 am
What about this?
Code: [Select]
if(VmConfig::get('sef_for_cart_links', false)){
$this->continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryStr.$ItemidStr);
$this->cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart');
} else {
$lang = '';
if(VmConfig::$jLangCount>1 and !empty(VmConfig::$vmlangSef)){
$lang = '&lang='.VmConfig::$vmlangSef;
}

$this->continue_link = JURI::root() .'index.php?option=com_virtuemart&view=category' . $categoryStr.$lang.$ItemidStr;

$juri = JUri::getInstance();
$uri = $juri->toString(array( 'host', 'port'));

$scheme = $juri->toString(array( 'scheme'));
$scheme = substr($scheme,0,-3);
if($scheme!='https' and VmConfig::get('useSSL',false)){
$scheme .='s';
}
$this->cart_link = $scheme.'://'.$uri. JURI::root(true).'/index.php?option=com_virtuemart&view=cart'.$lang;
}

$this->continue_link_html = '<a class="continue_link" href="' . $this->continue_link . '">' . vmText::_ ('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on November 02, 2016, 16:48:53 pm
The problem are the different methods to setup a joomla menu, in special when there are different languages used.

For example, the most laziest setup is a menu for "all languages" and then extra menues for any language. There you need to setup only the homepage menu item. Any other menu items use then the fallback from the "all language" menu. So in case you have 2 language, you get 3 menues. Others just create 2 complete menus.

and a lot people do not setup any menu item to the cart, because they only show the cart module. So when the menu setup is correct, we can show sefed links, else it creates nonsense. An hidden config is maybe the right solution.

I use a simple solution for this case.
Add a new menu
name it "hidden links" for eg.
Add all item menu links, cart, category, shop or what ever that has no direct links to it and all is work.
Simply do not add any modules for this menu, so you get sef links but never see the links in you website.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Milbo on November 04, 2016, 19:46:58 pm
I dont like the idea to tell customers how they should build menus. :-) I implemented the version above, at least there is now an hidden config and anyone in this thread can just set the hidden config to have your solution. http://dev.virtuemart.net/attachments/download/1025/com_virtuemart.3.0.18.1_extract_first.zip [reupped]

the version is "stable", we use it on our store, but of course, use always a backup
Title: Re: Checkout page / Cart page SEF URL problems
Post by: Studio 42 on November 04, 2016, 22:41:02 pm
I don't like my solution, but this is needed for any page to have right sef. For Joomla articles or categories or other component, this is the only core solution.
SO this is the generic way to do for Joomla and work always(or perhaps not in Vm in some case).
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on April 29, 2021, 14:15:30 pm
I am sorry for waking up old ghosts here but I have the same cart problem and none of the above solutions doesn't work for me.
After so many years I thought problems would been solved but this is not the case.

I have multilanguage site and I have SEF cart problem which cannot be solved.
In my template I have a mod_virtuemart_cart override with JS and AJAX update.
When I click "show cart" in JS it takes me to: mywebsite.com/sr/cart instead of mywebsite.com/sr/korpa

I tried so far:
- Creating hidden menu for Virtuemart cart for both languages
- Creating visible menu for Virtuemart cart for both languages
- Disabling SEF for cart
- Overriding mod_virtuemart_cart with default file
- Overriding templates/html/com_virtuemart/cart with default files
- Changing language definition for "cart" in my language tag


Nothing works. No matter what I do I always get /cart instad of /korpa URL, thus creating problems with my module positions.
You can check my testing website at gravexcp.mycpanel.rs (http://gravexcp.mycpanel.rs)

Joomla: 3.9.20
VirtueMart 3.8.6 10373
Title: Re: Checkout page / Cart page SEF URL problems
Post by: pinochico on April 29, 2021, 21:09:03 pm
Did you search the router?
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on April 29, 2021, 22:57:06 pm
How do you mean search the router? I have looked under the CASE CART but I didn't find anything unusual over there.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: pinochico on April 29, 2021, 23:00:59 pm
router.php for Virtuemart
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on April 29, 2021, 23:03:35 pm
Yes I know what it is but I don't know what you mean when you say search. I also don't know what should I search for. Everything inside router.php seems normal to me.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on April 30, 2021, 16:10:20 pm
This cart problem is becoming frustrating to me.
PHP debug reports wrong item id at router.php at line 983.
This message is also showing on categories menu.
I am starting to doubt that something is wrong with latest VM release.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on April 30, 2021, 18:57:46 pm
VM routing problem!
Title: Re: Checkout page / Cart page SEF URL problems
Post by: pinochico on May 01, 2021, 09:57:13 am
Do you have hidden menu for virtuemart shop?
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on May 01, 2021, 10:43:28 am
Yes of course. I tried hidden menu, public menu, everything.
Setting up "Transliterate strings" under SEO settings helped with cart but I am still seeing many php itemid error messages for categories menu (when I click show cart).
Let's face it: VM handles multilanguage sites very badly.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: GJC Web Design on May 02, 2021, 09:50:07 am
Quote
Let's face it: VM handles multilanguage sites very badly.

Hardly ..  you have found one minor glitch ...  as u have already over ridden the cart module in the interim simply detect the lang in the over ride and have a fixed lang dependent link to cart..
then contribute to the FREE project by debugging what is going wrong in this particular scenario 
Title: Re: Checkout page / Cart page SEF URL problems
Post by: pinochico on May 02, 2021, 11:04:17 am
Quote
VM handles multilanguage sites very badly

Yes, in our company we know more then 8 years :)
I think in router are still constant from PSSHOP (first standalone app before changed to VirtueMart - Joomla app.)

But for multilanguage shop we use SEF app, then this error is not critical and we don't find solutions.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on May 06, 2021, 00:18:08 am
Quote
Hardly ..  you have found one minor glitch ...  as u have already over ridden the cart module in the interim simply detect the lang in the over ride and have a fixed lang dependent link to cart..
then contribute to the FREE project by debugging what is going wrong in this particular scenario

There is no lang routine in the cart module.

The problem is coming from router.php at line 983:
Code: [Select]
if(self::$_instance->slang != VmLanguage::$currLangTag or (self::$_instance->byMenu and $query['Itemid']!=self::$_instance->Itemid))
I am not an expert for this. You guys are more experienced than me and I would appreciate any help.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: jjk on May 08, 2021, 20:10:19 pm
At present I don't see a javascript error. But perhaps examine the difference in your cart url:
https://gravexcp.mycpanel.rs/sr/component/virtuemart/korpa?Itemid=499
https://gravexcp.mycpanel.rs/en/products-services/cart

If I'm not mistaken, you have a (hidden?) menu item 'cart' in one of your English menus, but not in your Serbian menu.  Do you have the id 499 in your menu list?
And don't forget to clear the Joomla and VirtueMart cache after making changes in the menus.
Title: Re: Checkout page / Cart page SEF URL problems
Post by: nebojsa on May 26, 2021, 20:26:23 pm
Thanks for your reply jjk.
I have "cart" for English menu and "korpa" for Serbian menu. Should I have "cart" for both menus?
Those differences in url that you saw are part of the router problem.
Sometimes it routes in one way and sometimes it routes in another way - depending on where you call the cart from.
There is definitely something wrong with the Multilanguage routing.
As for Itemid=499, I can't find it. How did you managed to get that itemid?