You are trying to define an invalid handler
and block
in checkout.xml
.
You are using a handler that magento do not understand. i e.
<checkout_onepage_pay />
What you have done here is you are used an invalid handler instead of actual handler <checkout_onepage_failure />
. Magento looks for this handler when onepage checkout fails. When magento enquires handler, its not present in your layout file. Hence it throws an error.
Also your block is also invalid (Most probly). i e
<block type="checkout/onepage_pay" name="checkout.pay" template="checkout/onepage/pay.phtml"/>
This block tells magento that, whenever a onepage checkout failure occurs (Assumes your handler is <checkout_onepage_failure />
), you have to look for a block Mage_Checkout/Block/Onepage/Pay.php
. Hence Magento fails to load this block type, since it is not defined. In default case the block that magento looking for will be Mage/Checkout/Block/Onepage/Failure.php
and it DOES exist.
From your question, its difficult to understand what you are looking for. There may be two cases
- You are trying to create a custom checkout onepage failure template
If that is the case you have to do this handler.
<checkout_onepage_failure translate="label">
<label>One Page Checkout Failure</label>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="content">
<block type="checkout/onepage_failure" name="checkout.failure" template="path/to/your/custom/template.php"/>
</reference>
</checkout_onepage_failure>
You just need to alter the template
part of default block.
- You may trying to set a payment method page
If that is the case, then you need to use this handler
<checkout_onepage_paymentmethod>
<remove name="right"/>
<remove name="left"/>
<block type="checkout/onepage_payment_methods" name="root" output="toHtml" template="checkout/onepage/payment/methods.phtml">
<action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
</block>
</checkout_onepage_paymentmethod>
This code snippet is from app/design/frontend/base/default/layout/checkout.xml
. Make changes to content of this handler.
Note: Whatever be the reason, it is not a good practice to change the the files that resides in the location app/design/frontend/base/default
. Set a new package and theme and make changes to the directory app/design/frontend/<your_package>/<your_theme>/
Yes this is the file.
This file contains JavaScript class definitions for the following:
- Checkout
- Billing
- Shipping
- ShippingMethod
- Payment
- Review
For each step you have a save
method that does several things, including the AJAX call to the controller.
For example, for the ShippingMethod, this method looks like this:
save: function(){
if (checkout.loadWaiting!=false) return;
if (this.validate()) {
checkout.setLoadWaiting('shipping-method');
var request = new Ajax.Request(
this.saveUrl,
{
method:'post',
onComplete: this.onComplete,
onSuccess: this.onSave,
onFailure: checkout.ajaxFailure.bind(checkout),
parameters: Form.serialize(this.form)
}
);
}
},
When the AJAX call is successfull, the code call the onSave
binded event listener:
this.onSave = this.nextStep.bindAsEventListener(this);
The nextStep
is the method that handle the AJAX response:
nextStep: function(transport){
if (transport && transport.responseText){
try{
response = eval('(' + transport.responseText + ')');
}
catch (e) {
response = {};
}
}
if (response.error) {
alert(response.message);
return false;
}
if (response.update_section) {
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
}
payment.initWhatIsCvvListeners();
if (response.goto_section) {
checkout.gotoSection(response.goto_section, true);
checkout.reloadProgressBlock();
return;
}
if (response.payment_methods_html) {
$('checkout-payment-method-load').update(response.payment_methods_html);
}
checkout.setShippingMethod();
}
Best Answer
So just to let those who have similar issues know, the problem was with the GeoLocation Currency Converter extension. It did override some files, but more importantly, the
review
variable was not defined intemplates/checkout/onepage/review.phtml
. Uninstalling the extension and restoring some template files did the trick.