ResolvedHow to make variation optional

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #25561
    opicron
    Participant

    How can I make the choice of an variable attribute optional?

    Winter BBQ

    Now I have to choose an option, but the client wants to have an no-option possibility.

    I would like to avoid an attribute [no option] as it defies the point ;).

    #25576
    Althemist
    Keymaster

    I am afraid that would not be possible and it’s not theme related. It’s how WooCommerce work. If a product is variable you must choose a variation.

    You can achieve this without attributes and variations by using our addons, but they can’t be used inside composite products (it looks like you’re using the WooCommerce Composite Products plugin).

    Regards,
    Dimitar

    #25611
    opicron
    Participant

    In that case, is it possible to avoid turning off the selected option? That will help significantly.

    PS: Getting Lafka swatches to work with Composite products was quite a challenge indeed 😉

    #25626
    Althemist
    Keymaster

    I am afraid no. It’s just how WooCommerce attributes work. That’s why I suggested using our custom product addons instead of the product attributes. There you can set the addons selection to be mandatory, limit the number of selected options etc.

    #25644
    opicron
    Participant

    I found that commenting out the following in lafka-plugin-swatches.js (from lafka plugin) actually makes my request possible.

    if ( $el.hasClass( 'selected' ) ) {
         //$select.val( '' );
         //$el.removeClass( 'selected' );
         //delete selected[selected.indexOf(attribute_name)];
    }

    PS: Could you activate the theme download on my account? I cant seem to download it.

    #25686
    Althemist
    Keymaster

    Commenting that code could lead to other problems and compatibility issues with other plugins, so doing it is on your own responsibility. If it does the job for you – great.

    Not really sure what do you mean to “activate the theme download on my account”. There is no such activation. You can either download the theme from ThemeForest OR use the official Envato Market Plugin (included with the theme) and set automatic updates.

    Regards,
    Dimitar

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register