Create your own ecommerce website and start selling successfully with ShopWired today

Create your own ecommerce website and start selling successfully with ShopWired today

Bulk pricing discount tables

Bulk pricing discount tables

Before you proceed:
The following article contains information that requires you to have some prior knowledge about coding in order to correctly implement the proposed change to your theme. If done incorrectly alterations made to your theme’s code can negatively impact your website causing visual and performance issues. Therefore, we strongly recommend that you only undertake this effort if you are completely confident that you know what you’re doing. If you have no coding experience at all, aren’t entirely comfortable following the instructions in this article or if you simply don’t understand the instructions then we recommend you instead contact us, and our coding team will complete the work for you for a set fee.


Pro tip!

If you are using a version 3 or version 4 theme you won't need to add this code to your theme's files to produce these tables. Instead, you just need to activate a setting in your theme's settings.


If you're using the Bulk Discounts app then you may want to display, on your product pages, a table (or tables) that display the bulk discounts that you offer, as shown in the example below.

If you sell a product that has variations, and you set different prices for the variations (and so different bulk discounts are applicable) then you can display multiple tables on the product page - one for each variation.


Adding the code below will add the tables to products that have bulk pricing discounts set.

1. Locate the product.twig file (located in /views/product pages/product.twig)

2. You'll need to add the code shown below where you would like to display the table

{% if product.bulk_prices %}
      <table>
           <h3>Bulk Buy Discounts</h3>
            <tr>
                   <td>Quantity Purchased</td>
                   <td>Price</td>
            </tr>
            {% for bulk_price in product.bulk_prices %}
                   <tr>
                          <td>{{ bulk_price.quantity }}</td>
                          <td>{{ currency_value(bulk_price.value) }}</td>
                   </tr>
            {% endfor %}
       </table>
{% endif %}

for example

This will display a table for bulk discount pricing on the product. If your product has variations, and you have set bulk pricing rules for the variations, then the table above will not display.

3. We recommend that you only add the code for the display of bulk discounts for variations if you have products that have variations and will be setting bulk pricing rules for them.

Here's the code

{% if product.bulk_variations %}
      {% for variation in product.bulk_variations %}
            <h3>{{ variation.title }}</h3>
            <table>
                 <tr>
                        <td>Quantity Purchased</td>
                        <td>Price</td>
                 </tr>
                 {% for bulk_price in variation.prices %}
                       <tr>
                              <td>{{ bulk_price.quantity }}</td>
                              <td>{{ currency_value(bulk_price.value) }}</td>
                       </tr>
                 {% endfor %}
             </table>
      {% endfor %}
{% endif %}

for example

You should put both the normal product discount table code and the product variation discount table code onto the page (not just the variation discount table code).

Please Note: The code above has no styling, so it will need to be styled (with CSS or inline styles) to display nicely.


Global bulk discounts

If you're setting bulk discounts for products as percentage discounts using the feature described in this help guide, then to display a table containing these discounts you'll need to use the code shown below.

{% if product.bulk_discounts %}
      <table>
            <h3>Bulk Buy Discounts</h3>
            <tr>
                   <td>Quantity Purchased</td>
                   <td>Discount</td>
            </tr>
            {% for discount in product.bulk_discounts %}
                  <tr>
                         <td>{{ discount.quantity }}</td>
                         <td>{{ discount.percent }}%</td>
                  </tr>
            {% endfor %}
       </table>
{% endif %}

The {{ discount.percent }} variable will return the % discount, not the price of the product with the discount applied.

Please Note: As with the code further up this article, the above code above has no styling, so it will need to be styled (with CSS or inline styles) to display nicely.

Latest Articles

EU Accessibility Regulations Are Coming — Here’s What Nordic Merchants Need to KnowEcommerce

EU Accessibility Regulations Are Coming — Here’s What Nordic Merchants Need to Know

From 28 June 2025, new EU regulations will require all consumer-facing webshops to meet certain accessibility standards. Known as the European Accessibility Act (EAA), the goal is to make online stores...

Read more

Understanding the behavior of B2B buyers in 2024B2B Ecommerce

Understanding the behavior of B2B buyers in 2024

Navigating the complexities of B2B purchasing requires an in-depth understanding of buyer behavior, which has evolved significantly over recent years. Companies today must adapt to these changing dynamics...

Read more

Getting Started With Google ShoppingMarketing

Getting Started With Google Shopping

Google Shopping is a powerful platform that lets online stores showcase their products on both the Google results page and Google Shopping tab. This unique advertising opportunity helps brands put...

Read more

8 Ways to Improve Customer ServiceEcommerce business management

8 Ways to Improve Customer Service

The success of your ecommerce store depends on more than just top-notch products and savvy marketing. According to a study by Salesforce, 88% of customers said their whole experience with a business is...

Read more

Upgrading Magento: When Costs Outweigh BenefitsEcommerce business management

Upgrading Magento: When Costs Outweigh Benefits

When Magento was released back in 2007, the appeal of an open-source ecommerce platform quickly captured the attention of businesses wanting complete control over their online store. However, for...

Read more

AI in Ecommerce- Tips and ChallengesEcommerce business management

AI in Ecommerce- Tips and Challenges

Artificial intelligence (AI) is revolutionizing the ecommerce landscape.By 2030, the AI-enabled ecommerce market is estimated to reach $16.8 billion, growing by a rate of 15.7% CAGR in the next 8 years....

Read more

6 Signs You've outgrown your Ecommerce PlatformEcommerce

6 Signs You've outgrown your Ecommerce Platform

In the ever-evolving landscape of ecommerce, the success of your business hinges not only on the products you sell but also on the robustness of your ecommerce platform.As we navigate through an era where...

Read more

Website Migration SEO- How To Maintain SEO When Migrating Your WebsiteMarketing

Website Migration SEO- How To Maintain SEO When Migrating Your Website

When your current platform no longer meets your evolving needs, it might be time to consider a website migration. Such a transition, though often necessary, isn't just about shifting to a new platform;...

Read more

Start your 14 day free trial today

See why ShopWired is one of Europe's favourite ecommerce platform and start building your ecommerce website today.

No obligation, no credit card, no commitment, no contract