Invisible variations

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


    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.

    Tom Anbinder
    Plugin Support


    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,

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Price based on User Role for WooCommerce’ is closed to new topics and replies.