简体   繁体   English

结帐页面上的Magento setAttribute错误

[英]Magento setAttribute error on checkout page

Ok so when you "Proceed to Checkout", it gives you a list of : 好的,当你“继续结帐”时,它会给你一个列表:

  1. CHECKOUT METHOD 检查方法
  2. BILLING INFORMATION 账单信息
  3. SHIPPING INFORMATION 运送信息
  4. SHIPPING METHOD 邮寄方式
  5. PAYMENT INFORMATION 支付信息
  6. ORDER REVIEW 订单审核

By default, checkout method is suppose to be dropped down and when you hit "Continue", billing information will drop down similar to this : http://www.plazathemes.com/demo/ma_musicgear/index.php/checkout/onepage/ 默认情况下,我们会假设结帐方式被删除,当您点击“继续”时,结算信息将下拉类似于: http//www.plazathemes.com/demo/ma_musicgear/index.php/checkout/onepage/

However, when I go to that page, checkout method isn't dropped down and whenever I click on it, nothing happens. 但是,当我转到该页面时,checkout方法不会被删除,每当我点击它时,都没有任何反应。 Now these are all my JS errors: 现在这些都是我的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'

Do any of those have anything to do with this? 这些中的任何一个都与此有关吗? I'm getting all the attachEvent and blah blah from prototype because of bootstrap. 因为bootstrap,我从原型获得了所有的attachEvent和blah blah。 I don't know how to resolve that so I'm currently putting that on hold. 我不知道如何解决这个问题所以我现在暂时搁置了。 I'm guessing the setAttribute is definitely something that could be causing the problem? 我猜测setAttribute肯定是导致问题的原因?

Thanks for any help.. 谢谢你的帮助..

I don't know if this would be of any help, but on the shopping cart page before you hit Proceed to Checkout, it lists this label "State/Province" under ESTIMATE SHIPPING AND TAX, but not the select/input box.. So it's coming up as an invalid region_id on checkout page: 我不知道这是否有任何帮助,但在您点击继续结账前的购物车页面上,它会在ESTIMATE SHIPPING AND TAX下列出“州/省”标签,而不是选择/输入框。因此,它会在结帐页面上显示为无效的region_id:

So the SetAttribute error is coming from this section: 所以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>

It's saying $('shipping:region_id') has no method setAttribute.. 这是说$('shipping:region_id')没有方法setAttribute ..

@ROMMEL has helped with the answer. @ROMMEL帮助解决了这个问题。 These are the steps I took to solve the issue: 这些是我为解决问题而采取的步骤:

  • Put this in a jquery-noconflict.js file : jQuery.noConflict(); 把它放在一个jquery-noconflict.js文件中: jQuery.noConflict();
  • Add it in right after your jQuery.js file in the 在你的jQuery.js文件后面添加它

DONE! DONE! =) Makes a lot of errors that people said bootstrap and prototype interfering with each other. =)犯了许多错误,人们说引导程序和原型相互干扰。 All those errors disappear after issuing the noConflict()! 发出noConflict()后,所有这些错误都消失了!

Always add jQuery.noConflict(); JS file 总是添加jQuery.noConflict(); JS file jQuery.noConflict(); JS file before prototype.js on page.xml file. page.xml文件中的prototype.js之前的jQuery.noConflict(); JS file文件。 means like this 意思是这样的

<action method="addJs"><script>global.js</script></action> <action method="addJs"><script>jquery.jcarousel.pack.js</script></action> <action method="addJs"><script>jquery.noconflict.js</script></action> <action method="addJs"><script>prototype/prototype.js</script></action>

将prototype.js文件替换为新的magento备份并再次检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM