2

I am almost done with this site, but the client has a number of requests that I don't really know how to address within this specific plugin. Most of the issues involve the form fields. Since you guys don't actually have HTML form fields in the template code, it makes it a bit difficult to apply normal parameters that would normally take care of these issues.

I haven't found the answer to my questions elsewhere in stack exchange, so I'll ask here…

  1. As you know, when logged in, the checkout form changes, to no longer contain the username/password registration fields. However, it does have them refill in their contact info, and when the user uses their registered email it says that "that email is not available" - meaning it's still running the email validation check as though they are registering. Meaning a customer making a subsequent purchase would need to use a new email every time. Is there some parameter I'm not seeing? We do want people to put in their email for the order, and it is autofilling that, if they're a registered, logged in member, but how can I stop it from requiring a new email and running that registration? Seems like a bug.

  2. For new users, the client wants the customers to use their email address as their username (for ease of remembering it later). Is there some way to have the field capture its contents from the email address entered above, when they tab to that field?

  3. Is there some way to add a mask to fields like phone number - (000) 000-0000, and zip code? You guys don't use regular HTML form fields in your template code, so it's not really as simple as adding the mask to the form field parameters.

Thanks! Brooke

  • Can you provide your checkout template code along with what version of Store & EE you are using? – Justin Long Jul 8 '14 at 16:43
2

You can use normal input fields instead of using the {field:billing_name} convention.

So in your checkout template you can do something along the lines of.

{exp:store:checkout}
 <label for="billing_name">Name</label>
{!-- 
 -- You can add any additional parameters to the input that you need. 
 -- Having a value="{field_name}" will pre-populate that field 
 -- name if the user is logged in and has data stored.
 -- The name parameter should be the field name. 
--}
 <input type="text" value="{billing_name}" name="billing_name" />
{/exp:store:checkout}

This should allow you to sort out issues 3 & 4. (More details in the docs)

1.) I usually use a logged in conditional in my templates to handle showing the register member checkbox field.

{exp:store:checkout}
 <input type="email" name="order_email" value="{order_email}" />
{if logged_out}
{field:register_member} <label for="register_member">Register Member Account?</label>
 <div class="toggle">
  <div>
    <label for="password">Password</label>
    {field:password}
  </div>

  <div>
    <label for="password_confirm">Confirm Password</label>
    {field:password_confirm}
  </div>
 </div>
{/if}
{/exp:store:checkout}

2.) When you are registering a member Store will use the order_email address to create a new member. If you have username and screen_name fields in your template Store will use that information, if you don't have it Store will use the order_email field for the users email address, username and screen name.

| improve this answer | |
  • Justin, thanks for your response! Where would the {error:billing_billing_name} parameter go when using normal HTML form fields? Just after the input field end? – Brooke Martin Chao Jul 8 '14 at 17:09
  • It can go anywhere in your template really but you can also do something along the lines of <input type="text" name="billing_name" value="{billing_name}" class="input {if error:billing_name}error{/if}" /> to add an error class to your form fields if that field has an error. – Justin Long Jul 8 '14 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.