php - 在 Shopware 6 中为自定义字段添加自定义实体类型
问题描述
在 Shopware 6.4.0.0 中,可以添加基于实体的自定义字段。
实体类型列表是有限的:
是否可以轻松添加其他实体类型,例如可用产品属性列表?
解决方案
添加类似的东西就足够了
{
label: "Product Property Group",
value: 'property_group'
}
到选择
然后可以创建一个自定义字段,让我们选择产品属性。
接下来,我们必须使这种变化持久化。
请参阅https://developer.shopware.com/docs/guides/plugins/plugins/administration/customizing-components
Component.override('sw-custom-field-type-entity', {
computed: {
entityTypes() {
const types = this.$super('entityTypes');
types.push(
{
label: 'Product Property Group',
value: 'property_group'
}
);
return types;
}
}
});
推荐阅读
- python - 如何在 Django 中打印元组的名称?
- image - Flutter:- 如何检查 Gif 是否加载
- c# - System.DllNotFoundException:'无法加载 DLL'libzkfp.dll':找不到指定的模块。(来自 HRESULT 的异常:0x8007007E)'
- php - Vips writeToBuffer 不应用图像质量
- dotnetnuke - 2sxc“与服务器交谈时出错(状态 403)”
- react-native - 在 redux 存储状态更改后导航到初始 Route
- java - 如何最好地实现 ViewModel(在 AndroidX 中)以使数据在配置更改中幸存下来
- javascript - 我的 Discord Bot 在触发时不断发送相同的图像
- docker - 如何将目录从 docker 容器映射到主机?
- python-3.x - 寻找一个正则表达式,它可以找到所有数字组合,中间没有 3 个零并与分隔符混合