Closed terryupton closed 4 years ago
This has got me most of the way there...
{% for col in purchasable.setDiscounts.GBP %}
{# {{ col[0] }} - {{ col[1] }}#}
{{ col }}
{% endfor %}
{% for key, value in purchasable.setDiscounts.GBP %}
Key : {{ key }}
Value : {{ value }}
{% endfor %}
Final update:
{% for purchasable in product.variants %}
{{ purchasable.title }}<br />
{{ purchasable.price|commerceCurrency(cart.currency) }}<br />
{% for qty, price in purchasable.setDiscounts.GBP|slice(1) %}
Qty : {{ qty }}
Price : {{ price|number_format(2, '.', ',')|commerceCurrency(cart.currency) }}
<br />
{% endfor %}<br /></br />
{% endfor %}
{% for qty, price in purchasable.bulkPricesField[cart.paymentCurrency] if key != 'iso' %} Qty: {{ qty }} Price: {{ price|commerceCurrency(cart.paymentCurrency) }} {% endfor %}
I would like to show a table for the qty's and the prices for each bulk qty as per what is setup in the backend. How can I loop through this on the front-end?
I have tried a few approaches, but hitting errors:
Key "qty" for array with keys "iso, 2, 4" does not exist.
Array to string conversion