1

I'm using EE 2.5.2 and Store 1.6.3 and I'm only able to capture a different shipping address if the customer is logged out.

On the shipping page, I have two sets of content, one for logged in and one for logged out users. When a logged out users unticks the "shipping same as billing" box, they can enter different details, which will show up correctly on the next screen.

However, logged in users, when they untick it and enter new details, they don't show up on the next page, they just get the "same as billing details message"

Thanks,

Edit shop code:

 {case value="customer_details"}
    <section class="light_brown_flat"> {!-- ===/ login check and guest account registration /=== --}
  {if logged_out}
  {exp:channel:entries channel="static_pages" limit='1' url_title="billing_intro"}
  {body_content}{content_body}{/body_content}
  {/exp:channel:entries}
  <div class="grid_7">
        <h3>You are Checking out as a Guest</h3>
        {exp:store:checkout form_class="form-horizontal" next="{segment_1}/confirm" error_handling="inline" error_delimiters='<span class="help-inline">|</span>' require="name|address1|address3|country|billing_phone|billing_region" register_member='no'}
        {if no_items}
        {redirect="{segment_1}/checkout"}
        {/if}
        <fieldset id="billing_details">
      <input id="password" type="hidden" value="" name="password">
      <h3>Billing Details</h3>
      <div class="grid_6">
            <div class="control-group {if error:billing_name}error{/if}">
          <label class="control-label" for="billing_name">Name</label>
          <div class="controls"> {field:billing_name} {error:billing_name} </div>
        </div>
            <div class="control-group {if error:billing_address1}error{/if}">
          <label class="control-label" for="billing_address1">Address</label>
          <div class="controls"> {field:billing_address1} {error:billing_address1} </div>
        </div>
            <div class="control-group {if error:billing_address2}error{/if}">
          <div class="controls"> {field:billing_address2} {error:billing_address2} </div>
        </div>
            <div class="control-group {if error:billing_address3}error{/if}">
          <label class="control-label" for="billing_address3">City</label>
          <div class="controls"> {field:billing_address3} {error:billing_address3} </div>
        </div>
            <div class="control-group {if error:billing_postcode}error{/if}">
          <label class="control-label" for="billing_postcode">Postcode</label>
          <div class="controls"> {field:billing_postcode} {error:billing_postcode} </div>
        </div>
          </div>
      <div class="grid_5">
            <div class="control-group {if error:billing_country}error{/if}">
          <label class="control-label" for="billing_country">Country</label>
          <div class="controls"> {field:billing_country} {error:billing_country} </div>
        </div>
            <div class="control-group {if error:billing_region}error{/if}">
          <label class="control-label" for="billing_region">Region</label>
          <div class="controls"> {field:billing_region} {error:billing_region} </div>
        </div>
            <div class="control-group {if error:billing_phone}error{/if}">
          <label class="control-label" for="billing_phone">Phone</label>
          <div class="controls"> {field:billing_phone} {error:billing_phone} </div>
        </div>
            <div class="control-group {if error:order_email}error{/if}">
          <label class="control-label" for="order_email">Email</label>
          <div class="controls"> {field:order_email} {error:order_email} </div>
        </div>
          </div>
    </fieldset>
        <fieldset>
      <h3>Is this a Gift?</h3>
      <div class="grid_6">
            <div class="row">
          <div class="control-group">
                <label class="control-label" for="order_custom4">Recipient Name:</label>
                <div class="controls"> {field:order_custom4} {error:order_custom4} </div>
              </div>
        </div>
            <div class="control-group">
          <div class="row">
                <label class="control-label" for="order_custom5">Recipient Email Address:</label>
                <div class="controls"> {field:order_custom5} {error:order_custom5} </div>
              </div>
        </div>
          </div>
    </fieldset>
        <fieldset>
      <h3>Special Deliver Instructions</h3>
      <div class="grid_6">
            <div class="row">
          <div class="control-group">
                <label class="control-label" for="order_custom6">Delivery Instrctions</label>
                <div class="controls">
              <textarea name="order_custom6" class="grid_5"> </textarea>
            </div>
              </div>
        </div>
          </div>
    </fieldset>
        <fieldset>
      <h3>Shipping Details</h3>
      <div class="control-group">
            <div class="controls">
          <label for="shipping_same_as_billing" class="checkbox"> {field:shipping_same_as_billing} Same as Billing Details </label>
        </div>
          </div>
      <div id="shipping_details_drawer">
            <div class="grid_6">
          <div class="control-group {if error:shipping_name}error{/if}">
                <label class="control-label" for="shipping_name">Name</label>
                <div class="controls"> {field:shipping_name} {error:shipping_name} </div>
              </div>
          <div class="control-group {if error:shipping_address1}error{/if}">
                <label class="control-label" for="shipping_address1">Address</label>
                <div class="controls"> {field:shipping_address1} {error:shipping_address1} </div>
              </div>
          <div class="control-group {if error:shipping_address2}error{/if}">
                <div class="controls"> {field:shipping_address2} {error:shipping_address2} </div>
              </div>
          <div class="control-group {if error:shipping_address3}error{/if}">
                <label class="control-label" for="shipping_address3">City</label>
                <div class="controls"> {field:shipping_address3} {error:shipping_address3} </div>
              </div>
          <div class="control-group {if error:shipping_postcode}error{/if}">
                <label class="control-label" for="shipping_postcode">Postcode</label>
                <div class="controls"> {field:shipping_postcode} {error:shipping_postcode} </div>
              </div>
        </div>
            <div class="grid_5">
          <div class="control-group {if error:shipping_country}error{/if}">
                <label class="control-label" for="shipping_country">Country</label>
                <div class="controls"> {field:shipping_country} {error:shipping_country} </div>
              </div>
          <div class="control-group {if error:shipping_region}error{/if}">
                <label class="control-label" for="shipping_region">Region</label>
                <div class="controls"> {field:shipping_region} {error:shipping_region} </div>
              </div>
          <div class="control-group {if error:shipping_phone}error{/if}">
                <label class="control-label" for="shipping_phone">Phone</label>
                <div class="controls"> {field:shipping_phone} {error:shipping_phone} </div>
              </div>
        </div>
          </div>
    </fieldset>
        <fieldset>
      <h4>Terms and Conditions</h4>
      <div class="control-group">
            <div class="controls"> 
          <!-- label for="shipping_same_as_billing" class="checkbox"> {field:shipping_same_as_billing} I have read and accepted the <a href="/legal/terms_and_conditions" target="_blank">Terms and Conditions</a> </label> -->

          <p>{field:accept_terms}
                <label for="accept_terms">I accept the terms & conditions</label>
                {if error:accept_terms}

          <div class="control-group">
                <div class="alert alert-error">{error:accept_terms}</div>
              </div>
          {/if}
          </p>
        </div>
          </div>
    </fieldset>
        <div class="form-actions"> <a href="{path='{segment_1}/checkout'}" class="button_empty">Back</a>
      <input type="submit" name="next" value="Continue" class="inpbtn" />
    </div>
        {/exp:store:checkout} </div>
  <div class="grid_4">
        <p>Have a Account? Login to retrieve billing details (Optional)</p>
        {exp:member:login_form id='login_form' return="shop/customer_details"}
        <div class="row">
      <label for="username" class="grid_4">Email</label>
      <input type="text" class="grid_4" name="username" id="username" />
    </div>
        <div class="row">
      <label for="password" class="grid_4">Password</label>
      <input type="password" class="grid_4" name="password" id="password" />
    </div>
        <div class="grid_6">
      <input type="submit" id="login" value="Log in"  class="inpbtn" />
      <p><a href="{site_url}login/forgot">Forgot your password?</a></p>
    </div>
        {/exp:member:login_form} </div>
  <div class="clearfix"></div>
  {/if}

  {if logged_in}
  {exp:channel:entries channel="static_pages" limit='1' url_title="billing_intro"}
  {body_content}{content_body}{/body_content}
  {/exp:channel:entries} 
  {exp:store:checkout form_class="form-horizontal" next="{segment_1}/confirm" error_handling="inline" error_delimiters='<span class="help-inline">|</span>' require="name|address1|address3|country|phone"}
  {if no_items}
  {redirect="{segment_1}/checkout"}
  {/if}
  <fieldset id="billing_details">
        <h3>Billing Details</h3>
        <div class="grid_6">
      <div class="control-group {if error:billing_name}error{/if}">
            <label class="control-label" for="billing_name">Name</label>
            <div class="controls"> {field:billing_name} {error:billing_name} </div>
          </div>
      <div class="control-group {if error:billing_address1}error{/if}">
            <label class="control-label" for="billing_address1">Address</label>
            <div class="controls"> {field:billing_address1} {error:billing_address1} </div>
          </div>
      <div class="control-group {if error:billing_address2}error{/if}">
            <div class="controls"> {field:billing_address2} {error:billing_address2} </div>
          </div>
      <div class="control-group {if error:billing_address3}error{/if}">
            <label class="control-label" for="billing_address3">City</label>
            <div class="controls"> {field:billing_address3} {error:billing_address3} </div>
          </div>
      <div class="control-group {if error:billing_postcode}error{/if}">
            <label class="control-label" for="billing_postcode">Postcode</label>
            <div class="controls"> {field:billing_postcode} {error:billing_postcode} </div>
          </div>
    </div>
        <div class="grid_5">
      <div class="control-group {if error:billing_country}error{/if}">
            <label class="control-label" for="billing_country">Country</label>
            <div class="controls"> {field:billing_country} {error:billing_country} </div>
          </div>
      <div class="control-group {if error:billing_region}error{/if}">
            <label class="control-label" for="billing_region">County/Region</label>
            <div class="controls"> {field:billing_region} {error:billing_region} </div>
          </div>
      <div class="control-group {if error:billing_phone}error{/if}">
            <label class="control-label" for="billing_phone">Phone</label>
            <div class="controls"> {field:billing_phone} {error:billing_phone} </div>
          </div>
      <div class="control-group {if error:order_email}error{/if}">
            <label class="control-label" for="order_email">Email</label>
            <div class="controls"> {field:order_email} {error:order_email} </div>
          </div>
    </div>
      </fieldset>
  <fieldset>
        <h3>Is this a Gift?</h3>
        <div class="grid_6">
      <div class="row">
            <div class="control-group">
          <label class="control-label" for="order_custom4">Recipient Name:</label>
          <div class="controls"> {field:order_custom4} {error:order_custom4} </div>
        </div>
          </div>
      <div class="control-group">
            <div class="row">
          <label class="control-label" for="order_custom5">Recipient Email Address:</label>
          <div class="controls"> {field:order_custom5} {error:order_custom5} </div>
        </div>
          </div>
    </div>
      </fieldset>
  <fieldset>
        <h3>Special Deliver Instructions</h3>
        <div class="grid6">
      <div class="row">
            <div class="control-group">
          <label class="control-label" for="order_custom6">Delivery Instructions</label>
          <div class="controls">
                <textarea name="order_custom6" class="grid_5"> </textarea>
              </div>
        </div>
          </div>
    </div>
      </fieldset>
  <fieldset>
        <h3>Shipping Details</h3>
        <div class="control-group">
      <div class="controls">
            <label for="shipping_same_as_billing" class="checkbox"> {field:shipping_same_as_billing} Same as Billing Details </label>
          </div>
    </div>
        <div id="shipping_details_drawer">
      <div class="grid_6">
            <div class="control-group {if error:shipping_name}error{/if}">
          <label class="control-label" for="shipping_name">Name</label>
          <div class="controls"> {field:shipping_name} {error:shipping_name} </div>
        </div>
            <div class="control-group {if error:shipping_address1}error{/if}">
          <label class="control-label" for="shipping_address1">Address</label>
          <div class="controls"> {field:shipping_address1} {error:shipping_address1} </div>
        </div>
            <div class="control-group {if error:shipping_address2}error{/if}">
          <div class="controls"> {field:shipping_address2} {error:shipping_address2} </div>
        </div>
            <div class="control-group {if error:shipping_address3}error{/if}">
          <label class="control-label" for="shipping_address3">City</label>
          <div class="controls"> {field:shipping_address3} {error:shipping_address3} </div>
        </div>
            <div class="control-group {if error:shipping_postcode}error{/if}">
          <label class="control-label" for="shipping_postcode">Postcode</label>
          <div class="controls"> {field:shipping_postcode} {error:shipping_postcode} </div>
        </div>
          </div>
      <div class="grid_5">
            <div class="control-group {if error:shipping_country}error{/if}">
          <label class="control-label" for="shipping_country">Country</label>
          <div class="controls"> {field:shipping_country} {error:shipping_country} </div>
        </div>
            <div class="control-group {if error:shipping_region}error{/if}">
          <label class="control-label" for="shipping_region">County/Region</label>
          <div class="controls"> {field:shipping_region} {error:shipping_region} </div>
        </div>
            <div class="control-group {if error:shipping_phone}error{/if}">
          <label class="control-label" for="shipping_phone">Phone</label>
          <div class="controls"> {field:shipping_phone} {error:shipping_phone} </div>
        </div>
          </div>
    </div>
      </fieldset>
  <fieldset class="grid_12">
        <h3>Terms and Conditions</h3>
        <div class="control-group">
      <div class="controls">
            <label for="shipping_same_as_billing" class="checkbox"> {field:shipping_same_as_billing} I have read and accepted the <a href="/legal/terms_and_conditions" target="_blank">Terms and Conditions</a> </label>
          </div>
    </div>
      </fieldset>
  <div class="clearfix"></div>
  <div class="form-actions grid_12"> <a href="{path='{segment_1}/checkout'}" class="button_empty">Back</a>
        <input type="submit" name="next" value="Continue" class="inpbtn" />
      </div>
  {/exp:store:checkout}
  {/if} </section>
{/case}
1
  • 1
    Can you post the template code of the first page? Specifically the content in between the {exp:store:checkout} tag pair Oct 3, 2013 at 15:47

1 Answer 1

1

Have you set the default value for the field? Otherwise when unticked that field isn't sent with the form, so will pick up the previous saved value.

<input type="hidden" name="shipping_same_as_billing" value="0" />
<input type="checkbox" name="shipping_same_as_billing" value="1" id="deliveryCheckbox" {shipping_same_as_billing_checked} >
<label for="deliveryCheckbox">Same as Billing Address</label>
{error:shipping_same_as_billing}

Edit - Update your code to:

<h3>Shipping Details</h3>
<div class="control-group">
     <div class="controls">
         <input type="hidden" name="shipping_same_as_billing" value="0" />
         <label for="shipping_same_as_billing" class="checkbox"> {field:shipping_same_as_billing} Same as Billing Details </label>
    </div>
</div>
2
  • Hi Peter, thanks for your suggestion. I've changed that, but same issue. Logged out users alternative address is recorded correctly, logged in users are not. Very strange.
    – Mark
    Oct 3, 2013 at 16:13
  • I'm assuming you added it to both logged in and logged out code? Can you update your question to include the rendered out page, but just the above control-group DIV for shipping details of logged in user please. Have you checked with the database to see if the data is stored in the relevant "store" table - this will identify if it's an issue with saving or showing on the next page. Oct 3, 2013 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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