<commit_before>{% extends 'checkout/base.jinja' %}

{% set checkout_step = 2 %}
{% set checkout_step_name = _('Delivery Options') %}

{% block main %}
<section class="checkout-container">
  <div class="container">
    <!-- Shipping Method -->
    <div class="row">
      <div class="delivery-address">
        <div class="col-md-6 col-sm-7 col-xs-12">
          <div class="clearfix col-md-12 margin-bottom-25">
            <form method="post">
              <h4><span>{{ _('Choose your Shipping Method') }}</span></h4>              
              {% if delivery_rates %}
                <div id="methods" data-field="shipping_method">
                  <div class="shipment">
                    {% for method_name, rate, currency, metadata, write_vals in delivery_rates %}
                    <p class="shipping-method">
                      <label class="{% if loop.first %}current{% endif %}">
                        <span class="button">
                          <input 
                            type="radio" name="shipping_service_data" value='{{ write_vals }}'
                            {{ 'checked' if loop.first else '' }}
                            />
                        </span>
                        <span class="info">
                          <span class="delivery-date">
                            {{ method_name }}
                          </span>
                          <span class="rate">
                            {{ rate|currencyformat(currency.code) }}
                            {% if metadata.get('duration') %}
                            {{ metadata['duration'] }}
                            {% endif %}
                          </span>
                        </span>
                      </label>            
                    </p>
                    {% endfor %}
                  </div>
                </div>
                <button type="submit" class="btn btn-warning btn-lg btn-block" id="payment-btn">
                  {{ _('Continue to Payment') }}<i class="fa fa-angle-double-right"></i>
                </button>
                <br>
              {% else %}
                <div class="alert alert-warning">
                  {{ _('No shipping method found for this shipment Address') }}
                  <a href="{{ url_for('nereid.checkout.shipping_address') }}">{{ _('click here') }}</a> {{ _('to change') }}
                </div>
              {% endif %}
              <input name=_csrf_token type=hidden value="{{ csrf_token() }}">
            </form>
          </div>
      </div>
      <div class="col-md-6 col-sm-5 col-xs-12">
        <!-- Cart Summary -->
        {{ cart_summary() }}
      </div>
    </div>
  </div><commit_msg>Fix 'delivery_method' template to use new rate dictionary<commit_after>{% extends 'checkout/base.jinja' %}

{% set checkout_step = 2 %}
{% set checkout_step_name = _('Delivery Options') %}

{% block main %}
<section class="checkout-container">
  <div class="container">
    <!-- Shipping Method -->
    <div class="row">
      <div class="delivery-address">
        <div class="col-md-6 col-sm-7 col-xs-12">
          <div class="clearfix col-md-12 margin-bottom-25">
            <form method="post">
              <h4><span>{{ _('Choose your Shipping Method') }}</span></h4>
              {% if delivery_rates %}
                <div id="methods" data-field="shipping_method">
                  <div class="shipment">
                    {% for rate in delivery_rates %}
                    <p class="shipping-method">
                      <label class="{% if loop.first %}current{% endif %}">
                        <span class="button">
                          <input
                            type="radio" name="carrier_json"
                            value='{{ {
                              "carrier": rate.carrier.id,
                              "carrier_service": rate.carrier_service and rate.carrier_service.id,
                              "cost": rate.cost,
                              "cost_currency": rate.cost_currency.id,
                              "display_name": rate.display_name,
                              } | tojson|safe
                            }}'
                            {{ 'checked' if loop.first else '' }}
                            />
                        </span>
                        <span class="info">
                          <span class="delivery-date">
                            {{ rate.display_name }}
                          </span>
                          <span class="rate">
                            {{ rate.cost|currencyformat(rate.cost_currency.code) }}
                          </span>
                        </span>
                      </label>
                    </p>
                    {% endfor %}
                  </div>
                </div>
                <button type="submit" class="btn btn-warning btn-lg btn-block" id="payment-btn">
                  {{ _('Continue to Payment') }}<i class="fa fa-angle-double-right"></i>
                </button>
                <br>
              {% else %}
                <div class="alert alert-warning">
                  {{ _('No shipping method found for this shipment Address') }}
                  <a href="{{ url_for('nereid.checkout.shipping_address') }}">{{ _('click here') }}</a> {{ _('to change') }}
                </div>
              {% endif %}
              <input name=_csrf_token type=hidden value="{{ csrf_token() }}">
            </form>
          </div>
      </div>
      <div class="col-md-6 col-sm-5 col-xs-12">
        <!-- Cart Summary -->
        {{ cart_summary() }}
      </div>
    </div>
  </div>
{'fraction_non_alphanumeric': 0.14557296250660096, 'fraction_numerical': 0.005280760429501848, 'mean_word_length': 1.1579946828712495, 'pattern_counts': {'":': 5, '<': 97, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5558', 'n_tokens_mistral': 1527, 'n_tokens_neox': 1395, 'n_words': 306}