ResolvedHow to make variation optional
- This topic has 5 replies, 2 voices, and was last updated 2 years, 6 months ago by
Althemist.
- AuthorPosts
- September 8, 2020 at 4:07 pm #25561
opicron
ParticipantHow can I make the choice of an variable attribute optional?
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 ;).
September 9, 2020 at 11:24 am #25576Althemist
KeymasterI 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,
DimitarSeptember 9, 2020 at 11:05 pm #25611opicron
ParticipantIn 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 😉
September 10, 2020 at 10:02 am #25626Althemist
KeymasterI 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.
September 10, 2020 at 6:09 pm #25644opicron
ParticipantI 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.
September 13, 2020 at 12:25 pm #25686Althemist
KeymasterCommenting 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 - AuthorPosts
You must be logged in and have valid license to reply to this topic.