2

I've had this working before but with the billing address as well. Do both the billing and shipping addresses need to be filled out in the same form for this to work? I get this error when I click the submit and the page just refreshes instead of redirects.

CWebUser.flash.error' => 'Cart not completely updated.',

Here is my code

<form method="POST" class="flex-container flex-center flex-col nav-buttons flex-lg">
    {{ getCsrfInput() }}
    <input type="text" name="email" value="" placeholder="email@site.com"/>
    <input type="text" name="shippingAddress[firstName]" value="" placeholder="First Name">
    <input type="text" name="shippingAddress[lastName]" value="" placeholder="Last Name">
    <input type="text" name="shippingAddress[address1]" value="" placeholder="Street Address">
    <input type="text" name="shippingAddress[address2]" value="" placeholder="Apartment/Suite/etc">
    <input type="text" name="shippingAddress[city]" value="" placeholder="City">
    <input type="text" name="shippingAddress[zipCode]" value="" placeholder="Zipcode">
    <input type="hidden" name="shippingAddress[countryId]" value="233">
    <select style="width:100%; padding:10px 0; margin:10px 0; text-align-last:center;" name="shippingAddress[stateId]">
        <option>State</option>
        {% for stateId, stateName in craft.commerce.statesArray["233"] %}
            <option value="{{ stateId }}">{{ stateName }}</option>
        {% endfor %}
    </select>
    <input type="hidden" name="action" value="commerce/cart/updateCart">
    <input type="hidden" name="redirect" value="store/checkout/payment">
    <input type="submit" value="To Payment">
</form>
2

I extended my code to include the billing address and it worked. So I guess the answer to my question is yes, shipping and billing address need to be submitted together.

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.