onsy Posted February 1 Posted February 1 I have a function which pulls list of products: $start=1000; $limit=25; $order_by='id_product'; $order_way='ASC'; $id_category = false; $only_active =true; $context = null; Product::getProducts($id_lang, $start, $limit, $order_by, $order_way, $id_category, $only_active, $context) How can i see that query? The problem is there are some products missing in this select of 25 products. thanks. Share this post Link to post Share on other sites More sharing options...
ps8moduly.cz Posted February 2 Posted February 2 Hello. If you need to see the SQL, it will be necessary to add to the file ./classes/Product.php, for example, to save the SQL to the file. Find the function getProducts and add before the last line: 1 Share this post Link to post Share on other sites More sharing options...
onsy Posted February 2 Posted February 2 Thank you! 1 Share this post Link to post Share on other sites More sharing options...
ps8moduly.cz Posted February 2 Posted February 2 I gladly helped 😉 Share this post Link to post Share on other sites More sharing options...
Mediacom87 Posted February 2 Posted February 2 Hi, If you just want to display the request, you just have to put this kind of code in the file Product.php Tools::dieObject($sql); Also, I would place it right after the $sql declaration to avoid wasting time with all the processing behind it. Tools::dieObject($sql); $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); if ($order_by == 'price') { Tools::orderbyPrice($rq, $order_way); } Share this post Link to post Share on other sites More sharing options...
ps8moduly.cz Posted February 2 Posted February 2 Beware of die(), if you have a live store, customers will wonder if it will show up 😄 Share this post Link to post Share on other sites More sharing options...
Mediacom87 Posted February 2 Posted February 2 Il y a 4 heures, ps8moduly.cz a dit : Beware of die(), if you have a live store, customers will wonder if it will show up 😄 Of course, but we can assume that we are in the developer section of the forum and that some evidence is already acquired and if not, that the applicant will acquire it at that time 😉 Share this post Link to post 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