[英]Magento setAttribute error on checkout page
好的,当你“继续结帐”时,它会给你一个列表:
默认情况下,我们会假设结帐方式被删除,当您点击“继续”时,结算信息将下拉类似于: http : //www.plazathemes.com/demo/ma_musicgear/index.php/checkout/onepage/
但是,当我转到该页面时,checkout方法不会被删除,每当我点击它时,都没有任何反应。 现在这些都是我的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,我从原型获得了所有的attachEvent和blah blah。 我不知道如何解决这个问题所以我现在暂时搁置了。 我猜测setAttribute肯定是导致问题的原因?
谢谢你的帮助..
我不知道这是否有任何帮助,但在您点击继续结账前的购物车页面上,它会在ESTIMATE SHIPPING AND TAX下列出“州/省”标签,而不是选择/输入框。因此,它会在结帐页面上显示为无效的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();
DONE! =)犯了许多错误,人们说引导程序和原型相互干扰。 发出noConflict()后,所有这些错误都消失了!
总是添加jQuery.noConflict(); JS file
在page.xml
文件中的prototype.js
之前的jQuery.noConflict(); JS file
文件。 意思是这样的
<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.