Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2873431
Checkbox
Closed

Comments

  •  4
    Elena started the conversation

    Hi, 

    Is it possible to set the checkbox so that it is not selected by default?


    thanks.

    elena

  •  767
    Janilyn replied

    Hi Elena,

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,226
    Dustin replied

    Hi Elena,

    Please add the below custom code (How to add custom code?)

    add_filter( 'wooco_component_checkbox_checked', 'wooco_component_checkbox_unchecked', 99, 2 );
    function wooco_component_checkbox_unchecked( $checked, $component ) {
        if ( $component['optional'] === 'yes' ) {
            return false;
        }
        return $checked;
    }

    Then all optional components will be unchecked by default.

    Best regards,
    Dustin

  •  4
    Elena replied

    Thank you. It works.

    lg Elena

  • Paco replied

    Hello,
    I have tried this solution as is working, is there any other way around to disable Check All for all items?

    Also it would be nice if the default option was unchecked, it would be the expected behavior.

    Thanks in advance and congratulations for the great work!

    Sorry, now I noticed that this is not for Frequently Bought Together.

  •  1,226
    Dustin replied

    Hi Paco,

    I've replied to your ticket here https://wpc.ticksy.com/ticket/3004758/

    Best regards,
    Dustin