Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm working in a Commerce Kickstart distribution. I enabled facetapi_pretty_paths and get it working properly in all faceted search blocks provided by this distribution.
But I can't get it working for the Price faceted search block.
For this block I set the value of "Pretty path alias" to field_product:commerce_price:amount_decimal
, but then when I try to filter the product by price it doen't work. All products are shown regardless their prices.
Is this a bug? misconfiguration?
Comments
Comment #1
dasjoi'm not familiar with commerce_kickstart but to track this down, lets compare how the price facet works without and with pretty paths at the moment.
could you provide example urls generated by the price facet for both cases?
Comment #2
dasjoComment #3
Narhir CreditAttribution: Narhir commentedHi dasjo,
the generated link looks like this:
field_product%253Acommerce_price%253Aamount_decimal/%5B79%20TO%20110%5D?
the input field above: " Pretty paths will be generated as "search/url/segment1/segment2/" ... " have this in them by default:
field_product:commerce_price:amount_decimal
if in the input field I would write "test" it would partialy fix the problem and the url would look like that:
/test/[35 TO 457]? - but still it snt to pretty
Comment #4
dasjoit seems like the price facet is some kind of range facet. first, you'd need to define how the output should be represented.
implementation-wise, the way to go i think is to create a custom coder plugin:
from the project page:
<alias>/<term-name>-<term-id>
".Comment #5
therobyouknow CreditAttribution: therobyouknow commentedThese plugins appear to already be present - see the following path for the module:
sites/all/modules/facetapi_pretty_paths/plugins/coders
Comment #6
dasjothere already exists a generic plugin and two for taxonomy terms, but what i meant in #4 was create a custom coder plugin for price range facet
Comment #7
therobyouknow CreditAttribution: therobyouknow commentedWould search_api_ranges module or select_with_style module work with facetapi_pretty_paths to provide the price range facet?
Comment #8
dasjothe range facet may be provided by one of the states modules.
in order to make their paths pretty, you need to implement what i have described in #4 and #6.
Comment #9
dasjoi consider this support request to be solved by my previous comments and am turning this into a postponed feature request.
if somebody would like to provide a patch, let's give this a try.