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

Okay
  Public Ticket #4544459
Suggestion: Don't toggle checkbox when component is required
Open

Comments

  •  5
    Rudolf started the conversation

    Hi,

    i have a composite product which has this component:

    • only 1 product in this component
    • product is default
    • is required = yes

    The checkbox is enabled by default. But the customer can still uncheck the component which does not make sense in this case and might confuse the customer. Could you lock the checkbox in this case so that the customer can't change it?

    What do you think?

    Attached files:  2026-02-18 22-49-05.mp4

  •  1,688
    Dustin replied

    Hi Rudolf,

    Please follow these steps:

    #1. Install an updated version: https://www.dropbox.com/scl/fi/31kumshj4600l0683xii5/wpc-composite-products-7681.zip?rlkey=8d1yr9b9zn0vdjtskjzju1937&dl=1

    #2. Add the CSS code below to WP-Admin → Appearance → Customize → Additional CSS:

    .wooco_component_product[data-required="yes"][data-count="1"] {
        pointer-events: none;
    }

    Best regards,
    Dustin

  •  5
    Rudolf replied

    Hello Dustin,

    thank you so much for your quick support! It works almost perfectly.

    The only flaw is that you can't click on the Link icon anymore. This would still be helpful.

    Is there a workaround possible? Thanks!

    Attached files:  unclickable icon.png

  •  1,688
    Dustin replied

    Please REPLACE the previous CSS code with a new one:

    .wooco_component_product[data-required="yes"][data-count="1"] {
        pointer-events: none;
    }
    
    .wooco_component_product[data-required="yes"][data-count="1"] .wooco_component_product_selection_list_item_link {
        pointer-events: auto !important;
    }

    Best regards,
    Dustin