onsy Posted February 1, 2023 Share Posted February 1, 2023 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. Link to comment Share on other sites More sharing options...
ps8modules Posted February 2, 2023 Share Posted February 2, 2023 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 Link to comment Share on other sites More sharing options...
onsy Posted February 2, 2023 Author Share Posted February 2, 2023 Thank you! 1 Link to comment Share on other sites More sharing options...
ps8modules Posted February 2, 2023 Share Posted February 2, 2023 I gladly helped 😉 Link to comment Share on other sites More sharing options...
Mediacom87 Posted February 2, 2023 Share Posted February 2, 2023 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); } Link to comment Share on other sites More sharing options...
ps8modules Posted February 2, 2023 Share Posted February 2, 2023 Beware of die(), if you have a live store, customers will wonder if it will show up 😄 Link to comment Share on other sites More sharing options...
Mediacom87 Posted February 2, 2023 Share Posted February 2, 2023 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 😉 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