Deoorbel Posted October 11, 2015 Share Posted October 11, 2015 (edited) Is there somenone who can help me to extend the adminsearchcontroller to search and display orders with specifik products. Search on product reference in orders and display the order where the product is found. Thanks Prestashop 1.6.0.14 www.deoorbel.nl Edited October 11, 2015 by Deoorbel (see edit history) Link to comment Share on other sites More sharing options...
Deoorbel Posted October 13, 2015 Author Share Posted October 13, 2015 I tried to adjust ther clases>order.php to get a order list below. But didn't work public static function getOrderByProductID($productid) { $orders = new PrestaShopCollection('Order'); $orders->where('reference', '=', $reference); $product_list = $this->getOrderDetailList(); foreach ($product_list as $product) if ($product['product_id'] == (int)$id_product) return $orders; } I stil need to adjust the adminsearchcontroller to display the record of the found orders. Link to comment Share on other sites More sharing options...
Deoorbel Posted October 14, 2015 Author Share Posted October 14, 2015 Can some one help me with this. Link to comment Share on other sites More sharing options...
EdEichman Posted October 14, 2015 Share Posted October 14, 2015 I would use a MySQL query, either via a client (I use Navicat), or via the SQL Manager in Prestashop. Assuming a table prefix of ps_, and a search for productID 10.... select reference, o.id_order, d.product_id, d.product_name from ps_orders as o join ps_order_detail as d on (o.id_order = d.id_order) where product_id = 10 group by reference order by o.id_order Link to comment Share on other sites More sharing options...
EdEichman Posted October 15, 2015 Share Posted October 15, 2015 Also, if you go into the product itself, click on the "Product Sales" icon at the top, and indicate your date range, you can see sales associated with that product. Link to comment Share on other sites More sharing options...
Deoorbel Posted October 17, 2015 Author Share Posted October 17, 2015 Thanks! that does the trick [solved] 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