1

I'm not sure what I've done wrong here but with this code, I don't get any validation taking place, it goes straight to the next step:

{exp:store:checkout
    next="checkout/payment"
    error_handling="inline"
    require="shipping_name|shipping_address1|shipping_city|shipping_postcode|shipping_country"
    error_delimiters='<label class="error">|</label>'
}

    <section>

        <h1>1. Shipping</h1>

        <div class="fr {if error:shipping_name}error{/if}">
            <label class="fl" for="shipping_name">Name <span class="required">*</span></label>
            <div class="ff">
                {field:shipping_name} {error:shipping_name}
            </div>
        </div>

    </section>

{/exp:store:checkout}

If I change the require parameter to remove the shipping_ from each field, the form reloads the current page, but no errors are output, so I'm a little stumped at this stage.

Any suggestions?

0

There is probably another error which isn't displaying.

Try removing error_handling="inline" from your checkout tag to see any errors which you may not have added inline error variables for in your template.

| improve this answer | |
  • That makes no difference for me - it just goes onto the next step. If I remove change the rules from shipping_, I do get errors for missing billing fields, but this is just a shipping page, so I just need to validate the shipping fields 'shipping_name|shipping_address1|shipping_city|shipping_postcode|shipping_country'. – Russ Back Nov 4 '13 at 10:01
  • Shipping fields don't get validated if you have 'shipping same as billing' set. – Adrian Macneil Nov 4 '13 at 11:55
  • In config or in the template? I don't have that in the template and the Default Shipping Address is set to None in the module config. Still no validation either with or without inline errors. – Russ Back Nov 4 '13 at 13:02
  • Very odd. I'm not sure what's changed but it's now validating fine. I had continued working on the templates and CSS so must have fixed an error inadvertently! – Russ Back Nov 4 '13 at 17:12
1

I have validation working perfectly on Store v2.0.3. Here is my code:
http://pastie.org/private/qs9a9hhzfndkbhk8bsr4g

Try popping it into your template... Just change the next="checkout/step2" parameter to your correct template name.

| improve this answer | |
  • Thanks, I am only validating shipping fields (not both billing and shipping) and it's in this scenario that the problem occurs for me. – Russ Back Nov 4 '13 at 10:11

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.