[CLOSED] Conditional list items

Home – SaaS Forums Support questions WooPrice Calculator (Pro) [CLOSED] Conditional list items

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7563
    Marnick Menting
    Participant

    Thanks for this awesome plug-in. I have one question: Can I make some list items dependable on choices of other input? For example, when I select a Canon camera, I only want to show Canon lenses, not Nikon lenses. Similar functionality is in WooCommerce Composite Products (https://woocommerce.com/products/composite-products/). I can program, so if there is any hook or hack or any way to do this in Excel or template, I would be very happy.

    #7567
    Anonymous
    Guest

    Hi,
    Yes of course you can do it with our plug-in using the conditional logic in the calculator you have created. Choosing so the field you want to show in base of the choice of another field. For more information on how you can achieve that please visit our documentation site : https://altoswebsolutions.com/documentation/8-conditional-logic . Don’t forget to check our video tutorial too. If again you are not clear how to do it, please feel free to contact us and find another way to help you.

    Best regards
    Ennie
    AT133

    #7566
    Marnick Menting
    Participant

    Yes, I know how to make steps depending on other steps. But I only want to enable/disable certain VALUES within a step. I needed a solution quickly, so I just did it hard-coded with JS. But would be cool if the client could change it within your plugin.


    var disables = {"4_4": ["5_2"]};

    for(var disabler in disables) {
    var disableOptions = disables[disabler];
    var shouldDisable = $('#aws_price_calc_' + disabler).is(':checked');

    disableOptions.forEach(function(option){
    console.log(option);
    var el = $('#aws_price_calc_' + option);
    if(shouldDisable && el.is(':checked')) {
    // Unselect the illegal option
    el.prop('checked', false);
    }

    el.attr('disabled', shouldDisable);
    });
    }

    #7565
    Enrico
    Participant

    Hi Marnick,

    Conditional Logic is not about “steps” but it let you hide or show fields based on other fields values.

    If you want to enable/disable certain values, then you can create two different fields with different values and show one or the other based on the previous choice. I would like to make an example for you (Because I didn’t understand completely what calculator you are trying to do, but if you would explain it to me I would be really happy):

    Field 1: “Camera” with the options [“Camera_A”, “Camera_B”]

    Where: Camera_A has Canon Lenses and Camera_B has Nikon lenses.

    Then I have the fields:

    Field 2: “Lenses type” with the options [“Canon A”, “Canon B”, “Canon C”]
    And Field 3: “Lenses type” with the options [“Nikon A”, “Nikon B”, “Nikon C”]

    So using conditional logic you can write rules like these:

    – If “Camera” = “Camera_A”, then show “Lenses type” [Field 2] and hide “Lenses type” [Field 3]
    – If “Camera” = “Camera_B”, then show “Lenses type” [Field 3] and hide “Lenses type” [Field 2]

    This feature will be maybe done in the future, but please if you think these would be a feature you would really need, feel free to send an email to “https://altoswebsolutions.com/contact-us”, so I can make a quotation for you.

    Kind Regards,
    Enrico
    AT133

    #7564
    Marnick Menting
    Participant

    Thanks, I understand. But I have some complex combinations of options which would mean that I create tens of extra fields. But for now my JS option works enough.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.