• Resolved boerisbikes

    (@boerisbikes)


    Hi there!
    We’re still developing a new ecommerce that will become live next week. Therefore the website is still under maintenace, and if you need to look into it i will give you access.
    We have a problem with the price range widget, which doesn’t work correctly.
    For ex. if we’re in a archive page and we have prices going from 3 to 100€ the widget will show the range for example from 2 to 120€. Furthermore if a product is for ex. 4.5€ and we set the range from 5€ to 100€ it will show it anyway. We think the problems resides with taxes, because when we deactivate them, price range looks to work nicely.
    Thanks!

    Regards

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @boerisbikes,

    Could you temporarily open your site up for public viewing please and link to an archive section so we could see this behaviour on your site and look at the products within your filter so we can try to replicate this on our installs too.

    Thread Starter boerisbikes

    (@boerisbikes)

    @stuartduff
    Hi there!
    Thanks for your answer and sorry for late reply.
    Could you please provide an email address to forward you login credentials, as we’re opening to the public only next month.
    Thanks

    Regards

    Thread Starter boerisbikes

    (@boerisbikes)

    Hi there @stuartduff,
    I’ve tried the filter on a clean install and woocommerce sends a wrong query to SQL.
    In fact with taxes activated (all 22%) and doing any search with the default woocommerce price range filter, it sends a query FROM price without tax (wrong calculated: for ex. input 5, without vat should be 4.1€ + 0.90€ (22%) [5/1.22% = 4.10€] = 5 but the input sent is 3.9€ which i think is derived like this: 5 * 0.22 = 1.10, 5 – 1.1 = 3.9€);
    and the TO is like the input.
    See the example:
    Url: https://localhost/shopping/negozio/?min_price=300&max_price=488
    The query is:

    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
    FROM wp_posts 
    INNER JOIN wp_postmeta
    ON ( wp_posts.ID = wp_postmeta.post_id )
    WHERE 1=1 
    AND ( wp_posts.ID NOT IN ( 
    SELECT object_id 
    FROM wp_term_relationships 
    WHERE term_taxonomy_id IN (7) ) )
    AND ( ( wp_postmeta.meta_key = '_price'
    AND CAST(wp_postmeta.meta_value AS DECIMAL(10,2)) BETWEEN '<strong>234</strong>'
    AND '<strong>488</strong>' ) )
    AND wp_posts.post_type = 'product'
    AND (wp_posts.post_status = 'publish'
    OR wp_posts.post_status = 'private')
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.menu_order ASC, wp_posts.post_title ASC
    LIMIT 0, 10

    Attached you can see images of the configuration:

    View post on imgur.com

    Thanks

    Regards

    • This reply was modified 6 years, 11 months ago by boerisbikes.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter price widget not working properly’ is closed to new replies.