• Hi.
    I am using woocommerce and one extension named Woocommerce product attribute.
    I have already code to display optgroup in select dropdown. But the issue is in javascript named ‘add-to-cart-variation.js’. Due to this function in given js of woocommerce extension, $( '.variations_form .variations select' ).change(); all the value of select get reset (i am thinking so) and when i view the Select Dropdown, all the optgroup label are at the first and remaining option value procedd after all optgroup label are displayed.
    For example:
    Result should be like this->
    A-Label
    —A1
    —A2
    B-Label
    —B1
    —B2

    But the result displayed is like this->
    A-Label
    B-Label
    A1
    A2
    B1
    B2
    how to solve this issue? please help.

    https://www.ads-software.com/plugins/woocommerce/

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

    (@mikejolley)

    These inputs/the javascript do not support optgroups – its a flat list. If you need optgroup support I think you’re going to need to customise the scripts used, and this is advanced.

    I don’t understand why optgroup is needed however – all terms in an attribute should be a ‘group’ anyway?

    @iqbal1486 : have you got any solution for that, if yes than share with me, thank you

    • This reply was modified 8 years, 6 months ago by InitGears.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add optgroup in Select Dropdown on variation product?’ is closed to new replies.