|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Verlegehilfen Smarty n00b
Joined: 07 Oct 2021 Posts: 1
|
Posted: Thu Oct 07, 2021 9:37 am Post subject: Customize a string - DE |
|
|
Ich brauche eure Hilfe,
bin selbst kein programmierer aber gebe mein bestes ^^
Undzwar ist mein Hauptanliegen das in unserem Shop unter dem Brutto Preis noch der Netto preis mit angezeigt wird.
Habe den Befehl vom Brutto einfach kopiert und eingefügt. <SPAN CLASS> natürlich anders genannt.
Brutto:
Code: |
<span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">{{ price.unitPrice|currency}}{{"general.star"|trans|sw_sanitize }}
{% if isListPrice and not displayFrom %}
{% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}{% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}{% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %} <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">{% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
{% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span></span>{% endif %}</span> |
Netto:
Code: |
<span class="product-priceNetto{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
Netto: {{ $price.unitPrice/119*100 }}{{"general.star"|trans|trim|sw_sanitize }} </span>
|
Somit berechnet er direkt vom Brutto Preis den Netto preis.
Nur das ich jetzt den Netto Preis mit 12 nachkomma stellen habe.
Zudem wird mir der Netto Preis mit einem Punkt getrennt.
23,09 €*
Netto: 19.403361344538*
inwiefern muss ich denn nun den Code für den Netto Preis schreiben, dass folgendes bei raus kommt.
23,09 €*
Netto: 19,40
Ich muss dem doch den Befehl geben:
Format: |number_format:2
|number_format:2:",":""
Vielen dank im vorraus |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|