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

Day 2: the back yard is swarming with fluffy tailed rodents. The boys are delighted. There is ample GoPro footage of inquisitive squirrel faces. Caleb was even hand feeding. #lifewithboysOwl pellet dissection is an interesting experience!! It was almost like archaeology, but different in the “this was puked up by a bird” kind of way :stuck_out_tongue:. #lifewithboys #owlbranddiscoverykits #biologyDoes baiting squirrels with Cheerios and observing their behavior count as biology? We are studying mammals after all. :smile:#citysquirrels #lifewithboys #backyardwildlifePhotoSushi for 9 courtesy of @amylpollockSomewhere, deep down inside, I’m thankful that they can cook their own breakfast:raised_hands:. But parenting is filled with such conflicting emotions. :yum: #lifewithboys #cleanupyourmess #wafflesShearing my sheep today :sheep:! #lifewithboys #This is for my friends who don’t live in upstate ny #snowCaleb’s birthday lunch. Now I have two teenagersBeautiful upstate NY #home#Repost @andrewpetersonmusic ・・・ The Burning Edge of Dawn is on sale for $5.99 through this Thursday, anywhere you buy music online!Classic PhotoDinner with the Jobs :grinning:Worn down by the world.

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

Day 2: the back yard is swarming with fluffy tailed rodents. The boys are delighted. There is ample GoPro footage of inquisitive squirrel faces. Caleb was even hand feeding. #lifewithboysOwl pellet dissection is an interesting experience!! It was almost like archaeology, but different in the “this was puked up by a bird” kind of way :stuck_out_tongue:. #lifewithboys #owlbranddiscoverykits #biologyDoes baiting squirrels with Cheerios and observing their behavior count as biology? We are studying mammals after all. :smile:#citysquirrels #lifewithboys #backyardwildlifePhotoSushi for 9 courtesy of @amylpollockSomewhere, deep down inside, I’m thankful that they can cook their own breakfast:raised_hands:. But parenting is filled with such conflicting emotions. :yum: #lifewithboys #cleanupyourmess #wafflesShearing my sheep today :sheep:! #lifewithboys #This is for my friends who don’t live in upstate ny #snowCaleb’s birthday lunch. Now I have two teenagersBeautiful upstate NY #home#Repost @andrewpetersonmusic ・・・ The Burning Edge of Dawn is on sale for $5.99 through this Thursday, anywhere you buy music online!Classic PhotoDinner with the Jobs :grinning:Worn down by the world.