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

Love that night field magic #littleleague #baseballHow many times do I have to tell you. No ski helmets at the dinner table @amylpollock #lifewithboysBuffalo waterfrontMorning bike rides with my oldest. Loving this extended summer.Giving him the family pack of toilet paper rolls to build towers with seemed like a good idea when I was getting IN the shower. Not so good after :joy: #lifewithboys"Where's Lucas...?. #lifewithboysThis little piggy went to the 19th ward market......#19thwardmarket.The prettiest cluster of grapes picked today. They're ripe. Anyone want any?? Thanks for helping Levi!!Can't beat this 10day #rochesterny #forecast@southsidelittleleague 12U Hayes defeats Eastside 25-8. Beautiful evening for baseball.Things I didn't miss about EnglandDeparting TorontoI walked in the front door and said, "it smells like a smoker in here." Then I went the the back yard and found out why. #lifewithboys #funwiththesunCaleb pitched two innings. His team beat Pittsford 15-3.#cyclocross in Rochester

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

Love that night field magic #littleleague #baseballHow many times do I have to tell you. No ski helmets at the dinner table @amylpollock #lifewithboysBuffalo waterfrontMorning bike rides with my oldest. Loving this extended summer.Giving him the family pack of toilet paper rolls to build towers with seemed like a good idea when I was getting IN the shower. Not so good after :joy: #lifewithboys"Where's Lucas...?. #lifewithboysThis little piggy went to the 19th ward market......#19thwardmarket.The prettiest cluster of grapes picked today. They're ripe. Anyone want any?? Thanks for helping Levi!!Can't beat this 10day #rochesterny #forecast@southsidelittleleague 12U Hayes defeats Eastside 25-8. Beautiful evening for baseball.Things I didn't miss about EnglandDeparting TorontoI walked in the front door and said, "it smells like a smoker in here." Then I went the the back yard and found out why. #lifewithboys #funwiththesunCaleb pitched two innings. His team beat Pittsford 15-3.#cyclocross in Rochester