Okay
  Public Ticket #1166459
Add 20% to total - JS pseudo code
Closed

Comments

  • David started the conversation

    Hello,

    I have the plugin installed and working on my page

    Can you tell me how I would add VAT which is 20% to the total.

    Ideally it should look like 

    Total £100 

    and then underneath in small (inc vat £120)

    Also I need this to be reflected in the email too.

    Thanks for you assistance.

  •  275
    Support Agent 1 replied

    Hi David,

    Cost Calculator supports having only one output - Total. Please consider that an alternative way is to include 20% in total price and write JS pseudo code in Cost Calculator Group as following:

    size = $1; 
    sheets = $2; 
    wrapping = $3;
    if (sheets == 0) x = 0;
    if (sheets < 10) x = 1;
    if (sheets >= 10) x = 0.05;
    if (sheets >= 20) x = 0.1;
    if (sheets >= 30) x = 0.15;
    if (sheets >= 50) x = 0.2;
    y = (sheets * size) - (sheets * x) + (wrapping * sheets);
    final = y + (y * 0.2);
    return final;
    

    Also, please consider if you can add Headline or Text Element below Cost Calculator as note that Total includes VAT - 20%.


    Regards, BoldThemes team

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

  • David replied

    Hi,
    I can't seem to find my purchase code and wanted to know if I still have support?
    Can you let me know please.
    Thanks,
    David

  •  361
    Support Agent replied

    Hi David,

    According to the info we have, you have support till November 3rd.

    Let us know if you need additional assistance.

    Regards, BoldThemes team

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

  • David replied

    Thanks for your reply.

    I want to build a new cost calculator, I think it would be similar to the one I already have which you can see at http://www.trizz.co.uk/quote/asbestos-roof-sheet-collection-quote/

    My new one is for calculating the cost of a garage roof removal.

    Questions:

    1. Size in square metres m2 ( can we have two sliders that are for length and width and then calculates the m2? If not I will just have to have a slider with m2 ranging from 10-100

    2. Shape of roof. This will be flat or apex. If it is apex then add 20% to the cost

    3. Is there Good access y/n if no then a message says we will call you

    4. Pricing 

    Minimum price of £300

    If m2 <20 = £30 per m2

    if m2 20-30 = £27 per m2

    if m2 30-50 =£25 per m2

    if m2 50+ = £23 per m2

    Can you help with the best way to set this up please.

    Any help would be greatly appreciated.

    Thank you,

    David

  •  361
    Support Agent replied

    Hi David,

    Please have a look at the answers below:

    1. You could try having two sliders that calculate square meters by adding them to Cost Calculator group, and then defining how they will add up to the total (square meters).

    2. This can also be defined with Cost Calculator group, using 'if' statements. 

    3. There isn't a built in functionality that could display a message based on the chosen value. You could try adding regular text element below calculator with this info.

    4. This calculation is also possible to achieve with Cost Calculator group. The code would be:

    square_meters = $1;
    if (square_meters < 20) final= (square_meters * 30) + 300;
    if ((square_meters => 20) && (square_meters <= 30)) final= (square_meters * 27) + 300;
    return final;

    Please note that these are just examples, and you'll need to define each of the situations with JS code.

    For more info, you can refer to our documentation.

    Let us know if you need additional help.

    Regards, BoldThemes team

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

  • David replied

    Thanks for the reply.

    It's a bit complicated for me.

    How about I pay you to make it for me?

  •  361
    Support Agent replied

    Hi David,

    Unfortunately neither we nor our external associates are available for custom work. Other than that we do not have a recommendation. Maybe you can try Envato Studio: https://studio.envato.com/.

    Thank you for understanding.

    Regards, BoldThemes team

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