I'm trying to use the Craft Commerce example template code to show a progress bar throughout the checkout process. It currently doesn't correctly display the % value of progress through the checkout. It is just blank.
The url for my checkout is page is: website.com/shop/test/checkout
To see if it was a styling issue I did a test and set a manual override on the span's width with 50% - the styling then comes into play.
Has anyone else encountered this issue? I don't want to assume anything but the equation to make it kick in doesn't seem to be working.
<div class="steps">
<ul>
{% for key, step in steps %}
{% set class = '' %}
{% if craft.request.requestUri|slice(1) == step.url %}
{% set width = ((key + 1) * 100 / steps|length) - 20 %}
{% set class = "sel" %}
{% set currentStep = key %}
{% endif %}
{% if currentStep is not defined %}
{% set class = "done" %}
{% endif %}
<li class="{{ class }}"><a href="{{ url( step.url ) }}">{{ step.label }}</a></li>
{% endfor %}
</ul>
<div class="meter">
<span style="width: {{ width }}%"></span>
</div>
</div>
commerce
folder to your template directory and viewinghttp://website.com/commerce
? If your url's don't match the url's in thesteps
array it won't work.