我需要編寫一個Shopware插件,用於擴展external_id
字段的客戶模型。此字段應可通過管理界面和API編輯。如何擴展Shopware客戶
我發現,我可以像這樣添加屬性用戶:
public function addAttributes() {
$this->Application()->Models()->addAttribute(
's_user_attributes',
'bla',
'externalId',
'INT(11)',
true,
null
);
$this->Application()->Models()->generateAttributeModels(array(
's_user_attributes'
));
}
我應該怎麼做,以顯示在用戶界面和API這個領域?
PS:Shopware 5
第二個鏈接無效。這就是爲什麼你發佈完整的代碼參考,而不僅僅是鏈接! – Ben
是的,你說得對,對不起。 – Roman