satkauskas Posted February 20, 2017 Share Posted February 20, 2017 Hi, there is a nice sql query to count images of all products in database. Nice for database analysis / manual cleansing. select b.id_product, reference, supplier_reference, active, photo_qty from (SELECT id_image, id_product, count(id_image) as photo_qty FROM ps_image WHERE 1 group by id_product ) as a join ps_product as b on a.id_product=b.id_product order by photo_qty desc Why not to pre-include a bundle of "useful" sql queries into later PS versions in SQL manager menu? 1 Link to comment Share on other sites More sharing options...
ventura Posted February 20, 2017 Share Posted February 20, 2017 Try with something like that if ($id_product = (int)Tools::getValue('id_product')) { $product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id); $images = $product->getImages((int)$this->context->language->id); $this->context->smarty->assign('nb_images', count($images)); } 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