Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Thread Starter tommyleyland

    (@tommyleyland)

    I tried that, it didn’t seem to make any difference to be honest?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    It does. Options are conditional if ajax is not used.

    Thread Starter tommyleyland

    (@tommyleyland)

    Thanks.
    So when you select the first variation, the next one should update to what’s available?
    I will try again. I’ll post my results soon.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Yup thats right.

    Hi Tommy,

    Did you find a bit of code that made this work for you?

    I’ve been searching for ages to try and find a way to do this, and it seems impossible so far.

    Mike, the above link to the code doesn’t work for me.

    I’m setting up an online print shop, trying to hide variations that don’t apply to the other selections.

    Product Example Options:

    Material: 170gsm | 250 gsm | 350 gsm | 400 gsm |
    Sided: Single | Double |
    Finishing: No Finishing | Matt | Gloss | Velvet |
    Print Run: 250 | 500 | 1000 | 2000 | 5000 |

    Scenario:

    If ‘170 gsm, 250 gsm or 350 gsm’ is selected as the ‘Material’ option.
    The ‘Finishing’ attribute should hide or eliminate ‘Matt, Gloss and Velvet’, leaving only the ‘No Finishing’ as a option to be selected.

    Is this possible to achieve?
    If so, can you point me in the right direction?
    I’m happy to give you my log in details to achieve this as well, as I’ve been trying to resolve this for so long now.

    Thanks,
    Paul

    Sorted it now guys, released that I had to increase the amount by a lot.

    Hi newvisiondesigns

    Could you please post your code that works in your usecase.

    Hi @jameskira,

    The code I ended up using was:
    **********
    // Woo Commerce – Make Variations only appear when available
    function custom_wc_ajax_variation_threshold( $qty, $product ) {
    return 500;
    }

    add_filter( ‘woocommerce_ajax_variation_threshold’, ‘custom_wc_ajax_variation_threshold’, 10, 2 );
    *********

    Remove the stars!!

    I added this to the bottom of my themes functions.php file.
    Increase the ‘return’ number depending on how many variations you have.

    Did this help at all?

    Thanks,
    NVD

    Hi NVD,

    Using WooCommerce I’m trying to build something with exactly the same functionality as what you’ve created. I’m a novice at this kind of thing, so I’ve copied your code and pasted it onto the bottom of my theme’s functions.php file. Unfortunately your code hasn’t produced any changes. (I’m using Themeco’s X with a Child theme, the code has been pasted on the main functions.php file, not the Child theme file).

    On my ‘Product’ settings I’ve set certain variables to be ‘out of stock’, is there anything else I’ve missed? (Sorry for my ignorance on such matters!, any help would be appreciated).

    Al.

    A solution is no longer needed, thanks.

    Al.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Hide variations that don't match Woocommerce’ is closed to new replies.