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

Okay
  Public Ticket #2389447
Personalize radio buttons
Closed

Comments

  •  1
    Alfonso started the conversation

    Hi,

    I've purchased your plugin and i need to personalize radio buttons style. Is possible to add hook to personalize it or is there any way to add code?


    I need modify your original code on your wpc-variations-radio-buttons.php file:

    echo '<div class="woovr-variation-selector"><input type="radio" name="woovr_variation_' . $product_id . '" ' . ( empty( $df_attrs ) ? 'checked' : '' ) . '/></div>';

    with this code:

    echo '<div class="woovr-variation-selector"><label><input class="option-input radio" type="radio" name="woovr_variation_' . $product_id . '" ' . ( empty( $df_attrs ) ? 'checked' : '' ) . '/></label></div>';

    I don't want to loose the modifications in a future plugin update.

    How is the best way to apply it??

    This is an example with original code:

    https://desa.delahuertacasa.com/producto/verdura-fruta-de-temporada-m-10kg/


    And this is an example with custom code (its only add <label> and input class="option-input-radio"):

    https://desa2.delahuertacasa.com/producto/verdura-fruta-de-temporada-m-10kg/


    Thanks


  •  767
    Janilyn replied

    Thanks for the information, Alfonso. 

    I have transferred your ticket to our developer so that he can check and give you further help.

    He'll start working on this and will be responding as soon as he's available for support. 

    Please stay patient meanwhile.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,223
    Dustin replied

    Hi Alfonso,

    Please update our plugin to latest version 2.0.3 then you can add below function to current theme (or child-theme) / functions.php

    add_filter( 'woovr_variation_radio_selector', 'your_woovr_variation_radio_selector', 99, 3 );
    function your_woovr_variation_radio_selector( $selector, $product_id, $checked ) {
       return '<div class="woovr-variation-selector"><label><input class="option-input radio" type="radio" name="woovr_variation_' . $product_id . '" ' . $checked . '/></label></div>';
    }

    Best regards,
    Dustin

  •  1
    Alfonso replied

    Hi there Frankie,


    thank you very much, now is perfect! Congratulations!

  •  1,223
    Dustin replied

    You're welcome!smile.png

    If you are satisfied with our plugin and support, please reward it with a full five-star ★★★★★ rating.
    https://wordpress.org/support/plugin/wpc-variations-radio-buttons/reviews/?filter=5
    Thank you in advance! <3

    Best regards,
    Dustin