Total : 0.00 €

Before contacting us, please make sure to check our F.A.Q

Please, login or register to our website in order to be able to post a presale question in the forum.

× WooPrice Calculator PRO

# [CLOSED] Conditional list items

3 years 2 months ago #1164 by Marnick Menting
Marnick Menting replied the topic: Conditional list items
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.

3 years 2 months ago #1159 by Enrico
Enrico replied the topic: Conditional list items
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 " altoswebsolutions.com/contact-us ", so I can make a quotation for you.

Kind Regards,
Enrico
AT133

3 years 2 months ago #1144 by Marnick Menting
Marnick Menting replied the topic: Conditional list items
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);
});
}```

• Ennie
3 years 2 months ago #1139 by Ennie
Ennie replied the topic: Conditional list items
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 : 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