Product Icon

Product Add-Ons

Offer add-ons like gift wrapping, special messages or other special options for your products.

Product add-ons default values

Ability to set default values for add-ons created with Product Add-ons.

Author

Current Status

Planned

Last updated: August 15, 2022

39 comments

Log in to comment on this feature request.

  1. markofnone says:

    This plugin has default values for all field types built-in: https://www.studiowombat.com/plugin/advanced-product-fields-for-woocommerce/

  2. Gareth Harris says:

    You can add default values for all field types using the WooCommerce Product Add-Ons Ultimate plugin: https://pluginrepublic.com/wordpress-plugins/woocommerce-product-add-ons-ultimate/.

  3. poehah says:

    It’s strange that this has not been added yet after so long. For anyone looking, this feature is already included in the Advanced Product Fields plugin from Studio Wombat at https://www.studiowombat.com/plugin/advanced-product-fields-for-woocommerce/

  4. refillerydistrict says:

    If you want to change the function to something else, you just need to find which function that is.

    Here are the available functions I could which need to be changed in the code for your use case:

    wc-pao-addon-custom-price
    wc-pao-addon-checkbox-group-required
    wc-pao-addon-custom-text

  5. refillerydistrict says:

    For anyone wanting to set default values, 2023 showed us that we have this beautiful new tool called Chat GPT that can customize code for things like this! I wanted to have my checkbox for a bottle deposit selected by default so here is the code it generated and it works!

    function add_custom_javascript() {
    ?>

    jQuery(document).ready(function(){
    jQuery(‘.wc-pao-addon-checkbox[value=”paper-bag-fee”]’).prop(“checked”, true);
    });

    <?php
    }
    add_action( 'wp_head', 'add_custom_javascript' );

    Add this to your functions.php in your child theme or parent theme if you don't use a child theme.

  6. milkstyles says:

    Cant believe you cannot do this! I just tried, this sucks! please add this!

  7. Lee says:

    I would also like to have the option to set default values for checkboxes and radio buttons.

  8. Sofie Östlund says:

    The price is only calculated and displayed when all addons have been selected. In this respect, it would make sense to be able to specify a default value

  9. victor says:

    its stupid dont have this option. -.-!

  10. Samuel says:

    Yes , please add the option to be able to create a draft product with a set of default parameters

  11. Jay says:

    A dropdown of pre-configured values. I want customers to be able to select and apply suggested blocks of text to personalise their product e.g. special messages when buying gifts for others. Would be great if customers could edit the font of the text e.g. WYSIWYG editor/textarea

  12. DL says:

    if( $(‘[class*=”wc-pao-addon-wrap”]’).length )
    $(‘[class*=”wc-pao-addon-wrap”]:first-of-type input’).prop(‘checked’, true);

  13. Anonymous says:

    f( $(‘[class*=”wc-pao-addon-wrap”]’).length )
    $(‘[class*=”wc-pao-addon-wrap”]:first-of-type input’).prop(‘checked’, true);

    It does not work!!!

    Does anyone have a fix for that?

  14. Matteo says:

    I must say I’m really surprised such basic feature is not there yet. I’ll look for another plugin because of this feature missing.

  15. Anonymous says:

    Incredible its not included… This is really important and basic in all similar plugins.

  16. Chiu says:

    Did some research online and managed to put together a piece of code that worked for me! This will remove “Select an Option…” on the dropdown box (which appears if you set it to “Required”) and then set your first option to be the default option. I am not a developer though, so if this code is not working for you, please approach others. Just sharing what worked for me 🙂

    jQuery(document).ready(function(){
    jQuery(‘.wc-pao-addon-select option:contains(“Select an option…”)’).remove();
    jQuery(‘.wc-pao-addon-select’).prop(‘selectedIndex’, 0);
    });

    Paste this in a plugin such as https://wordpress.org/plugins/custom-css-js/ with their “Add JS” option.

    You can remove the line
    jQuery(‘.wc-pao-addon-select option:contains(“Select an option…”)’).remove();
    if you prefer to keep the “Select an option…”

    Screenshot: https://share.getcloudapp.com/Blu5YwlW

  17. Anonymous says:

    please add this out of the box… kinda shocked it isn’t an option

  18. Gene says:

    Yes, please add the option to set default values for checkboxes and radio buttons, thanks!

  19. TechTone says:

    I agree 100%. Not everyone knows and be assumed how to deal with coding. This is a must feature out-of-box.

  20. Sven Adam says:

    Sorry, keusta, I don’t know Java Script

  21. simon says:

    I really need this feature!

  22. Samuel says:

    Certainly an absolute necessity have fundamental element in this extension. Why have clients play out an additional progression of choosing a default esteem where it ought to be “default” without the need to looking over a dropdown list and tapping on it!

  23. Julien says:

    I just want to removed the word ‘None’ or ‘Select an option’

  24. Anonymous says:

    In a multi language website (wpml), the name of the select changes with the language selected.
    So selecting the default value by jquery has to be done for every language. 🙁

    So I think for a proper application design this feature should be implemented in the plugin.

  25. Anonymous says:

    Does anyone know a code snippet that will automatically select the first option of all fields during the page load?