- Posts: 2
- Thank you received: 2
Sort by price (module option and frontend option)
I noticed that there is no sort by price option in hikashop modules, which I consider to be the most relevant sorting option. This is probably due to the fact that the prices are stored in a different table in the database.
I patched some parts of the component to add this feature which works in my situation where all products have a single price.
Also I added an option in the module so that front end sorting is available or not and an option to hide out of stock items.
I would love to see this functionality included in the hikashop core so that I don't have to replace the code every time the component updates.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Thank you for contributing.
The fact that the price is in a different table is a reason indeed. The second is that until now, there were no sorting dropdowns. The sorting was only decided in the options of the modules/menus. Which means that for such case the price sorting is less relevant. The admin could just use the ordering column in order to sort the products the way he likes.
We will review the code and modify it to include it in HikaShop.
Also, note that we already have the filter_order and the filter_order_Dir variable for the sorting as we had started planning for such feature. It would have been great to use them. Also, instead of modifying the views directly, you could have overriden them in your template as joomla allows you to do. That would have mean less work on update because only the view.html.php would have been reverted.
Please Log in or Create an account to join the conversation.
- Posts: 1
- Thank you received: 0
Thanks for the help.
Please Log in or Create an account to join the conversation.
We didn't had the time yet. We'll do that in January or february. It needs a lot of work as we want to add more sorting possibilities and use options to select which kind of sorting would be possible or not, etc.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
No, we finally had other priorities and delayed this functionality. It's still high on the list but will require a few months before we can propose it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
In HikaShop > Display > Filters, for the "Apply on" option select "sort" for "sort" select "price" and display this filter on the products listings.
Please Log in or Create an account to join the conversation.
Is there a way to make it sort the products by price by default other than me setting them in that order in the backend?
I find that the filtering doesn't function as well as I had hoped it would.
Please Log in or Create an account to join the conversation.
We have that on our todo list but it's quite complex to do and we are focusing on other things right now so it won't be in the short term.
Please Log in or Create an account to join the conversation.
Please help
Please Log in or Create an account to join the conversation.
The filters are available in the business edition of HikaShop.
Please Log in or Create an account to join the conversation.
- Posts: 86
- Thank you received: 3
Of at least choose a filter by price automatically on product listing?
Please Log in or Create an account to join the conversation.
Yes. There are several ways to go about it based on what you need:
1. You can configure a filter of the type "dropdown" applying on "sort" with the "price" selected for the sorting. That will display a sorting dropdown so that the customer can choose to sort by ascending or descending prices. You can also add other kinds of sorting to that dropdown to go further.
2. If you do point 1, you can turn on the "redirect POST mode" setting of the HikaShop configuration. When, you use the filter, you'll see that the link of the page changes. So you can use that link in a menu item to direct to a prefiltered page with the sorting already done on the price.
3. It's also possible to create a custom product field where the price will be stored, and have a mass action in place to update the value of that custom field with the price when a product is created/changed. Then, you can simply select that custom field in the "ordering column" of the menu item so that it will be ordered by default on the price copied in that custom field for each product.
Please Log in or Create an account to join the conversation.
- Posts: 86
- Thank you received: 3
I use the menu type hika Categories listing
Please Log in or Create an account to join the conversation.
Move your menu item to a menu you don't display like the "HikaShop default menus". And then create an external URL menu item with the URL of your menu item including the extra parameters for the filters value you want by default when you access the listing.
Please Log in or Create an account to join the conversation.
I was able to get the filter created and can manually sort the page, but I want the page sorted Ascending (and I'll hide the filter using CSS). I cannot change the link as that is not an option when creating a Categories Listing.
So I looked at the Menu options. I've tried changing the product options to Ordering Field: product_msrp and Ordering direction: Ascending but that did not seem to have any effect.
A prompt and detailed response would be greatly appreciated.
Please Log in or Create an account to join the conversation.
Go to the Product Category
Set the dropdown in line 2 to be 'Direct sub elements (this will change the ordering column so they can be changed)
Change the order to what you want
Go to your Menu Item (for the Category listing)
Under 'Product Options', be sure that 'Ordering field' is set to inherit (Ordering)
Ordering Direction to your choice (in my case Ascending)
Save your menu changes
This seemed to resolve my issue.
Please Log in or Create an account to join the conversation.