Skip to content

Commit

Permalink
Primary emojis on address list in example templates
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Oct 13, 2023
1 parent eabb675 commit 584456f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion example-templates/dist/shop/_private/address/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="my-6 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 xl:grid-cols-3 gap-4">
{% for address in addresses %}
{% set editUrl = '/shop/customer/addresses/edit?addressId=' ~ address.id ~ '&redirect=' ~ craft.app.request.fullPath %}
<div class="block border border-gray-200 bg-white rounded-lg shadow-sm hover:shadow-md p-4 w-full">
<div class="block border border-gray-200 bg-white rounded-lg shadow-sm hover:shadow-md p-4 w-full relative">
{% tag selectable ? 'label' : 'div' with {
class: 'block relative address-select js-address-select',
data: {
Expand Down Expand Up @@ -49,6 +49,16 @@
{% endif %}
</span>
{% endtag %}
{% if primaryBillingAddressId == address.id or primaryShippingAddressId == address.id %}
<div class="absolute top-0 right-0 pr-4 pt-4">
{% if primaryBillingAddressId == address.id %}
<span title="{{ 'Primary billing address'|t }}">💳</span>
{% endif %}
{% if primaryShippingAddressId == address.id %}
<span title="{{ 'Primary shipping address'|t }}">📦</span>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
{% if showAdd %}
Expand Down
12 changes: 11 additions & 1 deletion example-templates/src/shop/_private/address/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="my-6 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 xl:grid-cols-3 gap-4">
{% for address in addresses %}
{% set editUrl = '/[[folderName]]/customer/addresses/edit?addressId=' ~ address.id ~ '&redirect=' ~ craft.app.request.fullPath %}
<div class="block border border-gray-200 bg-white rounded-lg shadow-sm hover:shadow-md p-4 w-full">
<div class="block border border-gray-200 bg-white rounded-lg shadow-sm hover:shadow-md p-4 w-full relative">
{% tag selectable ? 'label' : 'div' with {
class: 'block relative address-select js-address-select',
data: {
Expand Down Expand Up @@ -49,6 +49,16 @@
{% endif %}
</span>
{% endtag %}
{% if primaryBillingAddressId == address.id or primaryShippingAddressId == address.id %}
<div class="absolute top-0 right-0 pr-4 pt-4">
{% if primaryBillingAddressId == address.id %}
<span title="{{ 'Primary billing address'|t }}">💳</span>
{% endif %}
{% if primaryShippingAddressId == address.id %}
<span title="{{ 'Primary shipping address'|t }}">📦</span>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
{% if showAdd %}
Expand Down

0 comments on commit 584456f

Please sign in to comment.