Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento one page checkout- getting TypeError: checkout undefined (in opcheckout.js)

One page checkout was working properly about a week ago and now its not. I am no doubt at fault, because I was still having an issue related to the admin backend, and I probably fouled this up somehow in the process of working on that.

In any case, what happens is that when a (logged in, registered) user clicks on the "Continue" button in the Billing Information step of the one page checkout, its as if the button was not clicked. It doesn't proceed to the next step. And the error console (in Firefox) reports "TypeError: checkout is undefined", and it shows line 303 in opcheckout.js.

This problem is very similar to another one posted on SO but (a) that one isn't really answered and (b) I don't have a high enough score to comment (or add to to the question there).

While a solution would be wonderful, I am also really trying to learn how to debug this myself. I have already applied many magento solutions that I've found by googling (for other problems) and, though they work and that's the main thing, I am starting to want to be able to solve my own problems. And maybe even be able to help others eventually...

So, in this case, given that "checkout in undefined", how might I find where it should get defined?

like image 333
Ben Dugan Avatar asked Nov 04 '22 03:11

Ben Dugan


1 Answers

In my case, the /skin/frontend/base/default/js/opcheckout.js file did not match the one in /skin/frontend/[yourpackage]/[yourtheme]/js/opcheckout.js as pspahn suggested. The .js file in my theme was completely blank. Copying the contents over fixed everything up. Commenting here for visibility for others who might be searching.

like image 130
Sam Avatar answered Nov 14 '22 23:11

Sam