I must be overlooking something...

I'd like to be able to sort by price, but don't see how.

In the View for catalog product listing, I go to Table settings and I see the columns, and I see some are checked off as "Sortable", but the Price column has no checkbox.

Searching the net for threads or modules concerning this, not finding anything.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Cablestein’s picture

I figured it out...

I should be using Sell Price as a field in my View, not Display Price.

Sell Price is sortable, but not Display price.

Which now leaves a question: Why can't you sort Display Price?

TR’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Category: support » feature

A sort can be added to display price - I don't know why it was left out. Anyone willing to roll a patch for this?

Anonymous’s picture

Version: 7.x-3.x-dev » 7.x-3.1

This problem is still present. I had to use "Sell price" as a workaround for now but would very much like for "Display price" field to be sortable. Thanks.

Anonymous’s picture

Version: 7.x-3.1 » 7.x-3.x-dev

Sorry guys. Didn't mean to change the version from -dev.

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

Display price is calculated, not stored in the database, so I'm not sure it's possible to sort on it. Sell price should be good enough for most cases, except perhaps where you have inclusive taxes and untaxed products in the same listings, or are handling discounts with display price somehow - in which case please give more detail, as I'd like to know how people are using display price, and why sell price isn't suitable for you.

divcg’s picture

I just ran into this issue also. We need to use display price because we utilize Price Per Role module for our distributors pricing, and sell price does not reflect the role pricing

mandreato’s picture

Status: Postponed (maintainer needs more info) » Active

On the current D6 site, I'm using "Product: Sell price" field in a table formatted view. It is sortable and contains VAT.

During the migration to D7, I've found that Sell price is not comprensive of VAT, so I should use "Product: Display price" (which has VAT) instead. But it cannot be used as "sortable" in the settings of Table format of the view.

evidence’s picture

Hello, Longwave,

I see this problem has existed for a while now.

I want to create a webshop. I cope with the problem as described above, so I'll answer your question.

It seems logical that one would want to use display price, as it automatically includes the VAT:
1) There is the possibility to add a "Incl. VAT" string after a price.
2) I assume it's the only way you can get your tax reports to work.

But it also seems very logical you want to sort on the price...

I hope someone of the contributor team will pick this up! :)

Kind regards

longwave’s picture

@divcg: You will need Price Per Role to support price sorting in Views, which I don't think is implemented yet.

@mandreato: That is an issue but I wonder if allowing table sorting on sell price for the display price field is good enough for most cases?

@evidence: You can still sort on sell price, and that will work for many cases - the only time it's an issue is if you have products with different VAT rates mixed in the same listing. Does this work for you?

mandreato’s picture

Actually, after D7 migration, I don't display Sell Price at all because it doesn't include VAT.
So, only Display Price is displayed, which is not sortable.

longwave’s picture

Status: Active » Needs review
FileSize
1.67 KB

The attached patch adds click sorting to the display price field when used in a table. Behind the scenes it actually sorts on sell price - this should be good enough for many cases, though it will fail when the display price is not altered consistently.

mandreato’s picture

Status: Needs review » Reviewed & tested by the community

It works !

evidence’s picture

@Longwave
I did not yet try the patch. But your solution works well when there is one VAT rate applied. The click sorting is the only problem I had left, but apparently your patch fixes that as well.

Kind regards,
Evidence

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.