How to move volume pricing table next to price



  • Does the volume pricing / volume discounts table have a hook that I can use to move the table nearer the price? I think that would be a more suitable spot to show volume discounts.

    I’d also like to generally format the volume pricing table, but haven’t been able to find its template. Does anyone know where to look?



  • There is no hook for that.
    The code is inside themes/your-theme-name/product.tpl
    Just look for {if !empty($quantity_discounts)}



  • @30knees
    what do you think of this view?

    0_1514651855907_298f117f-b582-4cc8-bb48-d8ed43fc18bb-grafik.png



  • or this

    0_1514665453083_7f779a66-dcd3-450b-aa37-a2e2f59bf429-grafik.png



  • The second one is awesome! I think that is great motivator to add more to the cart. Nice job!



  • @30knees

    You can move or copy the discount table under the price display.
    In the default theme following code:

          {if !empty($quantity_discounts)}
            <section id="product-volume-discounts" class="page-product-box">
              <h3 class="page-product-heading">{l s='Volume discounts'}</h3>
              <div id="quantityDiscount" class="table-responsive">
                <table class="table-product-discounts table table-condensed table-bordered table-hover">
                  <thead>
                  <tr>
                    <th>{l s='Quantity'}</th>
                    <th>{if $display_discount_price}{l s='Price'}{else}{l s='Discount'}{/if}</th>
                    <th>{l s='You Save'}</th>
                  </tr>
                  </thead>
                  <tbody>
                  {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
                    {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
                      {$realDiscountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
                    {else}
                      {$realDiscountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
                    {/if}
                    <tr id="quantityDiscount_{$quantity_discount.id_product_attribute}" class="quantityDiscount_{$quantity_discount.id_product_attribute}" data-real-discount-value="{convertPrice price = $realDiscountPrice}" data-discount-type="{$quantity_discount.reduction_type}" data-discount="{$quantity_discount.real_value|floatval}" data-discount-quantity="{$quantity_discount.quantity|intval}">
                      <td>
                        {$quantity_discount.quantity|intval}
                      </td>
                      <td>
                        {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
                          {if $display_discount_price}
                            {if $quantity_discount.reduction_tax == 0 && !$quantity_discount.price}
                              {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}
                            {else}
                              {convertPrice price=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
                            {/if}
                          {else}
                            {convertPrice price=$quantity_discount.real_value|floatval}
                          {/if}
                        {else}
                          {if $display_discount_price}
                            {if $quantity_discount.reduction_tax == 0}
                              {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}
                            {else}
                              {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
                            {/if}
                          {else}
                            {$quantity_discount.real_value|floatval}%
                          {/if}
                        {/if}
                      </td>
                      <td>
                        <span>{l s='Up to'}</span>
                        {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
                          {$discountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
                        {else}
                          {$discountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
                        {/if}
                        {$discountPrice=$discountPrice * $quantity_discount.quantity}
                        {$qtyProductPrice=$productPriceWithoutReduction|floatval * $quantity_discount.quantity}
                        {convertPrice price=$qtyProductPrice - $discountPrice}
                      </td>
                    </tr>
                  {/foreach}
                  </tbody>
                </table>
              </div>
            </section>
          {/if}
    

    before

    <div class="product_attributes clearfix">
    


  • Brilliant, thank you very much for sharing! Nice!


 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.