Sha256: a5c1ca84f203a185c6aedade11880df1d2bc2209d2466606f6f24afe5a5bc433

Contents?: true

Size: 1.41 KB

Versions: 11

Compression:

Stored size: 1.41 KB

Contents

<%= fields_for "#{prefix}[calculator_attributes]", calculator do |f| %>
  <%= f.label :preferred_amount %>
  <%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :preferred_amount, currency_attr: :preferred_currency %>
<% end %>

<div class="field">
  <p>
    <%= admin_hint(
      calculator.model_name.human,
      """
        <p>
          This amount will be distributed to line items weighted relative to
          their price. More expensive line items will receive a greater share
          of the adjustment.
        </p>

        <p>
          For example, with three line items and a preferred amount of $15 we
          would end up with the following distribution:
        </p>

        <table>
          <thead>
            <tr>
              <th></th>
              <th>Price</th>
              <th>Weighted Adj.</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>Socks</td>
              <td>$5</td>
              <td>-$1.5</td>
            </tr>
            <tr>
              <td>Shoes</td>
              <td>$30</td>
              <td>-$9</td>
            </tr>
            <tr>
              <td>Slippers</td>
              <td>$15</td>
              <td>-$4.5</td>
            </tr>
          </tbody>
        </table>
      """
    ) %>

    This amount will be the <strong>total</strong> discount spread amongst all
    of the line items.
  </p>
</div>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
solidus_backend-2.4.2 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.4.1 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.3.1 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.4.0 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.4.0.rc1 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.4.0.beta1 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.3.0 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.3.0.rc3 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.3.0.rc2 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.3.0.rc1 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb
solidus_backend-2.3.0.beta1 app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb