sim.plified.com

Chris Pollock

Chris Pollock - web developer & ecommerce entrepreneur
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:

Things I see

There’s the verse that says “love covers a multitude of sins”, well... so does snow:grimacing::flushed::stuck_out_tongue_closed_eyes:. #mudseason #nograssagain #lifewithboysMicah’s been working on his beard. It’s filling in quite nicely!! #mountainman #lifewithboys #11yearoldswithbeardsSick day for Lucas and therefore the rest of us. It’s nice though to have the windows open!!What a difference a haircut makes! Spock to Simon. #beforeandafter #spockhair #haircut #shearingmysheepCelebrating Chinese New Year with a friend (a little early) with some treats straight from Beijing! Yummy!This greeted me this morning. :heart_eyes: #lifewithboys #ivalentinesdayPhotoApparently my read aloud book was riveting to this guy:yum:. The rest of us enjoyed it though. A historical fiction account of Tyndale’s life by Scott O’Dell. #thehawkthatcouldnothuntbyday #readaloud #historicalfictionPhotoThe current favorite face of the house! It’s a cute one!! #puppylifeYour future pilot :man:‍:airplane:Agamemnon, Menelaus and a reluctant general.History actors take a bowSnow Dog!Camo mom working on her next project.

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

There’s the verse that says “love covers a multitude of sins”, well... so does snow:grimacing::flushed::stuck_out_tongue_closed_eyes:. #mudseason #nograssagain #lifewithboysMicah’s been working on his beard. It’s filling in quite nicely!! #mountainman #lifewithboys #11yearoldswithbeardsSick day for Lucas and therefore the rest of us. It’s nice though to have the windows open!!What a difference a haircut makes! Spock to Simon. #beforeandafter #spockhair #haircut #shearingmysheepCelebrating Chinese New Year with a friend (a little early) with some treats straight from Beijing! Yummy!This greeted me this morning. :heart_eyes: #lifewithboys #ivalentinesdayPhotoApparently my read aloud book was riveting to this guy:yum:. The rest of us enjoyed it though. A historical fiction account of Tyndale’s life by Scott O’Dell. #thehawkthatcouldnothuntbyday #readaloud #historicalfictionPhotoThe current favorite face of the house! It’s a cute one!! #puppylifeYour future pilot :man:‍:airplane:Agamemnon, Menelaus and a reluctant general.History actors take a bowSnow Dog!Camo mom working on her next project.