sim.plified.com

Chris Pollock

Chris Pollock - web developer (PHP/mySQL & ASP.NET)
undivided… my thoughts on world, family, church, business, technology and Jesus Christ (all in all)

Magento: Jump back to Payment Screen when Payment Declined

On my installation of Magento, I wanted to return the user to the payment screen when their card was declined.  This is a bit of a hack, but it does work.  I simply inserted some custom JavaScript into the opcheckout.js file which is located in /skin/frontend/default/default/js/

I searched my error message for the word "declined" and based on that, push the user back to the payment screen just before showing the alert box.

if (msg.indexOf("declined") > -1)
{
     checkout.accordion.openSection('opc-payment');
}

I insert this around line 760, right before the "alert(msg)".

 

Technorati Tags:

No Comments, Comment or Ping

Reply to “Magento: Jump back to Payment Screen when Payment Declined”

Things I see

Building a SnowmanBuilding a SnowmanBuilding a SnowmanCrying about the SnowmanIMG_0860Couch JumpingCouch JumpingIMG_0848IMG_0840IMG_0805IMG_0804IMG_0750IMG_0749IMG_0805IMG_0804

Chris Pollock

Web Developer - proficient in both PHP and ASP.NET.
Rochester, New York

View my web developement site.

View Chris Pollock's LinkedIn profile

My Pictures

Building a SnowmanBuilding a SnowmanBuilding a SnowmanCrying about the SnowmanIMG_0860Couch JumpingCouch JumpingIMG_0848IMG_0840IMG_0805IMG_0804IMG_0750IMG_0749IMG_0805IMG_0804