Skip to content

Commit

Permalink
TIdy makePrimaryX checkboxes in example templates #2940
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Jul 5, 2023
1 parent c78ee10 commit fd56ea7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
44 changes: 22 additions & 22 deletions example-templates/dist/shop/checkout/addresses.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ Outputs a form for collecting an order’s shipping and billing address.
sourceIdName: 'sourceShippingAddressId',
}) }}

{% if currentUser and addresses|length %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryShippingAddress', 1, {
id: 'makePrimaryShippingAddress',
}) }}
{{ 'Make this my default shipping address'|t }}
</label>
</div>
{% endif %}

<hr class="my-5">

{{ hiddenInput('billingAddressSameAsShipping', 0) }}
Expand All @@ -57,17 +68,6 @@ Outputs a form for collecting an order’s shipping and billing address.
</label>
</div>

{% if currentUser %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryShippingAddress', 1, {
id: 'makePrimaryShippingAddress',
}) }}
{{ 'Make this my default shipping address'|t }}
</label>
</div>
{% endif %}

<div class="mt-8">
{{ include('shop/_private/address/fieldset', {
title: 'Billing Address'|t,
Expand All @@ -78,19 +78,19 @@ Outputs a form for collecting an order’s shipping and billing address.
}) }}
</div>

<hr class="my-5">

{% if currentUser %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryBillingAddress', 1, {
id: 'makePrimaryBillingAddress',
}) }}
{{ 'Make this my default billing address'|t }}
</label>
</div>
{% if currentUser and addresses|length %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryBillingAddress', 1, {
id: 'makePrimaryBillingAddress',
}) }}
{{ 'Make this my default billing address'|t }}
</label>
</div>
{% endif %}

<hr class="my-5">

<div class="mt-3 flex justify-end">
{{ tag('button', {
type: 'submit',
Expand Down
44 changes: 22 additions & 22 deletions example-templates/src/shop/checkout/addresses.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ Outputs a form for collecting an order’s shipping and billing address.
sourceIdName: 'sourceShippingAddressId',
}) }}

{% if currentUser and addresses|length %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryShippingAddress', 1, {
id: 'makePrimaryShippingAddress',
}) }}
{{ 'Make this my default shipping address'|t }}
</label>
</div>
{% endif %}

<hr class="my-5">

{{ hiddenInput('billingAddressSameAsShipping', 0) }}
Expand All @@ -57,17 +68,6 @@ Outputs a form for collecting an order’s shipping and billing address.
</label>
</div>

{% if currentUser %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryShippingAddress', 1, {
id: 'makePrimaryShippingAddress',
}) }}
{{ 'Make this my default shipping address'|t }}
</label>
</div>
{% endif %}

<div class="mt-8">
{{ include('[[folderName]]/_private/address/fieldset', {
title: 'Billing Address'|t,
Expand All @@ -78,19 +78,19 @@ Outputs a form for collecting an order’s shipping and billing address.
}) }}
</div>

<hr class="my-5">

{% if currentUser %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryBillingAddress', 1, {
id: 'makePrimaryBillingAddress',
}) }}
{{ 'Make this my default billing address'|t }}
</label>
</div>
{% if currentUser and addresses|length %}
<div class="mt-3">
<label>
{{ input('checkbox', 'makePrimaryBillingAddress', 1, {
id: 'makePrimaryBillingAddress',
}) }}
{{ 'Make this my default billing address'|t }}
</label>
</div>
{% endif %}

<hr class="my-5">

<div class="mt-3 flex justify-end">
{{ tag('button', {
type: 'submit',
Expand Down

0 comments on commit fd56ea7

Please sign in to comment.