• Resolved misstest

    (@misstest)


    On the communication preferences, you have the option to choose multiple lists.

    Is it posible to force customers to choose only 1 option? To belong only to 1 list?

    And can i make this list invisible once they chossen a list?

    • This topic was modified 4 years, 3 months ago by misstest.
    • This topic was modified 4 years, 3 months ago by misstest.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author dyszczo

    (@dyszczo)

    Hi,

    You can customize the communication preferences template by copying it from src/Frontend/templates/communication_preferences.php to yourtheme/shopmagic/communication_preferences.php.
    Then you can change checkbox to radio or add some more complex behaviours like hiding options when a user has subscribed or did some other stuff.

    Thread Starter misstest

    (@misstest)

    Thanks!! I mannage to change it to radio ??

    But how can you hide options when a user has already subscribed?

    Thread Starter misstest

    (@misstest)

    Sorry I coudn’t make it to change it to radio. The options are now in radio but I can choose all options and I can’t uncheck.

    In order to make the radio work i need to give all radios the same name, but it doesn’t send an email or it only shows a mensage saying “You are managing preferences for [email protected]

    Plugin Author dyszczo

    (@dyszczo)

    Hi @misstest,

    In the template $opt_ins variable is available. This is object with all info about optint/optouts.

    You can check if user opted-in/out using methods:

    $type_id = 1;
    $opt_ins->is_opted_in( $type_id );
    $opt_ins->is_opted_out( $type_id );

    These methods return true/false for given type id.

    > In order to make the radio work i need to give all radios the same name

    Unfortunately you can’t use the same name for all inputs because backend requires data in certain format.

    Simple resolve would be to enforce only one radio using the JS. Please check if that code helps:

    jQuery('.shopmagic-optin input[type=radio]').click(function(e) { 
        jQuery('.shopmagic-optin input[type=radio]').not(this).not('[disabled=disabled]').prop('checked', false); 
    } );
    • This reply was modified 4 years, 2 months ago by dyszczo.
    Plugin Support damianmachnik

    (@damianmachnik)

    I am marking this topic as resolved. If you have any issues, please respond.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Choose only 1 list’ is closed to new replies.