cclove Posted August 4, 2010 Share Posted August 4, 2010 在Prestashop页面上有个CART区域,在你点击CART右边的那个箭头时会出现内容切换,我想问下大家怎样可以让打开页面时先出现(empty)内容界面,然后当用户添加产品到购物车的时候,在出现Shipping与Total内容界面,也就是让这2个内容互换过来。 希望得到大家的帮助,谢谢! Link to comment Share on other sites More sharing options...
21846657 Posted August 4, 2010 Share Posted August 4, 2010 blockcart模块在collapsed状态时,就正如你说的,“(empty)内容界面”;在expanded状态,则是“当用户添加产品到购物车的时候,在出现Shipping与Total内容界面”——两个状态的交换由ajax-cart.js来控制和实现。要实现先collpased再expanded,需要修改代码。我没有尝试过。请参考下面的帖子吧:http://www.prestashop.com/forums/viewthread/http://www.prestashop.com/forums/viewthread/47958/http://www.prestashop.com/forums/viewthread/24829/Good luck! Link to comment Share on other sites More sharing options...
cclove Posted August 4, 2010 Author Share Posted August 4, 2010 我看了下你给我的链接,然后修改in modules/blockcart/ajax-cart.js 487行修改 ajaxCart.expand(); 到 ajaxCartcollapse(); 然后修改/ modules / blockcart / blockcart.php在 $smarty -> assign ( 'colapseExpandStatus' , $params[ 'cookie' ] -> ajax_blockcart_display ); 下面添加了 $smarty -> assign ( 'colapseExpandStatus' , 'expanded' ); 内容的切换时解决了,但是当我网购物车添加物品的时候,出问题了,问题:1, 第一次往购物车中添加一个物品的时候,购物车数据没变化,而当你刷新下页面的时候数据变了; 2,第二次网购物车添加物品的时候出现跟上面说的一样的情况,要你刷新下页面购物车中数据才变; 很纳闷不是很明白,希望您这边帮我看看,谢谢 Link to comment Share on other sites More sharing options...
21846657 Posted August 4, 2010 Share Posted August 4, 2010 我认为php不用改。你把ajaxCart.expand改成ajaxCart.collapse,再试试;有人也说还需将ajaxCart.expand注释掉。如果不行,估计要修改多处代码了。 Link to comment Share on other sites More sharing options...
21846657 Posted August 5, 2010 Share Posted August 5, 2010 有人也说还需将ajaxCart.expand注释掉。 经测试(FF/Chrome/Opera/Safari/IE8, Win7/WinXP/Ubuntu),这个方法有效。 Link to comment Share on other sites More sharing options...
cclove Posted August 6, 2010 Author Share Posted August 6, 2010 你的意思是说在js中把ajaxCart.expand改成ajaxCart.collapse,然后将ajaxCart.expand注释掉?我不明白你说的这个将ajaxCart.expand注释掉是怎么注释的,我在这个模块文件中没找到,能具体把你的方法在这里跟我说说嘛, 麻烦了,谢谢! Link to comment Share on other sites More sharing options...
21846657 Posted August 6, 2010 Share Posted August 6, 2010 哦,上面笔误了,应该是将ajax-cart.js结尾的 ajaxCart.refresh(); 用//注释掉就可以了。It should work. Link to comment Share on other sites More sharing options...
cclove Posted August 6, 2010 Author Share Posted August 6, 2010 你说的这个方法内容互换的问题解决了,很谢谢!但是在你第一次往购物车添加物品的时候购物车区域显示的是product,当你刷新下页面时会出现类似“ 1 products product 292,18 € ”这样的数据。我的问题是当你往购物车添加物品的时候CART区域里面的内容会自动由empty变为(点击箭头切换出现的数据展示方式),而不需要点击箭头来切换希望您这边能帮我再看看,谢谢你 Link to comment Share on other sites More sharing options...
21846657 Posted August 6, 2010 Share Posted August 6, 2010 我的1.3.1.1(默认主题)就是Add to Cart时自动展开,不需要点击箭头切换。不晓得你的为什么不是... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now