I have a problem with my one page checkout in my Magento store. The store is not yet launched so all products are demo, but I can't seem to solve this issue. At page load I get

ReferenceError: billing is not defined @ line 1772

It's inline javascript. Here is the troublesome code below:

billing.onSave = function(evt){
    new Ajax.Updater('onepage-checkout-shipping-method-additional-load', 'http://purchaseblack.com/checkout/onepage/getAdditional/', {onSuccess: function() {
    }.bind(this), evalScripts:true});


When I then use this page, nothing else related to finishing the checkout process works, and I get more, new errors. My question is this:

How do I define billing? What file(s) do I need to edit to ensure that billing is defined properly and permanently?

Hopefully, this is the root of the other errors, and I can move on to the next set of issues.

This is my first post and I am pretty new, so bear with me here. If there is any info I can provide to help you help me, let me know.

1 Answer 1


You are missing the inline javascript code that defines the billing variable. Compare the billing.phtml files in your current theme against the ones in:



You should see similar to below:

<script type="text/javascript">
    var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
    var billingForm = new VarienForm('co-billing-form');

    //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
    $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

    var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
  • Perfect! this worked for me
    – user2411
    Commented Dec 25, 2013 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.