gpt4 book ai didi

javascript - 结帐页面上的 Magento setAttribute 错误

转载 作者:行者123 更新时间:2023-11-30 12:58:57 26 4
gpt4 key购买 nike

好的,当您“继续结帐”时,它会为您提供以下列表:

  1. 结帐方法
  2. 账单信息
  3. 运输信息
  4. 运输方式
  5. 付款信息
  6. 订单审核

默认情况下,结帐方法应该下拉,当您点击“继续”时,帐单信息将下拉,类似于:http://www.plazathemes.com/demo/ma_musicgear/index.php/checkout/onepage/

但是,当我转到该页面时,结帐方法不会下拉,每当我点击它时,什么也没有发生。现在这些都是我的 JS 错误:

Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5644
2
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5653
Uncaught TypeError: Object [object Object] has no method 'setAttribute' clearchannel.halfoffdeals.com/index.php/checkout/onepage/:349
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5644
Uncaught TypeError: Object [object Object] has no method 'observe' opcheckout.js:236
Uncaught TypeError: Object [object Object] has no method 'setAttribute' clearchannel.halfoffdeals.com/index.php/checkout/onepage/:544
Uncaught TypeError: Object [object Object] has no method 'observe' opcheckout.js:374
Uncaught TypeError: Object [object Object] has no method 'observe' opcheckout.js:537
Uncaught TypeError: Object [object Object] has no method 'getElementsByTagName' prototype.js:5010
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5653
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:828
Uncaught TypeError: Object [object Object] has no method 'dispatchEvent'

这些与此有什么关系吗?由于 Bootstrap ,我从原型(prototype)中获取了所有的 attachEvent 和 blah blah。我不知道如何解决这个问题,所以我目前将其搁置。我猜 setAttribute 肯定是导致问题的原因?

感谢任何帮助..

我不知道这是否有任何帮助,但在您点击“继续结帐”之前的购物车页面上,它在 ESTIMATE SHIPPING AND TAX 下列出了“州/省”标签,但没有选择/输入box.. 所以它在结帐页面上显示为无效的 region_id:

因此 SetAttribute 错误来自此部分:

                        <div class="field">
<label for="shipping:region" class="required"><em>*</em>State/Province</label>
<div class="input-box">
<select id="shipping:region_id" name="shipping[region_id]" title="State/Province" class="validate-select" style="display:none;">
<option value="">Please select region, state or province</option>
</select>
<script type="text/javascript">
//<![CDATA[
$('shipping:region_id').setAttribute('defaultValue', "");
Uncaught TypeError: Object [object Object] has no method 'setAttribute'
//]]>
</script>
<input type="text" id="shipping:region" name="shipping[region]" value="" title="State/Province" class="input-text " style="display:none;" />
</div>
</div>

它说 $('shipping:region_id') 没有方法 setAttribute..

最佳答案

@ROMMEL 帮助解答了这个问题。这些是我为解决问题所采取的步骤:

  • 将其放入 jquery-noconflict.js 文件中:jQuery.noConflict();
  • 将其添加到
  • 中的 jQuery.js 文件之后

完成! =) 犯了很多错误,人们说 Bootstrap 和原型(prototype)相互干扰。发出 noConflict() 后所有这些错误都消失了!

关于javascript - 结帐页面上的 Magento setAttribute 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17973132/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com