Solidus / Spree Override 不起作用

Solidus / Spree Override not working

我正在尝试更改首页产品列表。 所以我试图覆盖此路径中的文件:

https://github.com/solidusio/solidus/blob/master/frontend/app/views/spree/shared/_products.html.erb

Deface::Override.new(:virtual_path => 'spree/shared/products',
                 :replace_contents => "li#product_",
                 :name => "product_new",
                 :text => "text")

但是这段代码在主页上的变化绝对为 0。

此覆盖所在的文件名为 product_override.rb,位于 app/overrides

如有任何帮助,我们将不胜感激。 谢谢

我已经使用全新安装的 Solidus 测试了这段代码,它可以正常工作。 请注意,我在 :virtual_path => 'spree/shared/_products' 中的 "products" 之前添加了下划线。另外,我将选择器更改为 "li".

Deface::Override.new(:virtual_path => 'spree/shared/_products',
             :insert_after => "li",
             :name => "product_new",
             :text => "Override is working")