Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Wp eStore – How Do I make Collect Customer Input Field REQUIRED?
Tagged: collect customer input, customer, customize, customize customer input, PayPal, required field, Special Instructions, WP eStore
- This topic has 10 replies, 6 voices, and was last updated 7 years, 3 months ago by admin.
-
AuthorPosts
-
July 10, 2013 at 3:05 am #9308fanaticMember
I want them to enter in a URL before they can add to cart.
How do I make the Collect Customer Input field required?
Also it would be nice to put something in the background of the box
[http://www.example.com] and when they click in the box it goes away
for them to enter their URL.
July 10, 2013 at 1:55 pm #56492wzpModeratorAre these what you are looking for?
Can I require or make mandatory the Collect Customer Input field?
The ability to pre-fill a text input box is called a “placeholder.” It only works if the user’s browser is HTML5 compliant.
http://www.w3schools.com/tags/att_input_placeholder.asp
P.S. How will you know if the “required” URL is valid? And yes, [http://example.com] *does* properly resolve.
July 10, 2013 at 4:13 pm #56493fanaticMemberI followed this:
I found this code below in “lib/eStore_read_form.js”
if (val.length != 0)
{
val = val.replace(“(“,”[“);
val = val.replace(“)”,”]”);
val_combo = val_combo + ” (” + val + “)”;
}
I added this so the end of that and it still doesn’t work:
else
{
alert(“Please fill in the custom field”);
return false;
}
Any ideas?
July 10, 2013 at 4:21 pm #56494fanaticMemberNevermind I had to hit CTRL + F5 and it now appears…
July 10, 2013 at 4:51 pm #56495fanaticMemberI read about the placeholder…but how do I incorporate that into the eStore to add a placeholder to the “Collect Customer Input” field?
July 11, 2013 at 1:38 am #56496wpCommerceModeratorHi, please open the
eStore_button_display_helper.php
file and search for the following line:$var_output .= '<span class="eStore_custom_input_name">'.$ret_product->custom_input_label.': </span><input type="text" name="custom_input" value="" class="eStore_text_input eStore_collect_input" />';
Once you find it replace with the following:
$var_output .= '<span class="eStore_custom_input_name">'.$ret_product->custom_input_label.': </span><input type="text" name="custom_input" placeholder="http://www.example.com" value="" class="eStore_text_input eStore_collect_input" />';
March 10, 2017 at 7:41 pm #56497metzler13MemberI have followed several forum threads to make the COLLECT CUSTOMER INPUT field required. I need to capture the service address for a landscape company so when a customer pays the company knows what address the payment is for. It could be different from a billing address.
I have updated eStore_read_form.js with the jquery code suggested here (https://support.tipsandtricks-hq.com/forums/topic/can-i-require-or-make-mandatory-the-collect-customer-input-field) and the else logic suggested above. None of it made a difference.
The test page is [http://winnscapes.com/estore-action/payment/]
March 10, 2017 at 9:47 pm #56498metzler13MemberClarification: In Chrome I do not get the ALERT for missing info in Collect Customer Input but in IE I do get an ALERT for missing info in Collect Customer Input.
March 11, 2017 at 12:08 am #56499adminKeymasterYour customization is working fine. I just checked it in Chrome, Firefox and IE. It is correctly prompting me to fill in that field when I leave it empty and try to use the add to cart button.
Make sure to empty your browser cache before you test so the browser is using the modified script (not the old cached version).
August 23, 2017 at 5:59 pm #56500webyodaMemberUsing my premium WP eStore, I am looking to allow the customer to enter a customer textbox of special instructions for a ticket sale. For example seating preference. At PayPal using credit card, there is a comments box, but paying directly with paypal does not allow this option. Can I add a textbox to the cart page just above my “Check Out Now” button that can be passed to paypal?
August 24, 2017 at 5:51 am #56501adminKeymasterLet me know if the following addon will work for you:
-
AuthorPosts
- You must be logged in to reply to this topic.