0

I've been trying to fix my website and I don't seem to be getting anywhere - I updated Magento to 1.7 from 1.6, and now I'm having a problem with the OnePageCheckout extension.

When I get to the shipping details page and click the Place Order Now button, the JavaScript console returns this error:

Uncaught TypeError: Cannot read property 'save' of undefined 

The buttons action is currently:

checkout.save(); return false;

The HTML+JavaScript for this is:

    <div id="checkout-review-submit">    
            <div class="buttons-set" id="review-buttons-container">
    <button type="submit" title="Place Order Now" class="button btn-checkout" onclick="checkout.save(); return false;">Place Order Now</button>
        <span id="review-please-wait" style="display:none;float:right;">
            <img src="http://odilynch.com/skin/frontend/em0028/default/images/opc-ajax-loader.gif" alt="Submitting order information..." title="Submitting order information..." class="v-middle" /> Submitting order information...            </span>
    </div>
</div>
</div>
</div>
<input type='submit' id='opc_submit_form' style='visibility:hidden;' />
</div>
</form>

<script type="text/javascript">
//<![CDATA[
var checkout = new OPC('onepagecheckout_orderform', {
    save    : 'http://odilynch.com/index.php/onepagecheckout/index/saveOrder/',
    update  : 'http://odilynch.com/index.php/onepagecheckout/index/updateCheckout/',
    success : 'http://odilynch.com/index.php/onepagecheckout/index/success/',
    failure : 'http://odilynch.com/index.php/checkout/cart/',
    persistent : ''
}, "Please agree to all the terms and conditions.");


document.observe("dom:loaded", function() {
    var win_triggers    = Array();
    $$('.checkout-agreements .agree a').each(function(item){
        var obj = {
            el: $$('.' + item.className),
            event: 'click',
            window: $(item.className + '-window')
        };
        win_triggers.push(obj);
    });
    opc_window  = new OPC.Window({triggers: win_triggers});
});
//]]>
</script>
halfer
  • 19,824
  • 17
  • 99
  • 186
Declan Land
  • 639
  • 2
  • 11
  • 27
  • save is not a function, its a property of checkout object, can u post a fiddle – Developer Nov 06 '14 at 09:58
  • I can give you the URL? http://www.odilynch.com - thank you – Declan Land Nov 06 '14 at 10:00
  • in which file (file name)is the script writtrn in ? instead of save, should it be saveMethod - check this http://magento.stackexchange.com/questions/1479/continue-button-not-moving-to-next-section – Developer Nov 06 '14 at 10:05
  • It is onepagecheckout.phtml - thank you – Declan Land Nov 06 '14 at 10:08
  • http://magento.stackexchange.com/questions/30640/during-checkout-button-continue-doesnt-work?rq=1 http://iamrookie.com/blog/333/magento-checkout-error-undefined-js-alert-place-order.html – Developer Nov 06 '14 at 10:20

0 Answers0