oc-shopaholic / oc-orders-shopaholic-plugin

🛒 Orders (cart) extension for Shopaholic plugin
https://octobercms.com/plugin/lovata-ordersshopaholic
GNU General Public License v3.0
27 stars 18 forks source link

Email template variable #141

Open blackyzero opened 3 years ago

blackyzero commented 3 years ago

Hello,

Where could i get variables for email template? From current template "lovata.ordersshopaholic::mail.create_order_manager/user, i only know {{ order_number }}, {{site_url}}

I am looking for following info: Billing, Shipping, Detail order items, shipping type/method, discount, total.

Thanks in advances.

blackyzero commented 3 years ago

Hi,

Any update on this? By now, the email doesn't show much info for the order, please see attached image for more detail.

https://ibb.co/XX4NhLr

Appreciate your help. Thank you.

mennax commented 3 years ago

Hi,

Any update on this? By now, the email doesn't show much info for the order, please see attached image for more detail.

https://ibb.co/XX4NhLr

Appreciate your help. Thank you.

Hi, this is my template:

A new order {{ order_number }} was created on the <a href="{{ site_url }}">site</a>.

Buongiorno {{ user_item.name }},

Ti confermiamo che l'ordine N. <b>{{ order_number }}</b> è stato creato con successo.

Data: {{ order.created_at|date("D j F \\a\\l\\l\\e G:i") }}

Numero: {{ order.order_number }}

Pagamento: {{ order.payment_method.name }}

Spedizione: {{ order.shipping_type.name }}

{% set obPriceData = order.total_price_data %}

<h4>Riepilogo dell'ordine:</h4>

<table class="table" style="width:100%;background-color:#eee;padding:9px;">
<tr>
<th style="text-align:left;font-weight:normal;border-bottom:1px solid #ccc;">Prodotto</th>
<th style="text-align:left;font-weight:normal;border-bottom:1px solid #ccc;">Prezzo</th>
<th style="text-align:center;font-weight:normal;border-bottom:1px solid #ccc;">Quantità</th>
<th style="text-align:right;font-weight:normal;font-style:italic;border-bottom:1px solid #ccc;">Totale</th>
</tr>
{% for position in order.order_position %}

{% set obOffer = position.item %}
{% set obProduct = obOffer.product %}
{% set posPriceData = position.price_data %}
{{ obProduct.brand.name }}
<tr>
<td style="border-bottom: 1px solid #ddd;"><b>{{ obProduct.name }}</b><br>{{ obOffer.name }}</td><td style="border-bottom: 1px solid #ddd;">{{ position.price }}</td><td style="text-align:center;border-bottom: 1px solid #ddd;">{{ position.quantity }}</td><td style="text-align:right;border-bottom: 1px solid #ddd;">{{ position.currency_symbol }} {{ posPriceData.price_with_tax }}</td>
</tr> 
{% endfor %}
</table>
<p> </p>

Costi di spedizione: {{ order.shipping_price }}

<b>Importo totale: {{ obPriceData.price_with_tax }}</b>

<h4>Indirizzo di spedizione:</h4>

{{ order.property.shipping_street }}

{{ order.property.shipping_postcode }} {{ order.property.shipping_city }} - Prov. {{ order.property.shipping_state }}

Località: {{ order.property.shipping_address1 }}

<hr>

Vai alla pagina dei <a href="http://{{ site_url }}/user/user-orders">tuoi ordini</a> per vedere il dettaglio.

A presto

Il team di <a href="http://{{ site_url }}">MyShop</a>
blackyzero commented 3 years ago

Thanks @mennax . These help a lot.

The shipping postcode doesn't show in my email contain although it's input during customer order. In addition, what are the variable for telephone, country, coupon discount value? I tried to add it like {{ order.property.shipping_country }} or {{ order.property.shipping_telephone }} but it doesn't show.

Thanks again.

mennax commented 3 years ago

I only read now. You solved?