Invisible variations

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #98424
    leandropl
    Member

    Hi,

    I’ve just bought this plugin, and testing along with WP All Import, I saw that when a product’s variation has no price setted, it is not listed at all at the “Price by User Role: Per Product Settings” product metabox.

    Debugging the problem, I fixed it with the woocommerce_hide_invisible_variations hook, at the line 240 of the includes/admin/class-alg-wc-price-by-user-role-settings-per-product.php file this way:

    add_filter('woocommerce_hide_invisible_variations', '__return_false');
    $available_variations = $_product->get_available_variations();
    remove_filter('woocommerce_hide_invisible_variations', '__return_false');

    Since, at my point of view, there is no reason to hide invisible variations at the edit product screen, I think this plugin should be updated with this fix.

    I hope I have helped.

    #98425
    blankTom Anbinder
    Moderator
    Plugin Support

    Hi,

    That’s a good point and thanks for the provided solution. We will definitely include it in next plugin update, however I’m thinking of using $_product->get_children() instead of $_product->get_available_variations() with woocommerce_hide_invisible_variations filter – as far as I remember it will list invisible variations also (will have to re-test that though).

    Will let you know here as soon as update is ready.

    Best regards,
    Tom

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.