VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: SteP[IT] on November 12, 2015, 15:21:04 PM

Title: Small issue in cart "continue shopping" link: lang attribute is not passed to.
Post by: SteP[IT] on November 12, 2015, 15:21:04 PM
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...) <-
Title: Re: Small issue in cart "continue shopping" link: lang attribute is not passed to.
Post by: SteP[IT] on November 13, 2015, 10:31:16 AM
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
Title: Re: Small issue in cart "continue shopping" link: lang attribute is not passed to.
Post by: Milbo on November 13, 2015, 14:44:20 PM
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
Title: Re: Small issue in cart "continue shopping" link: lang attribute is not passed to.
Post by: SteP[IT] on November 13, 2015, 17:17:51 PM
uhm.. it makes sense :) but what about the lang variable not passed to? It this made voluntary too?
Title: Re: Small issue in cart "continue shopping" link: lang attribute is not passed to.
Post by: Milbo on November 15, 2015, 11:08:59 AM

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.
Title: Re: Small issue in cart "continue shopping" link: lang attribute is not passed to.
Post by: SteP[IT] on November 15, 2015, 11:22:55 AM
Yes, I already saw that code portion... right now it returns none if you have only one active lang