Author Topic: Adding redirect to another site when standard payment selected  (Read 142 times)

Mattybee

  • Beginner
  • *
  • Posts: 3
  • A beginner
Adding redirect to another site when standard payment selected
« on: November 28, 2018, 01:13:39 am »
Hi,

I'm using joomla 3.9 and vm 3.2.13

I am trying to set the standard payment method to redirect after the customer has finalised their order to direct them to another page off my site so they can fill out a form for credit, the customer does not need to be redirected afterwards

I have tried searching for any info on how to do this but couldn't find anything I thought was relevant.

I assume it is just a simple line of code at the end and any help would be great thanks.

Thanks,
Matt.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8558
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Adding redirect to another site when standard payment selected
« Reply #1 on: November 28, 2018, 08:48:13 am »
It would be a standard joomla redirect in an orderdone.php template override after checking/filtering for the correct payment method
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Mattybee

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: Adding redirect to another site when standard payment selected
« Reply #2 on: November 28, 2018, 22:11:35 pm »
Ahhh thank you, that makes sense.

Do you know what code I would need to add?

I know how to set up an override.

Thanks,

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8558
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Adding redirect to another site when standard payment selected
« Reply #3 on: November 28, 2018, 22:36:28 pm »
$mainframe = JFactory::getApplication();
$mainframe->redirect('https://xxx.com');

don't know if it works with external urls otherwise use a JS redirect

<script>document.location.href='https://xxx.com';</script>
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Mattybee

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: Adding redirect to another site when standard payment selected
« Reply #4 on: November 29, 2018, 00:17:27 am »
Hi,

the below line worked great thank you :)

I ended up adding it to post_payment.php under standard vmpayment.

<script>document.location.href='https://xxx.com';</script>

One last question how would I get this to only trigger when the order is flagged as confirmed by shopper please :)

You have been so much help.