【发布时间】:2013-03-20 18:41:31
【问题描述】:
我正在努力向 Magento Onepage Checkout 添加一个部分,在遇到许多问题后,我返回并删除了所有模块和所有附加到它们的文件。我回到结帐,现在一切正常,除了“继续”按钮在我登录时卡在计费部分。我相信它已连接到 onclick="billing.save() 内联函数。我是 Magento 的新手,也是 Stack Overflow 的新手,所以这是我的 billing.phtml 代码。如果需要更多信息或者我错过了其中的一些细节,请告诉我post。我很想学习如何在 StackOverflow 中正确提问,以便充分利用这个网站。
*****
<div class="buttons-set" id="billing-buttons-container">
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
<button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
<span class="please-wait" id="billing-please-wait" style="display:none;">
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
</span>
</div>
*****
<script type="text/javascript">
//<![CDATA[
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');
//]]>
</script>
非常感谢任何帮助。提前致谢!
【问题讨论】:
-
仅供参考,Magento 现在拥有自己的 StackExchange 站点:magento.stackexchange.com
-
谢谢,我发过去。
-
如果有任何javascript错误,您可以检查firebug控制台吗?
-
哇,我不敢相信我之前没看过。所以它说
Type Error: "checkout" is undefined onclick()我假设这与加载JS文件的时间有关。如果我理解它,应该在头部加载 JS 文件,而这个内联代码应该在正文中,这意味着它应该理解内联的“onclick”功能。我还缺少其他东西吗?
标签: php magento magento-1.7