[CLOSED] Conditional list items
Home – SaaS › Forums › Support questions › WooPrice Calculator (Pro) › [CLOSED] Conditional list items
- This topic has 0 replies, 2 voices, and was last updated 3 years, 2 months ago by
Anonymous.
-
AuthorPosts
-
February 5, 2018 at 9:24 pm #7563
Marnick Menting
ParticipantThanks 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.
February 9, 2018 at 7:18 pm #7567Anonymous
GuestHi,
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
AT133February 11, 2018 at 1:27 pm #7566Marnick Menting
ParticipantYes, 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);
});
}
February 14, 2018 at 10:18 am #7565Enrico
ParticipantHi 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
AT133February 15, 2018 at 11:14 am #7564Marnick Menting
ParticipantThanks, 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.
-
AuthorPosts
- You must be logged in to reply to this topic.