Keyword

K2 Sub-Category Ordering in Frontend Select Category pulldown

  • Railer
  • Railer's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 2 months ago - 4 years 2 months ago #176949 by Railer
HI Fotis,

Yes, the root category used for the data source is ordered the way we want it. However, there are template overrides in the template.
I'm not sure which files to grab for you, but I grabbed the beginning of the category.php override which contains an ordering switch and have uploaded the screenshot. I'm not sure which would be the correct syntax to use if I changed it, but I do note the following in the default:

$orderby = 'i.id DESC';

Would that be the cause?
Further down in the file, I see a div for what looks like a category filter pulldown... which is the second screenshot attachment.
Attachments:
Last edit: 4 years 2 months ago by Railer.

Please Log in or Create an account to join the conversation.

More
4 years 2 months ago #176952 by JoomlaWorks
The drop-down was embedded in the category layout, so there's no module used.

The code at the top does not relate to the one in the bottom, which is apparently the drop-down. You need to sort the SQL query by ordering. So prepend:
$query2->order('ordering');
...before $db2->setQuery($query2);

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Railer
  • Railer's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 2 months ago - 4 years 2 months ago #176955 by Railer
Hey Fotis! Thanks so much, yes, I had a hunch that the override was the problem. I added your query code at line 144 and it worked! Thanks for sticking with me. Much appreciated!
Last edit: 4 years 2 months ago by Railer.

Please Log in or Create an account to join the conversation.

More
4 years 2 months ago #176961 by JoomlaWorks
You're welcome.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum