Helpcenter +918010117117 https://help.storehippo.com/s/573db3149f0d58741f0cc63b/ms.settings/5256837ccc4abf1d39000001/57614ef64256dc6851749879-480x480.png" [email protected] https://www.facebook.com/StoreHippohttps://twitter.com/StoreHippohttps://www.linkedin.com/company/hippoinnovations/https://plus.google.com/+Storehippo/posts
B4,309-10 Spaze iTech Park, Sector 49, Sohna Road, 122001 Gurgaon India
call to replace anchor tags contains '/admin' in href

How to disable field or metafield for seller

Add this code in hooks for seller structure


function (req, res, next) {
    if (req.session.user && req.session.user.isLoggedIn && req.session.user.role == "seller") {
        if (res.data && res.data.fields && res.data.fields.length) {
            res.data.fields.forEach(function (field) {
                if (field.name == 'metafields') {
                    field.fields.forEach(function (metafield) {
                        if (metafield.name == 'seller_role') {
                            metafield.settings["disabled"] = true;
                        }
                    })
                }
            })
        }
    }
                next()
}
2021-04-14T07:03:49.682Z