Helpcenter +918010117117 https://cdn1.storehippo.com/s/573db3149f0d58741f0cc63b/ms.settings/5256837ccc4abf1d39000001/57614ef64256dc6851749879-480x480.png" support@storehippo.com 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

Product as catalog on custom conditions

Add this code in startup widgets

Example : to hide price of product on basis of user metafield condition

ms.app.addPosthook({entity: 'ms.products', command: 'list'}, function(req, res, next) { 
  	var records = res.data.data || res.data.records;
  	if(!records.length) return next()
    if(!ms.user || !ms.user.metafields || !ms.user.metafields.approved){
       records.forEach(function(product){
          product.catalog_only = 1;
         delete product.price
       })
    }
    next();
});

Example : to hide price of product on basis of substore condition

ms.app.addPosthook({entity: 'ms.products', command: 'list'}, function(req, res, next) { 
  	var records = res.data.data || res.data.records;
  	if(!records.length) return next()
    if(ms.substore && ms.substore.alias == 'UAE'){
       records.forEach(function(product){
          product.catalog_only = 1;
         delete product.price
       })
    }
    next();
});

Share:

2021-04-28T07:48:22.090Z