Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Jul 2011 at 11:18 UTC
Updated:
10 Oct 2012 at 02:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
andypostSubscribe
Comment #2
rszrama commentedI think we'd just need a custom handler that handles the conversion when the exposed filter is submitted. I haven't done any development of exposed filters before, though, so I'm not sure exactly what it requires.
Comment #3
podarokrewriting sql query helps me
but this fix works only for particular view with a custom name and custom field name
Comment #4
rszrama commentedThis also doesn't take into consideration the fact that different currencies will need different multipliers (i.e. some will be * 10, some will be * 1). Your alter will work for currencies like USD or EUR, though. We still need a general exposed filter handler that uses commerce_currency_amount_to_decimal().
Comment #5
rszrama commentedHmm, speaking of which, there isn't an easy way to determine the currency to use when doing the transformation. So I think what we'll have to do is just add a currency code select list to the form; unfortunately this just won't support multi-currency product lists.
Comment #6
podarokYes, I know that
But As I know - most currencies have 100 "points" in 1 "item"
Possibly we have to store that information somewhere for conversion?
I don`t know a universal solution but this snippet can help in particular
Possibly we have to hack new views price handler with an optional option for koef multiplier for every enabled currency
Comment #7
EndEd commentedsubscribe
Comment #8
cardentey commentedsubscribe
Comment #9
dazz commentedsubscribe
Comment #10
msmithcti commentedHas any progress been made with this issue? Trying to use the price exposed filter in views to allow users to filter by price. Can't really show users the unformatted price. Is #3 still the best solution at the moment?
Comment #11
podarokYes
#3 work in production for me
And I have no any working code for a better solution yet
Comment #12
msmithcti commentedI'm trying to get #3 to work but it's just failing silently. This is what I've done:
I'm not sure what's gone wrong, have I missed a machine name that needs changing?
Thanks in advance.
Comment #13
dpolant commentedHere is a patch for commerce that adds a better price filter handler and attaches it to the existing price filters. Remember to clear the cache after applying the patch.
With this patch, in the filter configuration for price fields, you can now specify a currency to use as a modifier for the amount users send through the input. The currency selector is not currently present on the value form that the user sees when performing the search.
Patch applies to latest 7.x-1.x-dev.
Comment #14
msmithcti commentedI've applied the patch in #13 and cleared the cache but I can't see an option to specify the currency and the field on the exposed filter is still only taking the 4000 rather than 40.
You say the patch applies to 7.x.1.x-dev, I'm using 7.x.1.1 - is there something in the dev version that is specifically needed and that's the reason it's not working? I'm assuming that's the case?
Comment #15
dpolant commentedIt sounds like the views hooks aren't getting loaded. Few questions:
1) did you use git to apply the patch?
2) are you using commerce kickstart?
3) did the patch give any errors when you applied it?
The patch modifies the .module and .info of commerce_product_pricing, and adds includes/views with a .views.inc and a handlers directory for the new handler. It applies ok for me on dev, and most of the new code blocks seem like they would work on 1.1.
BTW make sure you only have one version of commerce installed. (e.g. if you're using commerce kickstart make sure there isn't a commerce codebase in sites/all/modules).
Comment #16
msmithcti commentedThanks for getting back to me. I'm using commerce kickstart with the module files moved to sites/all/modules as suggested on the distributions page. I initially used Netbeans to apply to patch - tends to work OK with simple patches but doesn't seem to work when files are being added etc. I've now used git to apply the patch (msysgit) and I'm getting some errors with the .info file:
It may be me doing something wrong - I've not got a massive amount of experience working in git!
Thanks in advance.
Comment #17
dpolant commentedLooks like the patch just doesn't apply to 1.1, it's saying that some of the context can't be found. Probably if you edit the patch manually and remove the changes to the .info it will apply, and then you can simply add the changes back in to your code.
In the meantime, welcoming any testing of #13 on 1.x dev.
Comment #18
mmncs commentedIs that to the dev version from 2011-Dec-10?
Thanks.
Comment #19
dpolant commentedPatch #13 was rolled on november 29, but it should work on the most current dev. Let me know if it doesn't and i'll remake it.
Comment #20
madurax86 commentedI could not apply the patch through git, so I applied it manually here's the new patch I got against commit f168aff274a8ae8b7e0ab5cf7439630cca4d398e after I patched it.
Sorry for having it in the post, I can't find the attach button on edit mode.
The issue is still there for getting in between values, can someone take a look?
Comment #21
amateescu commentedIt seems that a lot of people are asking for a proper solution here, so here's a new patch that adds this filter in commerce_price.module, where it belongs :)
Comment #22
rszrama commentedCool, thanks amateescu. Tested it and works fine for me, including for price ranges, and yes it needed to be in the Price module. : )
Committed!
Comment #24
tonylegrone commentedCan anyone explain why this method was added in the patch to remove regular expressions?
Comment #25
rszrama commentedNot sure; I'm guessing we just couldn't support it.
Comment #26
Pnoia commentedIs the fix implemented in the newest version of commerce? I still seem to have this issue..
*edit*
I upgraded to newest version, but needed to create a new view
Thanks!
Arne