hello, in order confirmation i cant sort the lines with this code :
{% for line in subtotal_line_items | sort: ‘product.title’ %}
anyone know why doesnt work or someone know how i can sort the order of the products by title??
@Andrea-Enea try this
{% assign sorted_items = subtotal_line_items | sort: 'product.title' %}
{% for item in sorted_items %}
{{ item.product.title }}
{% endfor %}
thanks but need replace :
{% if line.quantity < line.quantity %}
{% capture line_display %}
{{ line.quantity }} di {{ line.quantity }}
{% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
With:
{% for item in sorted_items %}
{{ item.product.title }}
{% endfor %}
?
with o without replace… doesnt work
{{ email_title }}
body {
background-image: url([https://cdn.shopify.com/s/files/1/0785/6586/7849/files/SfondoCheckout_9636f011-0679-44a1-a4f6-1b7ad1a505d0.jpg](https://cdn.shopify.com/s/files/1/0785/6586/7849/files/SfondoCheckout_9636f011-0679-44a1-a4f6-1b7ad1a505d0.jpg));
}
.titoli-ordini{
font-size: 16px;
font-family: “Futura LT”, “Futura LT Condensed”, “Futura Md BT”, “Futura Std Book”;
background-repeat: repeat-x;
}
.Prezzi{
color: #000000;
font-weight: bolder;
font-size: 18px;
font-family: Cambria, “Hoefler Text”, “Liberation Serif”, Times, “Times New Roman”, serif;
}
.PrezziSX{
color: #000000;
font-weight: bolder;
font-size: 16px;
font-family: “Futura LT”, “Futura LT Condensed”, “Futura Md BT”, “Futura Std Book”;
}
.Totale{
color: red;
font-size: 18px;
font-family: “Futura LT Condensed”, “Futura Md BT”, “Futura Std Book”;
}
.numero-ordini{
font-size: 26px;
font-weight: bolder;
font-family: “Futura LT Condensed”, “Futura Md BT”, “Futura Std Book”;
}
.button__cell { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
@media print{
body {
color: black !important;
}
.subtitle-lines,
.subtotal-line__title,
.subtotal-line__value {
padding: 0 !important;
margin: 0 !important;
}
.subtotal-table {
margin: 0 !important;
}
}
Ordinante: {{ customer.name }} - Email: {{ customer.email }} - Tel: {{ customer.phone }}
{% if gateway %} Pagamento: {{ gateway }}
{% endif %} |
{% assign SU = shipping_address.zip %}
{% case SU %}
{% when “09031”,“09040”,“09021”,“09010”,“09011”,“09013”,“09014”,“09020”,“09041”,“09015”,“09051”,“09052”,“09053”,“09054”,“09055”,“09035”,“09036”,“09016”,“09056”,“09022”,“09023”,“09043”,“09057”,“09058”,“09024”,“09059”,“09061”,“09030”,“09062”,“09037”,“09026”,“09025”,“09017”,“09038”,“09027”,“09063”,“09029”,“09064”,“09065”,“09019”,“09066”,“09049”,“09034” %}
SU{{ name }}
{% else %}
{{ shipping_address.province_code }}{{ name }}
{% endcase %}
|
Indirizzo di Spedizione:
Nome: {{ shipping_address.name }}
Via: {{ shipping_address.street }}
Città: {{ shipping_address.city }} - Prov: ({{ shipping_address.province_code }})
CAP: {{ shipping_address.zip }} - Tel.: {{ shipping_address.phone }}
Note Spedizione: {{ shipping_address.note }} |
|
|
Riepilogo ordine
{% for line in subtotal_line_items | sort: 'product.title' %}
{% endfor %}
{% if line.quantity < line.quantity %}
{% capture line_display %}
{{ line.quantity }} di {{ line.quantity }}
{% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
{% if line.product.title == blank %}
{{ line.title }} {{ line.final_price | money }} × {{ line.quantity }}
{% else %}
{{ line.product.title }} × {{ line.quantity }} {% endif %}
{% if line.variant.title != ‘Default Title’ %}
{{ line.variant.title }}
{% if line.quantity %}
{% if line.original_line_price != line.final_line_price %}
{{ line.original_price | money }}
{% endif %}
{% endif %}
{% if line.sku != blank %}
•
{% endif %}
{% endif %}
{% if line.sku != blank %}
SKU: {{ line.sku }}
{% endif %}
{% if line.selling_plan_allocation != nil %}
{{ line.selling_plan_allocation.selling_plan.name }}
{% endif %}
{% if line.discount_allocations %}
{% for discount_allocation in line.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != ‘all’ %}
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
{% endif %}
{% endfor %}
{% endif %}
|
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
Gratis
{% endif %}
|
|
{% assign order_discount_count = 0 %}
{% assign total_order_discounts = 0 %}
{% assign has_shipping_discount = false %} {% for discount_application in discount_applications %}
{% if discount_application.target_selection == ‘all’ and discount_application.target_type == ‘line_item’ %}
{% assign order_discount_count = order_discount_count | plus: 1 %}
{% assign total_order_discount_amount = total_order_discounts | plus: discount_application.total_allocated_amount %}
{% endif %}
{% if discount_application.target_type == ‘shipping_line’ %}
{% assign has_shipping_discount = true %}
{% assign shipping_discount = discount_application.title %}
{% assign shipping_amount = discount_application.total_allocated_amount %}
{% endif %}
{% endfor %} {% if order_discount_count > 0 %}
{% if order_discount_count == 1 %} {% endif %}
{% if order_discount_count > 1 %} {% endif %}
{% for discount_application in discount_applications %} {% if discount_application.target_selection == ‘all’ and discount_application.target_type != ‘shipping_line’ %} {% endif %}
{% endfor %}
{% endif %} {% if delivery_method == ‘pick-up’ %} {% else %}
{% if has_shipping_discount %} {% else %} {% endif %}
{% endif %} {% if total_duties %} {% endif %} {% for tax_line in tax_lines %} {% endfor %}
{% if titleBold %}
Subtotale
{% else %}
Subtotale
{% endif %}
|
{% if valueBold %}
{{ subtotal_price | plus: total_order_discount_amount | money }}
{% else %}
{{ subtotal_price | plus: total_order_discount_amount | money }}
{% endif %}
|
Sconto sull'ordine
|
-{{ total_order_discount_amount | money }}
|
Sconti sugli ordini
|
-{{ total_order_discount_amount | money }}
|
{{ discount_application.title }} (-{{ discount_application.total_allocated_amount | money }})
|
{% if titleBold %}
Ritiro
{% else %}
Ritiro
{% endif %}
|
{% if valueBold %}
{{ shipping_price | money }}
{% else %}
{{ shipping_price | money }}
{% endif %}
|
{% if titleBold %}
Spedizione
{% else %}
Spedizione
{% endif %}
{% if shipping_method.title.size > 0 %}({{ shipping_method.title }}){% endif %}
|
{% if valueBold %}
Gratis
{% else %}
Gratis
{% endif %}
|
{{ shipping_discount }} (-{{ shipping_amount | money }})
|
{% if titleBold %}
Spedizione
{% else %}
Spedizione
{% endif %}
{% if shipping_method.title.size > 0 %}({{ shipping_method.title }}){% endif %}
|
{% if valueBold %}
{{ shipping_price | money }}
{% else %}
{{ shipping_price | money }}
{% endif %}
|
{% if titleBold %}
Dazi
{% else %}
Dazi
{% endif %}
|
{% if valueBold %}
{{ total_duties | money }}
{% else %}
{{ total_duties | money }}
{% endif %}
|
{% if titleBold %}
Imposte
{% else %}
Imposte
{% endif %}
{% if tax_line.title.size > 0 %}({{ tax_line.title }} {{ tax_line.rate | times: 100 }}%){% endif %}
|
{% if valueBold %}
{{ tax_line.price | money }}
{% else %}
{{ tax_line.price | money }}
{% endif %}
|
{% if titleBold %}
Totale
{% else %}
Totale
{% endif %}
|
{% if valueBold %}
{{ total_price | money_with_currency }}
{% else %}
{{ total_price | money_with_currency }}
{% endif %}
|
|
|
|
|
@Andrea-Enea
{% assign subtotal_line_items = subtotal_line_items | sort: 'title' %}
{% for line in subtotal_line_items %}
1 Like
Thank you is not enough.. all the childrens thank you for the help in solving the problem.
Now the bookings that our staff will have to manage, which support research against neuroblastoma, will have an easier time.
Thanks again.
1 Like