davelau Posted February 16, 2016 Share Posted February 16, 2016 I want to get the number of category that a customer put in cart via php code. any thoughts? Thanks!! Link to comment Share on other sites More sharing options...
sandipchandela Posted February 17, 2016 Share Posted February 17, 2016 public static function getProductCategories($id_product = '') { $ret = array(); $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT `id_category` FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int)$id_product ); if ($row) foreach ($row as $val) $ret[] = $val['id_category']; return $ret; } 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now