Shopping Cart Operations > Support

Default sort order?

<< < (2/3) > >>

MLCS:
Not really. Theres a lot of PHP in there and I cant see where I have to change.

abantecart:
There are different functions that are called to get listing of products. This depends on the section that does listing.

Example:

public function getProductsByCategoryId($category_id, $sort = 'p.sort_order', $order = 'ASC', $start = 0, $limit = 20) {

There is a section that sets the sorting (order)

                $sort_data = array(
                        'pd.name',
                        'p.sort_order',
                        'p.price',
                        'special',
                        'rating'
                );

                if (in_array($sort, $sort_data)) {
                        if ($sort == 'pd.name') {
                                $sql .= " ORDER BY LCASE(" . $sort . ")";
                        } else {
                                $sql .= " ORDER BY " . $sort;
                        }
                } else {
                        $sql .= " ORDER BY p.sort_order";
                }

                if ($order == 'DESC') {
                        $sql .= " DESC";
                } else {
                        $sql .= " ASC";
                }


You need to let us know where exactly you need to change the sorting order. What page?

MLCS:
When they go into categories. I want to change it so that its A-Z

abantecart:
You can change the sorting pram to be defaulted to A-Z

Look in file:
storefront/controller/pages/product/category.php

Locate this code:

--- Quote ---            $sorts[] = array(
               'text'  => $this->language->get('text_default'),
               'value' => 'p.sort_order-ASC',
               'href'  => $this->html->getSEOURL('product/category', $url . '&path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC', '&encode')
            );

--- End quote ---

Switch it with next line.

MLCS:
Thats made it so it says the sorting is A-Z but it actually isnt. Its still default sorted by Model ID. Ive even removed "Default" from that drop-down and it still sorts it that way....

http://mylittlecrystalshop.com/ab/index.php?rt=product/category&path=4_25

see?

Edit: Seems its being ordered by when its uploaded  ???

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version
Powered by SMFPacks Social Login Mod