Change the continue shopping link destination in Virtuemart for Joomla

If you are simply looking to find where to change the link destination of the "continue shopping" button in your virtuemart online shop and weren't looking to become an expert in PHP then here is what you can do.

This solution will simply allow you to paste a static URL in the right sport to direct the continue shopping button in virtuemart to that location, which means it won't be very dynamic and will direct all users who click the continue shopping button to that specific page no matter where they were before.

If your ok with the read on (I personally have my continue shopping button pointed to the main browse page which shows all the categories that's a pretty good place for the user to return to after clicking).

To change the continue shopping link location:
1) Find the file /administrator/components/com_virtuemart/html/shop.cart.php
2) Edit the file and look for the code:

$continue_link = '';
if( !empty( $category_id)) {
        $continue_link = $sess->url( $_SERVER['PHP_SELF'].'?page=shop.browse&category_id='.$category_id );
elseif( empty( $category_id) && !empty($product_id)) {
        $db->query( 'SELECT `category_id` FROM `#__{vm}_product_category_xref` WHERE `product_id`='.intval($product_id) );
        $category_id = $db->f('category_id');
        $continue_link = $sess->url( $_SERVER['PHP_SELF'].'?page=shop.browse&category_id='.$category_id );
elseif( !empty( $manufacturer_id )) {
        $continue_link = $sess->url( $_SERVER['PHP_SELF'].'?page=shop.browse&manufacturer_id='.$manufacturer_id );

That's pretty complicated PHP which allows the behaviour of the continue shopping button to change depending on circumstances. If you just want to point it to a static page when people click it, just replace the above code (and only that code !) with this:

$continue_link = '';

Obviously "" is where you put the page you want people to land on when they click on the continue shopping link in your Joomla virtuemart online shop.

Posted in You too can (how to articles)