I need to set the primary address to billing and on the OCST page display the billing address fields first with the shipping fields hidden. The label for shipping information and the 'same as billing' checkbox should be visible. If the customer unchecks the box, the shipping fields should become visible and empty.
First thing before any changes, on all pages that show the Customer Fields Item, except the OCST page, I checked the Prevent Automatic Updates to This Template.
Under Store Setting > Customer Fields, I have shipping information set to optional and primary address set to billing.
On the OCST page, I have edited the default Shadows Customer Fields code and placed the billing information above the shipping. However, I can't hide the shipping fields.
Code for displaying the shipping fields is:
<li class="c-form-list__item c-form-list__item--full o-layout__item c-heading-echo u-text-bold u-text-uppercase">Shipping Information</li>
<li class="c-form-list__item o-layout__item u-width-12 u-font-small" id="shipping_controls">
<label class="c-form-checkbox">
<input id="shipping_to_show" class="c-form-checkbox__input" type="checkbox" name="shipping_to_show" value="1" checked>
<span class="c-form-checkbox__caption u-font-small u-text-uppercase">Shipping Information Same as Billing</span>
</label>
</li>
What do I need to do the hide the shipping fields unless the customer unchecks the 'same as billing' checkbox?
First thing before any changes, on all pages that show the Customer Fields Item, except the OCST page, I checked the Prevent Automatic Updates to This Template.
Under Store Setting > Customer Fields, I have shipping information set to optional and primary address set to billing.
On the OCST page, I have edited the default Shadows Customer Fields code and placed the billing information above the shipping. However, I can't hide the shipping fields.
Code for displaying the shipping fields is:
<li class="c-form-list__item c-form-list__item--full o-layout__item c-heading-echo u-text-bold u-text-uppercase">Shipping Information</li>
<li class="c-form-list__item o-layout__item u-width-12 u-font-small" id="shipping_controls">
<label class="c-form-checkbox">
<input id="shipping_to_show" class="c-form-checkbox__input" type="checkbox" name="shipping_to_show" value="1" checked>
<span class="c-form-checkbox__caption u-font-small u-text-uppercase">Shipping Information Same as Billing</span>
</label>
</li>
What do I need to do the hide the shipping fields unless the customer unchecks the 'same as billing' checkbox?
Comment