Forums Forums Search & Filter Pro Woocommerce Product Variations

Viewing 10 posts - 1 through 10 (of 14 total)
  • Anonymous
    #14339

    Hello, we are trying to use your plugin on a woocommerce shop but we have a problem with product variations, your plugin seems to look only in parent products attributes and not in variations.

    Can you help us?
    Thank you,
    Stefano

    Anonymous
    #14340

    I think you should do a query similar to this one and use the resulting ids to query the wp_postmeta table:

    SELECT CONCAT(wp_posts.ID,’,’,GROUP_CONCAT(wp_posts_variations.ID)) as ids FROM wp_posts as wp_posts
    LEFT JOIN
    wp_posts as wp_posts_variations
    ON (wp_posts.ID = wp_posts_variations.post_parent)
    WHERE wp_posts_variations.post_type = ‘product_variation’ AND wp_posts.post_type = ‘product’
    GROUP BY wp_posts.ID

    Ross Moderator
    #14341

    Hey there

    I had a user who had problems with post meta and product variation – unfortunately we never got to a quick solution.

    I’m wondering, are product variations just child posts of the parent post (product)? If so, they should be included in the search, perhaps they have some strange status applied to the post type (ie, not published) which means that a regular WP_Query skips these…?

    Not sure if you would know, but would love to add it to the plugin if its not working properly.

    RE your SQL above, this does sound right – but I’m trying not to use any custom SQL syntax, rather keeping to the methods that are found within WP_Query (minus the sql stuff) – just for forwards compatibility.

    Thanks

    Anonymous
    #14343

    ID post_author post_date post_date_gmt post_content post_title post_excerpt post_status comment_status ping_status post_password post_name to_ping pinged post_modified post_modified_gmt post_content_filtered post_parent guid menu_order post_type post_mime_type comment_count
    35 1 2015-03-30 17:03:41 2015-03-30 15:03:41 Variation #35 of AR111-15W publish closed open product-20-variation 2015-03-30 17:03:41 2015-03-30 15:03:41 20 http:/***.com/product_variation/product-20-variation/ 0 product_variation 0

    A product variations looks like this one, it’s a child post and it’s published but has “product_variation” as post_type instead of “product” so the query generate by your plugin query will skip it, also this custom post type isn’t shown in admin by default.
    I will look for a more solid way to implement the query but you should absolutely support product variations, the most of the products has a variation (color, sizes, etc)

    Anonymous
    #14348

    I’ve found out that the best way to do this will be to use taxonomies, every attribute of a child product is also assigned as a taxonomy to the parent, it works out of the box just setting taxonomies to public.

    Now, is it possible to query taxonomies using a range slider?

    Ross Moderator
    #14349

    Ahhh thanks for your help – yeah I thought taxonomies were working fine but not the meta queries (on things like price)…

    Unfortunately no its not possible to set a taxonomy as a range slider as taxonomies aren’t designed to handle numeric data – what kind of numeric data are you trying to apply the slider to?

    Thanks

    Anonymous
    #14350

    I have attributes like power consumption (watts), light intensity (lumen), light cone wideness (°deg)
    (ex. http://beta.domagic.it/product/ledcandle/)

    So i really need a solution like a range slider, what would you suggest?

    Ross Moderator
    #14354
    This reply has been marked as private.
    Anonymous
    #14395

    Hi Ross, I appreciate your offer but it will not be necessary, I like your plugin and I’m pretty sure i will use it in other projects in future.

    Plus, I’m back to post_meta and I’ve a working solution https://gist.github.com/914f5ac1b942f8c51778
    I went for the fastest way, I would like to overwrite your filters (filter_meta_query_where,filter_meta_join ) from a plugin, what would be the right way to do that?

    Check it and if you like consider implementing it directly in your plugin, maybe after some optimization.

    Anonymous
    #14396

    Oh, sorry, there was an error, it should be fixed now https://gist.github.com/anonymous/74b83b79457daa810843

Viewing 10 posts - 1 through 10 (of 14 total)