The new version of the plugin for WordPress, which allows you to create flexible forms of the calculator.
The main changes are:
* Completely rewritten algorithm formula
* Simplified administration panel
* Added AJAX calculations
* Added ability to send letters to the calculations
* Fixed all the shortcomings and errors of previous versions
* Changed the principle of Checkbox
* Added default values in order to avoid the error "Division by zero"
* Stores the selected values in the form after the calculation
* Added field jQuery
* Added a calculator widget
* Remove extra fields: Sorting (now just a mouse sort, Drag and Drop), CSS (each block, and so there is a unique class)
* Changed the structure of the tables in the database
! New version of the database plugin is not compatible with previous versions of the plugin <3.0. The new version of the plugin you can view data from a legacy database.
All the settings for each individual calculator.
The principle of the calculator:
field1 + (3 * field (field 2 + field 4))
literally:
(id1 (a sign next to the field)) (id3 sign in front of the field after the field sign) (sign in front of the field id2 sign next to the field) (id4 signs next to the field)
Analysis of the calculator menu:
Text Box:
Title - The text that appears above the block
Text - any text can use HTML, thus allowing you to take any form of calculator design.
You can also display the values from $_SESSION directly in the text using the code [session id = "ID_CALC"] ID_ROW or sum calc [/session]. About the sessions more in $ _SESSION.
The SELECT list
Title - The text that appears above the list
Signs up - here it is necessary to specify the arithmetic sign, which will set the action to the drop-down list.
Signs of post - here it is necessary to specify the arithmetic sign, which will set the action when the drop-down list.
List - to form a drop-down list, you must arrange the data according to certain rules. For example - [price]:name;[500]:Installation of windows;[0]:null;
Checkbox
Title - The text that appears on the checkbox
Signs up - here it is necessary to specify the arithmetic sign, which will set the action to the checkbox.
Signs of post - here it is necessary to specify the arithmetic sign, which will set the action after the checkbox.
The default value - if the checkbox is not selected, the default value which it is assigned. It is assumed for the use of formulas with multiplication and division, to avoid errors in the calculation.
Price of the field - the value of the field, selecting the checkbox will be substituted the price.
p.s. In contrast to the checkboxes in the previous version removed the function list building, as this caused many problems in the calculations. Now, to consistently build several checkboxes in a row, you could use CSS to place them as you want. More information about the structure of the CSS below.
Radio buttons
Title - The text that appears above the unit Radio Buttons
Signs up - here it is necessary to specify the arithmetic sign, which will set the action to block Radio buttons.
Signs of post - here it is necessary to specify the arithmetic sign, which will set the action after a block of Radio buttons.
List - to create a list of Radio buttons, you need to arrange the data according to certain rules! For example - [price]:name;[500]:Installation of windows;[0]:null;
p.s. Checked placed on the first on the list of Radio button
A text box
Title - The text that appears over
Signs up - here it is necessary to specify the arithmetic sign, which will set the action to the text field.
Signs of post - here it is necessary to specify the arithmetic sign, which will set the action after the text field.
The default value - if the field does not hammered, what the default value assigned to it. It is assumed for the use of formulas with multiplication and division, to avoid errors in the calculation.
Price of the field - the value of the field. The data entered by the user, will be multiplied or divided (depending on what you specify in the "action with the data") at this price.
The action with the data - given the arithmetic is substituted to a sign between the data entered by the user (or the default value of the floor) and the price field.
p.s. Note that the user can still enter 0, and if you will stand up to this division, an error occurs. To avoid it, well thought out formula.
A hidden field
Signs up - here it is necessary to specify the arithmetic sign, which will set the action in front of a hidden field.
Signs of post - here it is necessary to specify the arithmetic sign, which will set the action after a hidden field.
Price of the field - the value of the field.
$_SESSION Field
Signs up - here it is necessary to specify the arithmetic sign, which will set the action to the $_SESSION field.
The sign post - here it is necessary to specify the arithmetic sign, which will set the action after the $_SESSION field.
The default value - if the specified session is empty you will be taken this value.
ID calculator - from what the calculator is necessary to take data. More information about the structure of the $_SESSION array below.
ID field or the sum - of which ID fields to receive data, or specify a sum, to get the final calculation of the cost calculator.
jQuery Field
This copies the data field is entered by the user in the text box. In the event keyUp. This field is hidden (input hidden).
Signs up - here it is necessary to specify the arithmetic sign, which will set the action to the jQuery field.
The sign post - here it is necessary to specify the arithmetic sign, which will set the action after the jQuery field.
The default value - if the field does not hammered, what the default value assigned to it. It is assumed for the use of formulas with multiplication and division, to avoid errors in the calculation.
ID field - from which the text field to copy the data.
Setting Design
You can choose a ready to use designs calculator
A. No design - an empty css
Two. Skeleton - no images, but with ordered blocks
Three. Minimalism - Simple design that can go to any site layout.
All topics are in the plugin/theme
In the plugin directory is a file example.css, which collects all the styles for the calculator, send e-mail, and a widget.
Setting up mail
A new feature in the calculator (decided to add to the numerous requests). So far in testing, but it works.
If you enable this feature in the settings, then after calculating the visitor will be asked to send an e-mail from his personal details: Name, Phone, Email, Comment, The amount of calculation.
All messages, text messages, and the names of fields you can change the way you want.
The following setting:
Enable sending emails? - Yes or No
Topic - The text to be specified in the letter sent to the topic. By adding the data subject: Your subject line + from name
The text of the letter - sent a letter in the text, go after the user data
Text before sending the form - the text to display before the data entry form
Successful transmission of a message - text to be displayed after a successful sending of the letter
At what E-Mail to send an email - indicate the email, the default data from the blog admin_email
First Name Last Name Field, Golf pin E-Mail, telephone number field, field comments - both are called data fields appear before the data input by the user. If you want to hide a field, leave it blank.
Filtering data before sending it:
Error: Do not enter a name - the error is displayed if the name passed in is null
Error: The long name - the error is displayed if the name is more than 100 characters
Error: Not entered Email - displayed an error if not entered e-mail
Error: Invalid Email - error displayed if entered not email (standard validation)
Error: Invalid phone - the error is displayed if the phone contains invalid characters, valid - (numbers, spaces, dashes, parentheses)
Error: The long phone - an error is displayed when the phone is more than 35 characters
Error: Long comment - displayed an error if the comment exceeds 2500 characters
Setting up the calculator (a calculator for each individual, except for some fields)
The name of the button the calculation - the data is supplied in the text of the button value calculation
The text before the sum - display text before calculating the sum of
Text after the amount - the amount of text displayed after the calculation
Enable AJAX calculator? - Makes it possible to calculate, without page reloading
Action form - address of the page where the user is redirected after clicking the calculation
Remember the selected data in the form - allowing you to store the data entered or selected by the user in the form when you click calculate
Connect jQuery - this setting affects all calculators, if you are still not connected to the site Jquery library, select this option as Yes. The default is enabled. The connection is by using the wp_enqueue_script("jquery") chereh action init
Start the $_SESSION - this setting affects all calculators, if your site is not running session, this function will start to function session_start(); action by init.
In the same menu you can delete permanently calculator and all of its field
Paragraphs calculator:
The top field displays the selected settings from the menu
Paragraph added fields:
Displays which fields have been added in the selected calculator.
Displayed their names and ID
To edit the appropriate field, click the plus sign next to it, open its settings
To reverse the field, click the required check box, and then hold the mouse button, drag to the right place.
Paragraph Text formula:
Displays the ID added to the fields and their arithmetic values before and after.
This section makes it easy to find errors in your formula.
Preview of Paragraph calculator:
Displays the form of a calculator, which you have created.
Also in this section, if not AJAX enabled calculation shows the data and the $_SESSION array sorted by the keys (for sorting), which receives a calculator, and inserts data into eval();
The structure of the CSS
<style>
// ID-calc - ID calculator
// ID-row - field identifier
// Calculator Class
// wpcc, wpcc_ID-calc
.wpcc {}
// wpcc_form, wpcc_ID-calc
.wpcc_form {}
// wpcc_description, wpcc_description_ID-row
.wpcc_description {}
// wpcc_text, wpcc_text_ID-row
.wpcc_text {}
// wpcc_select, wpcc_select_ID-row
.wpcc_select {}
// wpcc_checkbox, wpcc_checkbox_ID-row
.wpcc_checkbox {}
// wpcc_radio, wpcc_radio_ID-row
.wpcc_radio {}
// wpcc_inputtext, wpcc_inputtext_ID-row
.wpcc_inputtext {}
// wpcc_submit, wpcc_submit_ID-calc
.wpcc_submit {}
// wpcc_result_block, wpcc_result_block_ID-calc
.wpcc_result_block {}
// wpcc_result, wpcc_result_ID-calc
.wpcc_result {}
// Mail Class
// wpcc_mail_info, wpcc_mail_info_ID-calc
.wpcc_mail_info {}
// wpcc_mail, wpcc_mail_ID-calc
.wpcc_mail {}
// wpcc_mail_form, wpcc_mail_form_ID-calc
.wpcc_mail_form {}
// wpcc_mail_sum, wpcc_mail_sum_ID-calc
.wpcc_mail_sum {}
// wpcc_mail_text
.wpcc_mail_text {}
// wpcc_mail_row
.wpcc_mail_row {}
// wpcc_mail_author
.wpcc_mail_author {}
// wpcc_mail_email
.wpcc_mail_email {}
// wpcc_mail_phone
.wpcc_mail_phone {}
/* wpcc_mail_textarea
.wpcc_mail_textarea {}
// wpcc_mail_send
.wpcc_mail_send {}
/* Widget class */
.wpcc_widget {}, .wpcc_widget_ID-calc {}
</style>
Structure of HTML
<!-- Calculator -->
<div class="wpcc wpcc_1">
<form method="POST" action="" class="wpcc_form_1">
<div class="wpcc_description wpcc_description_2"> Title text field </ div>
<div class="wpcc_text wpcc_text_2"> text in the text box, you must test session,
and other gizmos </ div>
<div class="wpcc_description wpcc_description_3"> drop-down list </ div>
<select name="wpcc_structure[3]" class="wpcc_select wpcc_select_3">
<option value="100" selected> title1 </ option>
<option value="200"> title2 </ option>
<option value="300"> title3 </ option>
<option value="400"> title4 </ option>
</ Select>
<div class="wpcc_description wpcc_description_4"> checkbox </ div>
<input type="checkbox" name="wpcc_structure[4]" value="100" class="wpcc_checkbox
wpcc_checkbox_4">
<div class="wpcc_description wpcc_description_5"> Radio </ div>
<label> <input type="radio" name="wpcc_structure[5]" value="100" class="wpcc_radio
wpcc_radio_5" checked> title1 </ label>
<label> <input type="radio" name="wpcc_structure[5]" value="200" class="wpcc_radio
wpcc_radio_5"> title2 </ label>
<div class="wpcc_description wpcc_description_6"> text field </ div>
<input type="text" name="wpcc_structure_inputtext[6]" value="100" class="wpcc_inputtext
wpcc_inputtext_6" id="wpcc_jq_6">
<input type="hidden" name="wpcc_structure[7]" value="500">
<input type="hidden" name="wpcc_structure[8]" value="">
<script> jQuery(document).ready(function($) {$("#wpcc_jq_6").keyup(function
() {$ ("#wpcc_jq_get_9").val($(this).val());});}); </ script>
<input type="hidden" id="wpcc_jq_get_9" name="wpcc_structure[9]" value="">
<input type="hidden" name="wpcc_structure_id" value="3,4,5,7,8,9">
<input type="submit" value="Raschitat" name="wpcc_calculate" class="wpcc_submit
wpcc_submit_1">
</ Form>
<div class="wpcc_result_block wpcc_result_block_1">
<div class="wpcc_result wpcc_result_1"> Result: 1006 rubles. </ div>
</ Div>
</ Div>
<!-- Mail -->
<div class="wpcc_mail_info wpcc_mail_info_1" style="display:none;"> </ div>
<div class="wpcc_mail wpcc_mail_1">
<form method="post" action="#wpcc_mail_ancor_1" class="wpcc_mail_form
wpcc_mail_form_1">
<div class="wpcc_mail_sum"> Result: 23 255 rubles. </ div>
<div class="wpcc_mail_text"> Send application administrator? </ div>
<div class="wpcc_mail_row"> <b> Your First and Last Name </ b> <input type="text"
name="mail_author" class="wpcc_mail_author" value=""> </ div>
<div class="wpcc_mail_row"> <b> Your E-Mail </ b> <input type="text" name="mail_email"
class="wpcc_mail_email" value=""> </ div>
<div class="wpcc_mail_row"> <b> Your Phone </ b> <input type="text" name="mail_phone"
class="wpcc_mail_phone" value=""> </ div>
<div class="wpcc_mail_row"> <b> your comment </ b> <textarea name="mail_text"
class="wpcc_mail_textarea" maxlength="2500"> </ textarea> </ div>
<input type="hidden" name="wpcc_mail_sum" value="23255">
<input type="hidden" name="wpcc_mail_send_id" value="1">
<input type="submit" name="wpcc_mail_send" class="wpcc_mail_send
wpcc_mail_send_1" value="Otpravit">
</ Form>
</ Div>
<!-- Widget -->
<div class="wpcc_widget wpcc_widget_1">
<!-- HTML structure of the calculator -->
</ Div>
How to put a calculator on the site
The code for the files of your theme: <? Php echo do_shortcode ('[wpcc id = "X"]');?>
Shortcode for pages and entries: [wpcalculator wpcc = "X"]
where X - is the ID of the calculator, you want to display.
The structure of the $ SESSION
Before each calculation of the current $ _SESSION calculator removed - unset ($ _SESSION ['wpcc'. $ Wpcc_id]);
Array
(
[wpcc_1] => Array // wpcc_ID calculator
(
[3] => 100 // 3 - id field
[5] => 100
[7] => 100
[8] => 22 509
[9] => 1
[4] => 100
[6] => 123 // that the user entered into the text field
[6_sum] => 223 // amount of text field
[sum] => 23133 // calculate the total amount
)
)
Array structure
Array
(
[1] => 100 + // a sort ID, the sum of 100 + sign next to the field
[3] => 100 +
[4] => 100 +
[5] => (123 +100) + // text box 123 that brought the visitor, (+) with effect from the data, 100 price of the field
[6] => 100 +
[7] => 23255 +
[8] => 123
)
p.s. Sorry, this text is translated G Translator
Requires: 3.0 or higher
Compatible up to: 3.4.2
Last Updated: 2012-8-8
Downloads: 8,248
0 of 4 support threads in the last two months have been resolved.
Got something to say? Need help?