VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: mrmysterious on February 21, 2018, 01:41:22 AM

Title: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: mrmysterious on February 21, 2018, 01:41:22 AM
Hello,

after I have done a search on this issue I consider the solutions given not to be suitable for vm3.

Example this message:

http://forum.virtuemart.net/index.php?topic=108148.msg361729#msg361729 (http://forum.virtuemart.net/index.php?topic=108148.msg361729#msg361729)

The code given has to have been rewritten and is not to find in the given locations.

But that can't be such hard work to do for a php professional virtuemart expert.

So where to change location for "continue shopping" link in the modal pop up window.

In my case customers just need to stay on the current page.

Regarding to many people asking this it should be a problem many are interested in its solution.

cheers
mrm
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: jenkinhill on February 21, 2018, 11:15:40 AM
I use this method where staying on the same page is requested.

Edit and override components/com_virtuemart/views/cart/tmpl/padded.php

Find:

echo '<a class="continue_link" href="' . $this->continue_link . '" >' . vmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';


Replace with:

$continue_link = $_SERVER['HTTP_REFERER'];
$this->continue_link = $continue_link;
echo '<a class="continue_link" href="' . $this->continue_link . '" >' . vmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
[code]
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: Studio 42 on February 21, 2018, 15:42:25 PM
You can remove the link and add modal close javascript if you prefer to not override original PHP
For eg:
jQuery('.continue_link').click(function(e){
e.preventDefault();
  jQuery.fancybox.close();
});
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: mrmysterious on February 21, 2018, 16:45:00 PM
Thank you both for the good solutions.
I will try them.

I would suggest for further vm versions to invent a configuration menu to edit all those important routings in the backend.

cheers
mrm
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: mrmysterious on February 26, 2018, 20:35:26 PM
@jenkinhill:

How to prevent that edited padded.php from being replaced by a future vm update?

cheers
mrm
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: mrmysterious on February 26, 2018, 21:12:16 PM
@studio 42

Where to put your code instead of padded.php?

cheers
mrm
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: jenkinhill on February 27, 2018, 00:13:22 AM
As I said  "Edit and override components/com_virtuemart/views/cart/tmpl/padded.php"  The override file should be placed in templates/[your-Joomla-template]/html/com_virtuemart/cart/ then it does not get overwritten.
https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: mrmysterious on February 27, 2018, 01:12:38 AM
Thank you - didn't quite catch that "override"...but now it's clear.
Title: Re: How to reroute the "continue shopping" link in the modal pop-up window?
Post by: bryanearl on April 13, 2019, 01:08:12 AM
Quote from: Studio 42 on February 21, 2018, 15:42:25 PM
You can remove the link and add modal close javascript if you prefer to not override original PHP
For eg:
jQuery('.continue_link').click(function(e){
e.preventDefault();
  jQuery.fancybox.close();
});


Sorry to reopen an old thread, but I did as you advised to change the "Continue Shopping" link to a simple modal close. However, now the ajax cart does not auto update unless I refresh the page... Any advice on what I could add to trigger the ajax cart refresh upon closing the modal window?

Here is the code I used:

echo '<a class="continue" href="javascript:void(0);" onclick="jQuery.fancybox.close();" >' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>&nbsp;&nbsp;';