syltrinity wrote:Hi everyone. I'm still new here making my own ecommerce website.
I found out the way on how to sort every product in every category by default.
My question is can I sort product in Category A (A-Z), Category B (Latest-Old) and Category C (By Model)
I'm new with editing too, but I'll keep learning. Thanks for helping.

It may be a coding job. I am not sure if this will do it, I've not tested it.
Try go to this file:
catalog/model/catalog/product.php
Search for this line of code:
Code: Select all
$query = $this->db->query("SELECT p.product_id FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.date_added DESC LIMIT " . (int)$limit);
And replace it with this:
Code: Select all
$query = $this->db->query("SELECT p.product_id FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.model ASC LIMIT " . (int)$limit);
Notice towards the end of the query it is ORDER BY p.model, and not p.date_added.
Let me know how you get on
