Cost Calculator Group is a container element and it inludes JS pseudo code field which allows you to create calculation logic for your cost calculator instance. On the following example calculation is: Total = (Item Type * Number of Items) + (Number of Items * Include Shipping * 1.5)
CALCULATOR GROUP
var number_items = $2;
var shipping = $3;
var result = number_items * type + shipping * number_items * 1.5;
return result;”][bt_cc_select name=”Item Type” value=”Type 1;50;This is item type 1 – $50
Type 2;100;This is item type 2 – $100″][bt_cc_slider name=”Number of Items ($1)” value_max=”10″ value_step=”1″ value_unit=”1″ value_min=”0″][bt_cc_switch name=”Include Shipping ($10)” value_off=”0″ value_on=”10″][/bt_cc_group][/bt_cost_calculator]
CONDITIONS
Cost Calculator conditional logic allows you to show or hide fields depending on the item value. You can use any jQuery transition (show, hode, fade…) and lock fields for editing. In this example first select list turns on the switch&slider group in which switch controls the appearance of the the slider.
Type 2;100;This is item type 2 – $100″ condition=”==0;demoGroup;fadeTo(‘slow’, 0.2);lock;
#gt#0;demoGroup;fadeTo(‘slow’, 1);unlock;” item_el_id=”demoSelect”][bt_cc_group eval=”var number_items = $1;
var shipping = $2;
var result = 0;
if ( shipping #gt# 0 ) {
result = shipping * number_items;
} else {
result = number_items * 2;
}
return result;” item_el_id=”demoGroup”][bt_cc_switch name=”Include Shipping ($10)” value_off=”0″ value_on=”10″ item_el_id=”demoSwitch” condition=”==0;demoSlider;hide();
#gt#0;demoSlider;show(); “][bt_cc_slider name=”Number of Items ($1)” value_max=”10″ value_step=”1″ value_unit=”1″ value_min=”0″ item_el_id=”demoSlider”][/bt_cc_group][/bt_cost_calculator]