News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Small issue in cart "continue shopping" link: lang attribute is not passed to.

Started by SteP[IT], November 12, 2015, 15:21:04 PM

Previous topic - Next topic

SteP[IT]

In my website, I have a small issue in cart "Continue shopping" link: the lang attribute is not present at the end of the url. I have made some menu voice ponting to each shop category, to have them routed in readble way: this issue prevent the router to understand that the "continue link" and the relative direct category menu url are the same, displaying a non routed "continue shopping" link in cart.
Is there a way to get it fixed?
Thank you in advance
Regards
-> J 3.4.5 - VM 3.0.12 (but that problem was there since vm 3.0.9 at least...) <-
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

SteP[IT]

I have made a patch to that issue.

Further investigation let me discover that the problem is around VmConfig::$vmlangSef var: in my shop, it's empty (I have a multilingual setup, but use only the main language: this to have the /"lang" segment in site urls anyway, to avoid url change when further languages will be activated).

But I have noticed that I can solve the problem of gettin the "Continue link" correctly routed in a simplest way, making two changes in /components/com_virtuemart/helpers/vmview.php:

1) line 132, changed from

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

to

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

2) line 135, changed from

$this->cart_link = JURI::root().'index.php?option=com_virtuemart&view=cart'.$lang;

to
$this->cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart'.$lang);

This is a "quite rude" patch, I don't know if this issue can be solved in a better manner, but it also solves the SEF routing for the "add to cart" popup window. Could someone confirm that it's the right way to do it, or suggest a better solution?
Thank you in advance
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Milbo

It is on purpose that we do not use SEF there. There is no reason to use SEF from SEM view point. And it makes less trouble this way in j3
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

SteP[IT]

uhm.. it makes sense :) but what about the lang variable not passed to? It this made voluntary too?
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Milbo


if(VmConfig::$langCount>1 and !empty(VmConfig::$vmlangSef)){
$lang = '&lang='.VmConfig::$vmlangSef;
}

It is only set, when you have more than one language set in VM, seems we must check for the number of Jlanguages.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

SteP[IT]

Yes, I already saw that code portion... right now it returns none if you have only one active lang
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it