beke Posted November 28, 2013 Share Posted November 28, 2013 Hi all, in this post (http://www.prestashop.com/forums/topic/196928-help-new-group-of-customers-enable-all-categories-automatically/) Valérie Assetskaya posted this script. Any idea if it works fine for PS 1.5.6? <?phprequire(dirname(__FILE__).'/config/config.inc.php');$new_group = 4; // there is ID of new group$categories = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT DISTINCT c.*FROM `'._DB_PREFIX_.'category` cLEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')');foreach($categories as $category){$categoryObj = new Category($category['id_category'], (int)Context::getContext()->language->id);$categoryObj->addGroups(array($new_group));} ?> Link to comment Share on other sites More sharing options...
Recommended Posts