• Resolved boeris

    (@boeris)


    Hi there,
    few weeks ago i’ve opened a thread tell you that there was a problem with the woocommerce priice filter widget, but after answering the first time ( @stuartduff ) you guys forgot about the thread. So here again I show you what the problem is:
    Original message:
    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

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

  • The topic ‘Price widget not working correctly’ is closed to new replies.