News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How can we add a sort by filter to our product pages? 'Sort by Name' Etc

Started by Lydiasupplyingdirect, May 05, 2022, 11:06:47 AM

Previous topic - Next topic

Lydiasupplyingdirect

Hello,

We're looking to add a 'sort by' filter/drop down to our product pages which sorts by name, product, price etc. We have selected the filters in Virtuemart configuration > Sort & Search, but nothing is showing front end.

We have contacted Yootheme about this and they have said it's a Virtuemart thing, does anyone know how we can display this sort by filter front end?

We currently have it on one of our old websites but have no idea how we got it there as it was created years ago (see image attached)

Website we want to add it to: https://www.schoolfurniture-direct.co.uk/

Any help would be much appreciated, thank you.

Lydia

L Bustin

jenkinhill

Looks like your template overrides do not have the code to display the orderlist.

In default VM the code is in /components/com_virtuemart/views/category/tmpl/default.php  - look for orderlistcontainer

You can see it on (eg) http://demo.virtuemart.net/wear
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Lydiasupplyingdirect

Hi,

So we can see code in both files please see screen shot attached.

Does this look right? If so there must be something else missing.
L Bustin

Studio 42

This is the javascript, jenkinhill speak about PHP

Code should be
[/size][/font][/size][/font][/color] <div class="orderby-displaynumber"> <div class="width70 floatleft"> <?php echo $this->orderByList['orderby']; ?> <?php echo $this->orderByList['manufacturer']; ?> </div> <div class="width30 floatright display-number"><?php echo $this->vmPagination->getResultsCounter();?><br/><?php echo $this->vmPagination->getLimitBox(); ?></div> <div class="vm-pagination"> <?php echo $this->vmPagination->getPagesLinks(); ?> <span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span> </div> <div class="clear"></div> <>

Lydiasupplyingdirect

Hello,

So I've attached a screenshot of where I think the code should go but I am probably completely wrong? But it matches what you've said to a certain extent.

You'll have to apologies, I'm not a coder but I do try my best  :)

Thanks,

Lydia
L Bustin

Studio 42

Remove
if(!empty($this->orderByList)) {
orderByList is never empty

Lydiasupplyingdirect

Hi so I've added the code in, but nothing is showing front end so I must be missing something?

https://www.schoolfurniture-direct.co.uk/

Any ideas would be much appreciated!

Thank you,

Lydia
L Bustin