acpkor Posted May 30, 2022 Share Posted May 30, 2022 Hello, I am applying this SQL query SELECT ord.id_order,`reference`,`ddw_order_date`,`product_name`,`product_quantity`,`date_add` FROM `ps_orders` as ord INNER JOIN `ps_order_detail` as od ON ord.id_order = od.id_order WHERE `valid` = 1 AND `date_add` BETWEEN '2022-04-24' AND '2022-05-30' I don't know why, but it only takes the orders from store 1. I don't know why it doesn't get all the orders, those from store 1 and those from store 2. Does anyone know why this happens? Thank you, Link to comment Share on other sites More sharing options...
Prestachamps Posted May 30, 2022 Share Posted May 30, 2022 20 minutes ago, acpkor said: Hello, I am applying this SQL query SELECT ord.id_order,`reference`,`ddw_order_date`,`product_name`,`product_quantity`,`date_add` FROM `ps_orders` as ord INNER JOIN `ps_order_detail` as od ON ord.id_order = od.id_order WHERE `valid` = 1 AND `date_add` BETWEEN '2022-04-24' AND '2022-05-30' I don't know why, but it only takes the orders from store 1. I don't know why it doesn't get all the orders, those from store 1 and those from store 2. Does anyone know why this happens? Thank you, Hi, I've checked it, and it seems correct. Please take a look at my experiment on a test multistore: https://prnt.sc/g6KKhFnCUGa- You can add the ord.`id_shop` column to easily check if it returns any rows from other shop or not. Are you sure that in the date interval there was valid orders on the second shop? I hope that I could help. Have a nice day, Leo. 1 Link to comment Share on other sites More sharing options...
Nickz Posted May 30, 2022 Share Posted May 30, 2022 Multistore is like putting all eggs into one basket. Smaller units are way better to restore, maintain, install, move. Link to comment Share on other sites More sharing options...
acpkor Posted May 30, 2022 Author Share Posted May 30, 2022 Hi `prestachamps`, perfect. Thank you I have added ord.`id_shop` and it works correctly. shows the products of the 2 stores How can I make the query show me all the products regardless of the status of the order? 1 Link to comment Share on other sites More sharing options...
Prestachamps Posted May 30, 2022 Share Posted May 30, 2022 1 hour ago, acpkor said: Hi `prestachamps`, perfect. Thank you I have added ord.`id_shop` and it works correctly. shows the products of the 2 stores How can I make the query show me all the products regardless of the status of the order? Hi, The above query returns the products from the order details, regardless of the status of the order. If you want to filter the query by the order states, you can use the ord.`current_state` column in the where statement. I hope that I could help. Have a nice day, Leo. 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