Code: Select all
SELECT * FROM `oc_order_product` op
LEFT JOIN `oc_product`p on p.product_id = op.product_id
ORDER BY sort_order
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
In specific location to apply it to at this stage other than perhaps admin order details and invoices.
a rough idea would be enough for now.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I need the sort order info included in the order_product table when data is inserted.
Just a rough idea where to add the data in terms of which modal file and whether product sort order is available to add in that modal file of if it needs to be defined first.
Retrieving customers ordered products in order of Sort order is not really the issue since I'm sure I could just include order by sort_order in the sql query to anywhere that calls that data.
Any screenshots you could provide regarding the modal file you are referring about?Just a rough idea where to add the data in terms of which modal file and whether product sort order is available to add in that modal file of if it needs to be defined first.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
For anyone thats insterested in system\library\cart\cart.php
I added ORDER BY p.sort_order to the end of
Code: Select all
$product_query = $this->db->query
Since the order_prodct table assigns an order_prodct_id incrementally by each product, i was able to use this as a method of sorting the results.
So on for example the admin order view page, each product is displayed in the correct sort order by changing
Code: Select all
public function getOrderProducts($order_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
return $query->rows;
}
Code: Select all
public function getOrderProducts($order_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'ORDER BY order_product_id ASC");
return $query->rows;
}
Easiest solution all round i think.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
To be fair I did ask a simple question relating to the order_products table. Nothing else would have mattered.
This simple question was incomplete since, again, there were no indication found elsewhere on the topic that your issue needed to affect the cart page but simply the order_products which I am sure you'll understand that this database table name not only reflects one location in the platform which is why you were asked previously on this topic for specific areas.To be fair I did ask a simple question relating to the order_products table. Nothing else would have mattered.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 392 guests