我在我的应用程序中使用 spree 2.0.0 stable。在产品显示页面上,所有变体都显示为单选按钮。我只想在下拉菜单中显示它们。对此有什么想法吗?
Thanks.
注意:此解决方案实施 Spree“模板替换方法”,特别是当您在应用程序设计中进行大量设计更改或使用自定义设计时。看这里
http://guides.spreecommerce.com/developer/view.html http://guides.spreecommerce.com/developer/view.html
否则,如果您使用 Spree 商店的默认设计或进行细微更改,请使用“破坏”方法。
Go to:
应用程序/视图/狂欢/产品/_cart.html.erb。并在购物车表格内写下以下行。
<%= select_tag "products[#{@product.id}]", options_for_select(@product.variants_and_option_values(current_currency).collect{|v| ["#{variant_options(v)} #{variant_price(v)}", v.id]})%>
#(if you don't have this file(app/views/spree/products/_cart_form.html.erb) go to github spree2.0.0 branch and use it in your product.)
希望这也适合你。
Thanks
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)