July 10, 2013 at 3:05 am #9308
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 #56492wzpModerator
Are these what you are looking for?
The ability to pre-fill a text input box is called a “placeholder.” It only works if the user’s browser is HTML5 compliant.
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 #56493
I 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:
alert(“Please fill in the custom field”);
Any ideas?July 10, 2013 at 4:21 pm #56494
Nevermind I had to hit CTRL + F5 and it now appears…July 10, 2013 at 4:51 pm #56495
I 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 #56496wpCommerceModerator
Hi, please open the
eStore_button_display_helper.phpfile 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 #56497metzler13Member
I 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 #56498metzler13Member
Clarification: 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 #56499adminKeymaster
Your 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 #56500webyodaMember
Using 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 #56501adminKeymaster
Let me know if the following addon will work for you:
- You must be logged in to reply to this topic.