Php 如何使用扩展定价模块应用批发集团价格?

Php 如何使用扩展定价模块应用批发集团价格?,php,silverstripe,silvershop,Php,Silverstripe,Silvershop,在使用扩展定价模块时,我将以下内容添加到我的YML文件中 Product: extensions: - HasGroupPricing HasGroupPricing: price_levels: wholesale: WholesalePrice field_labels: WholesalePrice: 'Price for wholesale customers' 我有一个批发组,字段显示在CMS中,用于设置价格,但前端没有发生任何事情 价格水平的键必

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

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

我有一个批发组,字段显示在CMS中,用于设置价格,但前端没有发生任何事情

价格水平的键必须与CMS中组的
code
完全匹配。组的
code
仅在初始写入时设置,因此以后重命名组不会更改其组代码

也就是说,您应该检查数据库中的
Group
表,并查看
code
列。确定要将
批发商价格
应用到的组,并确保键与该组的
代码
匹配

示例:您有一个名为“我的批发组”的组,该组的
code
mygroup
(您必须在数据库中查找该组)。然后,您必须将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'

啊,可能就是这样。我把团体的名称改为批发。如果这能解决问题,我会很快告诉你。