Sort by price (module option and frontend option)

  • Posts: 2
  • Thank you received: 2
13 years 4 months ago #3260

Hi,

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.

File Attachment:

File Name: mod.zip
File Size:18 KB

Attachments:
The following user(s) said Thank You: Shulha, Akdag

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
13 years 4 months ago #3262

Hi,

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
13 years 3 months ago #4179

Is this mod out of testing? if so how do I install it?
Thanks for the help.

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
13 years 3 months ago #4183

Hi,

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.

  • Posts: 28
  • Thank you received: 0
13 years 2 weeks ago #13488

Is there any update in terms of when this functionality will be available?

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
13 years 2 weeks ago #13490

Hi,

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.

  • Posts: 8
  • Thank you received: 0
11 years 3 months ago #84476

Is this function available now?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #84527

You can create a filter to sort by price.
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.

  • Posts: 85
  • Thank you received: 1
11 years 2 weeks ago #98260

Hi
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.

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
11 years 2 weeks ago #98448

Default filtering by price is not possible as it would be too complex to do for now.

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.

  • Posts: 52
  • Thank you received: 2
10 years 6 months ago #126960

Can you please explain how to add the filter option for the price please? I've tried "HikaShop > Display > Filters, for the "Apply on" option select "sort" for "sort" select "price" and display this filter on the products listings.", but I can't find 'Filters' after 'Display'???

Please help

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

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #127075

Hi,

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
7 years 9 months ago #243999

Is there a way to automatically sort by price now?
Of at least choose a filter by price automatically on product listing?

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
7 years 9 months ago #244007

Hi,

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
7 years 9 months ago #244082

The menus are already created by hikashop. How can I append the ?filter_ to the generated url?
I use the menu type hika Categories listing

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
7 years 9 months ago #244083

You could do that for example:
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.

  • Posts: 104
  • Thank you received: 5
7 years 8 months ago #247811

I'm trying to do this same thing but with a Categories Listing. When I create the Joomla Menu item, I want the Category listing to be sorted by price (ascending).

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.

  • Posts: 104
  • Thank you received: 5
7 years 8 months ago #247813

I think I solved this. For others trying to accomplish this:

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.

The following user(s) said Thank You: Jerome

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

Time to create page: 0.165 seconds
Powered by Kunena Forum