-
-
Save peteeveleigh/de6d0930851ef6c66cee125220460b3a to your computer and use it in GitHub Desktop.
Craft Commerce debugging template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if craft.config.get('devMode') %} | |
{% set size = 30 %} | |
<pre style="width:80%;margin:0 auto"> | |
Line Items: | |
--------------------------------------------------- | |
{% for lineItem in cart.lineItems %} | |
{{ lineItem.purchasable.title }} x {{ lineItem.qty }} {{ dump(lineItem.options) }} | |
{% endfor %} | |
Adjustments: | |
--------------------------------------------------- | |
{% for adjustment in cart.adjustments %} | |
{{ "%#{size}s"|format("#{adjustment.name} (#{adjustment.description}):") }} {{ adjustment.amount|currency(cart.currency) }} | |
{% endfor %} | |
Cart: | |
--------------------------------------------------- | |
{{ "%#{size}s"|format("Total Discount:") }} {{ cart.totalDiscount|currency(cart.currency) }} | |
{{ "%#{size}s"|format("Total Shipping:") }} {{ cart.totalShippingCost|currency(cart.currency) }} | |
{{ "%#{size}s"|format("Total Tax:") }} {{ cart.totalTax|currency(cart.currency) }} | |
{{ "%#{size}s"|format("Total Tax (inc):") }} {{ cart.totalTaxIncluded|currency(cart.currency) }} | |
{{ "%#{size}s"|format("Item Subtotal:") }} {{ cart.itemSubtotal|currency(cart.currency) }} | |
{{ "%#{size}s"|format("Item Total:") }} {{ cart.itemTotal|currency(cart.currency) }} | |
{{ "%#{size}s"|format("Base Discount:") }} {{ cart.baseDiscount|currency(cart.currency) }} | |
{{ "%#{size}s"|format("Base Shipping Cost:") }} {{ cart.baseShippingCost|currency(cart.currency) }} | |
=================================================== | |
{{ "%#{size}s"|format("Total Price:") }} {{ cart.totalPrice|currency(cart.currency) }} | |
</pre> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment