{%- macro replacedUser(text) -%} {% set user = getCustomerUser() %} {% if user is null %} {% set user = getGuestUser() %} {% endif %} {% set profile = user.profile|default %} {% set date = "now"|date('d.m.Y H:i') %} {% set cartSession = app.session.get("cart") %} {% set addressId = cartSession['shippingAddress'] %} {% if addressId %} {% set address = getCustomerAddress({'id':addressId}) %} {% endif %} {% set replaced = { '[adsoyad]': profile.fullName|default, '[email]': user.email|default, '[tarih]': date|default, '[telefon]': profile.phoneNumber|default, '[adres]': address.address|default } %} {% if user.guestUser %} {% set replaced = { '[adsoyad]': address.fullName|default, '[email]': cartSession['email']|default, '[tarih]': date|default, '[telefon]': address.phoneNumber|default, '[adres]': address.address|default } %} {% endif %} {% set text = text|replace(replaced) %} {{ text|raw }} {% endmacro %} {%- macro replacedOrder(text) -%} {% set user = getCustomerUser() %} {% if user is null %} {% set user = getGuestUser() %} {% endif %} {% set profile = user.profile|default %} {% set date = "now"|date('d.m.Y H:i') %} {% set summaryCart = getSummartCart() %} {% set cartSession = app.session.get("cart") %} {% set shippingAddressId = cartSession['shippingAddress'] %} {% if shippingAddressId %} {% set shippingAddress = getCustomerAddress({'id':shippingAddressId}) %} {% endif %} {% set billingAddressId = cartSession['billingAddress'] %} {% if billingAddressId %} {% set billingAddress = getCustomerAddress({'id':billingAddressId}) %} {% endif %} {% set urunler = _self.getUrunler() %} {% set replaced = { '[siparis_fiyat]' : money_format(summaryCart['total']|default("0"))~" TL", '[kargo_fiyat]' : money_format(summaryCart['cargo']|default("0"))~" TL", '[odeme_sekli]' : "", '[teslimat_adres]' : shippingAddress.address|default, '[teslimat_adsoyad]' : shippingAddress.fullName|default, '[fatura_adres]' : billingAddress.address|default, '[urunler]' : urunler|default, } %} {% set text = text|replace(replaced) %} {{ text|raw }} {% endmacro %} {%- macro getUrunler() -%} {% set carts = getUserCart() %}
Ürün | Adet | Fiyat |
---|---|---|
{{ productLang.name|default }} {{ productVariantValue.info(productVariant) }} | {{ cart.qty|default }} adet | {{ money_format(price|default) }} TL |