Website - Cost per letter in a phrase tool

This tool will allow customers to type in a phrase in a text-box on your website. The letters will be counted and added the quantity to the cart.

Example: 
Customer goes to your product "Happy Birthday Balloon Letters". The customer sees a text box:

When they hit Add to Cart, it will add the qty corresponding to the number of characters (excluding spaces). In addition, that phrase can be added to an optional field with the order.


How to Implement
Step 1: 
The following CSS will need to be added to your website where 12345 is the inventory id number of the item you want to activate. 

.io_phrase_12345{display:block !important}

You add this text to the website under appearance > customize > custom CSS.

Step 2:
to pass the phrase into the checkout, add an optional field in the software, and add the following code into Settings -> Pages -> WP checkout. Click the <> to in the toolbar, then under the first <script> tag you can add the following:

if (getCookie("phrase") && jQuery("#customfield-12345").val() == "")
{
jQuery("#customfield-12345").val(getCookie("phrase"));
}

Is this article helpful?
0 0 0