SEOshop Documentation

Bundle products

Version 2.0, last edit: Apr 29, 2015

Introduction

We've introduced bundle products for our platform. With this feature you can add extra products to a product and offer a reduced price for this bundle. The bundle has three parts. The bundle with main product, the bundle products and the details.

Please note: All used snippets in this article are plain examples without styling. You can customize yourself where needed.

Installing

Add the code in the product.rain template under GENERAL > Design > Template Editor
Or create a snippet that you include in the product.rain

1. Start bundleloop.

{% for bundle in product.bundles %}

2. Load main product.

 <div class="product">
           <div class="image">
            <a href="{{ product.url | url }}" title="{{ product.fulltitle }}">
              {% if product.image %}
                                   <img src="{{ product.image | url_image('135x135x1', product.fulltitle) }}" height="135" width="135" alt="{{ product.fulltitle }}"/>
                  </div>
               {% endif %}
               </a>
          <div class="info">
            <a href="{{ product.url | url }}" title="{{ product.fulltitle }}" class="title no-underline">
              <h3> {{ product.title }}</h3>
            </a>
          </div>
      </div>                    

3. Load bundle products.

 {% for bundle_product in bundle.products %}
            <div class="product">
             <div class="image">
              <a href="{{ bundle_product.url | url }}" title="{{ bundle_product.fulltitle }}">
                {% if bundle_product.image %}
                                      <img src="{{ bundle_product.image | url_image('135x135x1', bundle_product.fulltitle) }}" height="135" width="135" alt="{{ bundle_product.fulltitle }}"/>
                {% endif %}
              </a>
            </div>
            <div class="info">
              <a href="{{ bundle_product.url | url }}" title="{{ bundle_product.fulltitle }}" class="title no-underline">
  {% if bundle_product.quantity > 1 %} {{ bundle_product.quantity }}x {% endif %} {{ bundle_product.title }}   
                </a>
              {% if bundle_product.variant %}   
                <p>{{ bundle_product.variant }}</p> {% endif %}
            </div>
          </div>
{% endfor %}

4. Load bundle details.

<div class="bundleDetails">
  <div class="product-details">
    <div class="discount title">
      {% if bundle.percentage %}
      {{ bundle.percentage | percentage }} {{ 'Discount' | t }}
      {% endif %}
    </div>
    {% if bundle.price.price_old != bundle.price.price %}
    <div class="old-price line-through">{{ bundle.price.price_old | money }}
    </div>
    {% endif %}
    <div class="price total">{{ bundle.price.price | money }}                  {% if shop.b2b %}
      <small class="price-tax">{{ 'Excl. VAT' | t }}</small>{% else %}
      <small class="price-tax">{{ 'Incl. VAT' | t }}</small>{% endif %}
      {% if shop.settings.legal.mode == 'strict' %}
      <small>{{ 'Excl. $1' | t('<a href="' ~ 'service/shipping-returns' | url ~ '" target="_blank">' ~ 'Shipping costs' | t ~ '</a>') | raw }}</small> {% endif %}
    </div>
    {% if bundle.stock.available %}  
         <a href="#" class="btn " onclick="javascript:$('#product_configure_bundle_id').val('{{ bundle.id }}'); $('#product_configure_form').submit(); return false;">{{ 'Add to cart' | t }}</a>
    {% else %}
        <span class="out-of-stock"><em>{{ 'Out of stock' | t }}</em></span>
    {% endif %}
</div>
</div>

5. Close bundle loop.

{% endfor %}

6. Variables.

This will check if there are productbundles available

{% if product.bundles %}
{% endif %}

Please note: Don't forget the german legislation option on the price

Help

If you need any help regarding this subject, please do not hesitate to get in touch. You can reach us via support@seoshop.com.

Was this article helpful? Yes No
One moment please
Thanks for your feedback.