如何使用扩展定价模块应用批发组价格?

时间:2017-07-04 13:43:56

标签: php silverstripe silvershop

使用扩展定价模块时,我将以下内容添加到我的YML文件中。

Product:
  extensions:
    - HasGroupPricing
HasGroupPricing:
  price_levels:
    wholesale: WholesalePrice
  field_labels:
    WholesalePrice: 'Price for wholesale customers'

我有一个批发组,并且这些字段显示在CMS中以设置价格,但前端没有任何反应。

1 个答案:

答案 0 :(得分:3)

price_levels的密钥必须完全匹配CMS中组的Code。一个组的Code只能使用初始写入进行设置,因此稍后重命名一个组不会更改其组代码!

话虽这么说,您应该检查数据库中的Group表并查看Code列。确定要应用WholesalePrice的组,并确保密钥与该组的Code匹配...

示例:您有一个名为"我的批发组"的组,该组的Codemy-group(您必须查看此内容)数据库)。然后,您必须将YML更改为:

HasGroupPricing:
  price_levels:
    # Here's where we change the key to match the Group Code
    my-group: WholesalePrice 
  field_labels:
    WholesalePrice: 'Price for wholesale customers'