文档 下载安装 商店 博客 问答 主机

求教,添加购物车失败

故障
session

#1

找人做了个网站,M2的,但是经常出现首次添加购物车失败,而且购物车语言包调用也有问题,由于我不懂代码,给我做站的人似乎技术也不怎样,求大神指教,网站[details=Summary]www.ricici.com[/details]


#2

你的网站我看了,目前看非常可能是js的故障,建议找人调试.
打开浏览器开发者工具会看到详细的错误提示,你的站比较怀疑是这个:

	jquery.js:9 Uncaught Error: cannot call methods on tabs prior to initialization; attempted to call method 'option'
		at Function.error (https://www.yourdomain.com/pub/static/version1511143569/frontend/Codazon/fastest_fashion/en_US/jquery.js:9:131)
		at HTMLDivElement.<anonymous> (https://www.yourdomain.com/pub/static/version1511143569/frontend/Codazon/fastest_fashion/en_US/jquery/jquery-ui.js:25:426)
		at Function.each (https://www.yourdomain.com/pub/static/version1511143569/frontend/Codazon/fastest_fashion/en_US/jquery.js:15:767)
		at jQuery.fn.init.each (https://www.yourdomain.com/pub/static/version1511143569/frontend/Codazon/fastest_fashion/en_US/jquery.js:3:644)
		at jQuery.fn.init.$.fn.(anonymous function) [as tabs] (https://www.yourdomain.com/pub/static/version1511143569/frontend/Codazon/fastest_fashion/en_US/jquery/jquery-ui.js:25:340)
		at https://www.yourdomain.com/pub/static/version1511143569/frontend/Codazon/fastest_fashion/en_US/js/responsive.js:3:128
	error @ jquery.js:9
	(anonymous) @ jquery-ui.js:25
	each @ jquery.js:15
	each @ jquery.js:3
	$.fn.(anonymous function) @ jquery-ui.js:25
	(anonymous) @ responsive.js:3
	setTimeout (async)
	entry @ responsive.js:3
	mqChange @ matchMedia.js:7
	window.mediaCheck @ matchMedia.js:7
	(anonymous) @ responsive.js:1
	execCb @ 8dc07616a2dcab1fade9edb1be2e7931.js:112
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:56
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:72
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:11
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	each @ 8dc07616a2dcab1fade9edb1be2e7931.js:3
	emit @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:61
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:72
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:11
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	each @ 8dc07616a2dcab1fade9edb1be2e7931.js:3
	emit @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:61
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:72
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:11
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	each @ 8dc07616a2dcab1fade9edb1be2e7931.js:3
	emit @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:61
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:72
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:11
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	each @ 8dc07616a2dcab1fade9edb1be2e7931.js:3
	emit @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:61
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:72
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:11
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	each @ 8dc07616a2dcab1fade9edb1be2e7931.js:3
	emit @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:61
	enable @ 8dc07616a2dcab1fade9edb1be2e7931.js:73
	init @ 8dc07616a2dcab1fade9edb1be2e7931.js:54
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:66
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:11
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:140
	execCb @ 8dc07616a2dcab1fade9edb1be2e7931.js:112
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:56
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:72
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:11
	(anonymous) @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	each @ 8dc07616a2dcab1fade9edb1be2e7931.js:3
	emit @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	check @ 8dc07616a2dcab1fade9edb1be2e7931.js:61
	enable @ 8dc07616a2dcab1fade9edb1be2e7931.js:73
	init @ 8dc07616a2dcab1fade9edb1be2e7931.js:54
	callGetModule @ 8dc07616a2dcab1fade9edb1be2e7931.js:74
	completeLoad @ 8dc07616a2dcab1fade9edb1be2e7931.js:103
	onScriptLoad @ 8dc07616a2dcab1fade9edb1be2e7931.js:112

因为我跟踪了一下,加入购物车之后,网站是有返回数据的,只是页面没有显示。
语言包这种东西基本都是需要个人修改的,直接拿来基本都不好用。


#3

谢谢,但是这个很奇怪,通常只有第一次点击的产品才这样,第一次点开的产品通常都会添加失败,但是返回,点击另外一个产品的话,就能添加成功。
刚刚做网站的人说,只要把缓存关了,这个问题就会好,那就更搞不懂了。。。。


#4

js肯定有问题,然后再检查一下是否form_key的原因造成的添加失败。
另外建议升级版本到最新版,我看你们用的不是最新版的Magento2,并且模板也更新一下,检查是否模板的问题,估计用的是盗版的模板。