Jump to content

Display quantity discounts


Recommended Posts

Load the Foundation skin templates 'content.product.php' and 'element.product.call_to_action.php' into a programmer's text editor.

In content.index.php, near lines 31-33, comment those statements:

{*       {if !empty($PRODUCT.discounts)}
         <dd><a href="#quantity_discounts">{$LANG.catalogue.quantity_discounts}</a></dd>
         {/if}   *}

Near lines 104-129, copy those statements to element.product.call_to_action.php, replacing lines 20-22:

From:

{if !empty($PRODUCT.discounts)}
<p>(<a href="#quantity_discounts">{$LANG.catalogue.bulk_discount}</a>)</p>
{/if}

To:

         {if isset($PRODUCT.discounts)}
         <div class="content" id="quantity_discounts">
            <p>{$LANG.catalogue.quantity_discounts_explained}</p>
            <br>
            <table>
               <thead>
                  <tr>
                     <th>{$LANG.common.quantity}</th>
                     <th>{$LANG.catalogue.price_per_unit}</th>
                  </tr>
               </thead>
               <tbody>
                  <tr>
                     <td class="text-center">1</td>
                     <td class="text-center">{if $PRODUCT.ctrl_sale}{$PRODUCT.sale_price}{else}{$PRODUCT.price}{/if}</td>
                  </tr>
                  {foreach from=$PRODUCT.discounts item=discount}
                  <tr>
                     <td class="text-center">{$discount.quantity}+</td>
                     <td class="text-center">{$discount.price}</td>
                  </tr>
                  {/foreach}
               </tbody>
            </table>
         </div>
         {/if}

Then comment those lines in content.product.php:

{*       {if isset($PRODUCT.discounts)}
         <div class="content" id="quantity_discounts">
            <p>{$LANG.catalogue.quantity_discounts_explained}</p>
            <br>
            <table>
               <thead>
                  <tr>
                     <th>{$LANG.common.quantity}</th>
                     <th>{$LANG.catalogue.price_per_unit}</th>
                  </tr>
               </thead>
               <tbody>
                  <tr>
                     <td class="text-center">1</td>
                     <td class="text-center">{if $PRODUCT.ctrl_sale}{$PRODUCT.sale_price}{else}{$PRODUCT.price}{/if}</td>
                  </tr>
                  {foreach from=$PRODUCT.discounts item=discount}
                  <tr>
                     <td class="text-center">{$discount.quantity}+</td>
                     <td class="text-center">{$discount.price}</td>
                  </tr>
                  {/foreach}
               </tbody>
            </table>
         </div>
         {/if}       *}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...