b1000 Posted December 10, 2019 Share Posted December 10, 2019 Hi, I search a module to export in csv (or excel,etc..) the stock movements in prestashop 1.7.. Some ideas? Thank'u very much! Link to comment Share on other sites More sharing options...
Daresh Posted December 10, 2019 Share Posted December 10, 2019 Stock movements? As far as I know Prestashop 1.7 does not have advanced stock management. Link to comment Share on other sites More sharing options...
b1000 Posted December 10, 2019 Author Share Posted December 10, 2019 3 minutes ago, Daresh said: Stock movements? As far as I know Prestashop 1.7 does not have advanced stock management. Yes, under cataligue --> stocks --> movements.. Buy Is no option to export this data, i search that.. Link to comment Share on other sites More sharing options...
Daresh Posted December 10, 2019 Share Posted December 10, 2019 Indeed no option to export, would you like to export this data as a whole or the currently filtered data? Link to comment Share on other sites More sharing options...
b1000 Posted December 10, 2019 Author Share Posted December 10, 2019 This data as a whole (but if Is possibile ti apply filter before exporting, or other functions like set a cronjob, It would be fantastic!) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted December 10, 2019 Share Posted December 10, 2019 If you know SQL, you can use SQL query from Database manager Link to comment Share on other sites More sharing options...
b1000 Posted December 10, 2019 Author Share Posted December 10, 2019 i can try to study, very difficultnforbme because I don't know SQL but I try, thank'u! If someone can/would help me, this Is very appreciate! Link to comment Share on other sites More sharing options...
b1000 Posted December 12, 2019 Author Share Posted December 12, 2019 Hi! after many attempts and following examples here on the forum I have obtained this code who work fine on mysql manager on prestashop; SELECT o.id_order AS "ID Ordine", od.product_id AS "ID Prodotto",od.product_attribute_id AS "ID Combinazione", od.product_name AS "Nome Prodotto", od.product_quantity AS Quantita, o.valid AS Finalizzato FROM ps_order_detail od INNER JOIN ps_orders o ON o.id_order = od.id_order WHERE o.date_add > DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 365 DAY),'%Y-%m-%d') Than, I have create a php file to place in the root of my prestashop installation to otain the result in browser, who work fine: <!DOCTYPE html> <html> <body> <?php $servername = "localhost"; $username = "nbbdvvyhud"; $password = "uz8QYXeXfV"; $dbname = "nbbdvvyhud"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT o.id_order AS 'ID Ordine', od.product_id AS 'ID Prodotto',od.product_attribute_id AS 'ID Combinazione', od.product_name AS 'Nome Prodotto', od.product_quantity AS Quantita, o.valid AS Finalizzato FROM ps_order_detail od INNER JOIN ps_orders o ON o.id_order = od.id_order WHERE o.date_add > DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 365 DAY),'%Y-%m-%d')"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "ID Ordine: " . $row["ID Ordine"]. " - ID Prodotto: " . $row["ID Prodotto"]. " - ID Combinazione: " . $row["ID Combinazione"]. " - Nome Prodotto: " . $row["Nome Prodotto"]. " - Quantita: " . $row["Quantita"]. " - Finalizzato: " . $row["Finalizzato"]. "<br>"; } } else { echo "0 results"; } $conn->close(); ?> </body> </html> Now, I have the necessity to create a php file to EXPORT IN CSV the data.. I have tryed in some way but with no result :(( Someone can help me? THANK'U VERY VERY MUCH! 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