Okay
  Public Ticket #2894811
Cost calculator conditional settings
Closed

Comments

  • Simeon started the conversation

    Where can I find more information about the cost calculator conditional settings? I've installed the demo data present in the pawsitive theme, but there is only one cost calculator example there without any conditional settings...

  •  1,695
    Support Agent 1 replied

    Hi,

    You can find more in our online documentation:

    http://documentation.bold-themes.com/cost-calculator/cost-calculator-conditions/

    Also please find the Cost calculator demo in the attachment and import it for additional examples following this article:

    https://boldthemes.ticksy.com/article/7117/



    Attached files:  demo_data.zip


    Regards, BoldThemes team

    If you like our products please consider leaving us a rating. A huge thank you from BoldThemes in advance!

  • Simeon replied

    Thank you.

    I tried but I can not make it work for my case.

    I have 3 Select lists. The first one (main) is always visibile. The other two (catService and dogService) must be shown based on the selected value in the first one (main). I do not want to add additional cost to the total by selecting Dog or Cat in the main setting, that's why the value for both of them is 0. So I have the following configuration in the first one, always visible Select list (main):

    List Of Dropdown Options *required

    Dog;0;
    Cat;0;

    Conditional Settings

    == 0;catService;hide();
    == 0;dogService;hide();
    == 1;catService;hide();
    == 1;dogService;show();
    == 2;dogService;hide();
    == 2;catService;show();

    This configuration does not work as expected. I expect that 0, 1, 2 are the indexes of the main select list items (0 = nothing, 1 = Dog, 2 = Cat).

  • Simeon replied

    Ok, I think I figured it out. I made a new Cost Calculator group with the following JS code and I put the selects inside it and now it works:

    Pseudo-JS Code

    var main = $1;
    var dogService = $2;
    var catService = $3;

    var result = 0;

    switch(main) {
    case 1:
    result = dogService;
    break;
    case 2:
    result = catService;
    break;
    default:

    }

    return result;




  •  1,695
    Support Agent 1 replied

    Hi Simeon,

    We are glad you have solved the issue.

    Let us know if you need assistance with anything else.


    Regards, BoldThemes team

    If you like our products please consider leaving us a rating. A huge thank you from BoldThemes in advance!