Jump to content

How Can I Count Number Of Category In Cart


davelau

Recommended Posts


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;

    }

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...