VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Rookie232 on September 18, 2012, 22:04:51 PM

Title: Continue Shopping link...
Post by: Rookie232 on September 18, 2012, 22:04:51 PM
When you view cart you are given the option to continue shopping via a link. This link takes you to a category page or such. The site I am building is very straight forward and I would like the customer to go back to the store front page. Is there a way to change this link? Thanks!!!

Title: Re: Continue Shopping link...
Post by: chetanmadaan on September 18, 2012, 23:48:45 PM
Look into file:
[/b]For popup [/b]
JOOMLA_ROOT/components/com_virtuemart/controllers/cart.php (function) "addJS"

and search for variable "$continue_link" The link actually varies based on where you are... if you are in a category... it links to the category...

You may also look for function: prepareContinueLink in file "components/com_virtuemart/views/cart/view.html.php"
Title: Re: Continue Shopping link...
Post by: Rookie232 on September 19, 2012, 01:38:18 AM
Thanks! I found the code that changes it but can not figure out what link to put there to get me back to where I need to be. I can get it to redirect to a number of pages but not the right one.

Here is a link to my test site can you discern what link I should add?  Thanks!


http://www.nebulacompany.com/Clients/cdc/index.php/order-online
Title: Re: Continue Shopping link...
Post by: Rookie232 on September 20, 2012, 23:20:06 PM
Does anyone have an idea of the correct link for this workaround? Thanks!!
Title: Re: Continue Shopping link...
Post by: cmb on October 15, 2012, 22:44:10 PM
Apparently there is no mechanism within Joomla to override the \components\com_virtuemart\views\cart\view.html.php file directly.

Option A. Do a core hack and then reapply the changes every time you update VirtueMart.

Option B. The better method is to override \components\com_virtuemart\views\cart\tmpl\default.php. (The modified file will be at \templates\<mytemplate>\html\com_virtuemart\cart\default.php.) Then replace the code that references continue_link_html at line 70 of \components\com_virtuemart\views\cart\tmpl\default.php with the modified code lifted from the view.html.php file. In case there are conflicts, you'll have to rename the PHP variables.

I haven't tried Option B but as a test, I implemented the Option A core hack.

At or near line 170 of view.html.php you will find:
$continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryLink);

I changed that to:
$continue_link = JRoute::_('index.php?option=com_virtuemart&view=virtuemart');

That links back to the VirtueMart front page.

VirtueMart 2.0.12b, Joomla 2.5.7