taitava / silverstripe-pricelist
这是一个简单的价格列表功能,使得创建产品并将其列在特定的价格列表中成为可能。没有电子商务功能。
1.1.1
2017-05-19 08:43 UTC
Requires
- silverstripe/cms: ~3.1
- silverstripe/framework: ~3.1
Suggests
- unclecheese/display-logic: Hides the EndingPrice field in the backend when a product has a fixed price. Not required but makes the UI a little bit more cleaner.
- undefinedoffset/sortablegridfield: Makes it possible to drag & drop pricelists and pricelist items to different order in the backend.
README
设置
- 扩展 SiteTree(或从其派生的任何其他类)
mysite/_config/pricelist.yml
:
SiteTree: extensions: - PricelistSiteTreeExtension
注意!如果您将扩展应用到除了 SiteTree
之外的任何其他类,您需要在 mysite/_config/pricelist.yml
中定义此额外的配置。
Pricelist: belongs_many_many: Pages: *YourCustomClassNameHere*
如果您忘记这一步,(至少)当您尝试在价格列表页面添加新的价格列表时,后端将会崩溃。如果您只是扩展了整个 SiteTree
类,那么默认情况下已经配置好了,不需要此额外的配置。
- 将以下内容放入
themes/*your-theme-folder*/Page.ss
(或任何其他模板文件)
$AllPricelists
- 如果您想调整一些配置设置,可以将它们放入
mysite/_config/pricelist.yml
Pricelist:
include_stylesheet: false
currency_sign: '€' #Whether to use the Requirements class to include this module's own stylesheet in frontend to perform some small styling.
currency_side: 'right'
PricelistItem:
hide_zero_prices: false #If true, do not display anything in the price column for items whose price is 0.
请注意,上述列表包含默认值,所以如果它们对您来说看起来不错,您不需要将此列表复制粘贴到任何地方。
-
在浏览器中运行
/dev/build?flush=all
-
转到CMS并编辑一些页面。您应该在那里看到一个价格列表选项卡。
贡献
如果您有任何关于如何改进此模块的想法或任何问题,我将很高兴听到它们! :) 请提出一个问题或创建一个拉取请求——您喜欢哪种方式。