News:

Looking for documentation? Take a look on our wiki

Main Menu

How to reroute the "continue shopping" link in the modal pop-up window?

Started by mrmysterious, February 21, 2018, 01:41:22 AM

Previous topic - Next topic

mrmysterious

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

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
Joomla!-Version 3.8.5
VirtueMart 3.2.12
Template As002053free (customized)
OS Linux h
PHP 5.6.30
MySQL 5.6.19-67.0-log

jenkinhill

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]
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Studio 42

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();
});

mrmysterious

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
Joomla!-Version 3.8.5
VirtueMart 3.2.12
Template As002053free (customized)
OS Linux h
PHP 5.6.30
MySQL 5.6.19-67.0-log

mrmysterious

@jenkinhill:

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

cheers
mrm
Joomla!-Version 3.8.5
VirtueMart 3.2.12
Template As002053free (customized)
OS Linux h
PHP 5.6.30
MySQL 5.6.19-67.0-log

mrmysterious

@studio 42

Where to put your code instead of padded.php?

cheers
mrm
Joomla!-Version 3.8.5
VirtueMart 3.2.12
Template As002053free (customized)
OS Linux h
PHP 5.6.30
MySQL 5.6.19-67.0-log

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

mrmysterious

Thank you - didn't quite catch that "override"...but now it's clear.
Joomla!-Version 3.8.5
VirtueMart 3.2.12
Template As002053free (customized)
OS Linux h
PHP 5.6.30
MySQL 5.6.19-67.0-log

bryanearl

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;';