正如您在螢屏截圖中看到的,我們的皮膚型別和產品品牌帶有星號。

我創建了一個新屬性,我不希望這兩個欄位包含在其中。那么如何從 Magento 儀表板中手動洗掉該欄位,或者我可以使其不是強制添加的。
目前,我已將皮膚型別從 Stores->Product Attributes->Groups 拖到未分配的屬性中。
uj5u.com熱心網友回復:
您可以嘗試以下步驟來隱藏產品欄位
步驟1:
在下創建catalog_product_edit.xml
應用程式/代碼/供應商/模塊/視圖/adminhtml/布局
檔案:catalog_product_edit.xml
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="myattribHide" before="before.body.end" template="Vendor_Module::product/edit/fieldhide.phtml" />
</referenceContainer>
第二步:在下創建檔案fieldhide.phtml
應用程式/代碼/供應商/模塊/視圖/adminhtml/模板/產品/編輯
檔案:fieldhide.phtml
<script>
require([
'jquery',
'uiRegistry'
], function($,uiRegistry){
uiRegistry.get("product_form.product_form.content.container_yourcustomfield.yourcustomfield", function (element) {
element.hide();
});
})
</script>
注意:請將“yourcustomfield”替換為您的屬性代碼
第 3 步:請洗掉靜態檔案并重繪 快取
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/425748.html
下一篇:在where子句中匹配多個列
