Bundles

  • Just the Basics 
    • What is a bundle?
    • Pricing and Quantity (Under Details)
    • Products (Under Bundle Products)
    • Related categories (Under Relations)
    • Price modifiers (Under Pricing)
    • Bundle Authority

    • Creating a bundle
    • Adding Relations and Variants
    • Bundles In Faceted Search
    • Bundle Errors
    • Bundle Checks
  • Template Updates
    • Updating your index template
    • Updating your bundle template
    • Updating cart template
    • Updating Basket Icon
    • Updating Product Checkout Details
    • Updating your results template
    • Viewing bundles and products
    • How to view a bundle in order mail
    • Searching for bundles through sitesearch
  • Bundle Links
    • viewing bundles and products
    • Viewing a single bundles and orders
    • Bundle Reorder

Just the Basics 

 We have provided numerous updates to bundles part of our ecommerce enhancements. These include the refined listing of bundles, compatibility with Faceted Search, support for product variants, optimised bundle stock control and reordering.

What is a bundle?

A bundle is simply a collection of products. Bundles accept the following parameters which may be modified by visiting Transactions => Catalogues on the Core dna Digital Experience Platform:

Pricing and Quantity (Under Details)

Products (Under Bundle Products)

Fields:

Related categories (Under Relations)

Price modifiers (Under Pricing)

Bundle Authority


Creating a bundle

To create a bundle, visit Transactions on the Coredna Digital Experience Platform, then select Catalogues->Bundles->Add a New Bundle. Make sure that after you create the bundle you set its status to published and that is has a quantity over 0.

Adding Relations and Variants

On the Coredna Digital Experience Platform, visit Transactions => Catalogues => Products. Search for your product then click edit (be sure to order by all if your product is not visible). Select the Relations tab and add components from your desired categories.

Afterwards select the Variants tab. If this is not visible, visit Transactions => Catalogues => Configure => Manage Configuration and check Use Product Variants. When adding a variant you should be able to see any relations that you have set earlier. Select the appropriate relations and make sure you have positive values for Stock, Minimum Qty and Value.

Bundles In Faceted Search

Bundles are also integrated into Faceted Search By default. They will display like normal products and can be filtered by facets.

Bundle Errors

When you go to publish a Bundle, Various checks are performed to ensure this bundle is good. These checks include:

If any errors are found, they will be shown to the user and the Bundle will not be published. 

Bundle Checks

A Bundle will be set to unpublished on product update, product delete, product unpublish, product checkout and cart checkout. You will be informed when this happens via the UI (except for cart checkout, which will set the Bundle to unpublished if it's requirements are not met)

Bundle checks will also be performed every time a bundle is viewed using view_bundle. If the conditions are not met, then it will be set to published off.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Template Updates

.

Apply the following to allow your site to follow bundles URLS and links

Updating your index template

Open the index file in /modules/prodcatalogue/templates/index.html and add the following code:

index.html
<{elseif $form_name eq 'view_bundle'}>
<{include file="$modules_path/prodcatalogue/templates/bundle.html"}>

Updating your bundle template

Download the revised bundle template here (including updating quantity): bundle.html (legacy version: bundle.html)

Copy and paste bundle.html into /modules/prodcatalogue/templates inside your site directory.

Updating cart template

In order to list bundles other than the products you need to add this under product loop in /modules/prodcataloguecart/templates/index.html:

<{if !empty($new_cart_bundles)}>
<{foreach from=$new_cart_bundles item='bundle'}>
<tr class="cart_table_item">
<!-- Remove from cart link -->
<td class="product-remove">
<a href="#" class="remove" title="Remove this item" onclick="(function($){$('#bundle_delete<{$bundle['bundle']->getId()}>').val('<{$bundle['bundle']->getId()}>');$('form[name=mycart]').submit(); })(jQuery);">&times;
</a>
<input type="hidden" id="bundle_delete<{$bundle['bundle']->getId()}>" name="bundle_delete[<{$bundle['bundle']->getId()}>]" value="" />
</td>
<td>
<b>Bundle</b><br>
Id: <{$bundle['bundle']->getId()}><br>
Name: <{$bundle['bundle']->getName()}><br>
St: <{$bundle['bundle']->getQuantity()}><br>
<div>
<b>Products:</b>
</div>
<{foreach from=$bundle['products'] item='product'}>
Id: <{$product->getId()}><br>
Name: <{$product->getName()}><br>
Qty: <{$product->getProductQty()}><br>
--------<br>
<{/foreach}>
</td>
<!-- Quantity inputs -->
<td class="product-quantity">
<div class="quantity">
<input class="minus" type="button" value="-">
<input name="bundle_quantity[<{$bundle['bundle']->getId()}>]" value="<{$bundle['qty']}>" size="4" title="Qty" class="input-text qty text" maxlength="12" />
<input type="hidden" name="bundle_id[<{$bundle['bundle']->getId()}>]" value="<{$bundle['bundle']->getId()}>" />
<input class="plus" type="button" value="+">
</div>
</td>
<!-- Product subtotal -->
<td class="product-subtotal">
<span class="amount">&#36;
<{$bundle['final_price']|string_format: "%.2f"}>
</span>
</td>
</tr>
<{/foreach}>
<{/if}>

Also to display the errors (e.g. out of stock quantity) add this on top of the file:

<{if !empty($new_cart_errors)}>
<{foreach from=$new_cart_errors item="error"}>
<{$error}>
<{/foreach}>
<{/if}>

Updating Basket Icon

file: block_cart_header_mini.html

In order to display total items in the cart (basket icon) you need to replace 

<{$new_cart_products|@count}>

With:

<{$new_cart_total_number}>

In /modules/prodcataloguecart/templates/block_cart_header_mini.html

Also the same as block_cart_review.html you can have list of bundles:

<{foreach from=$new_cart_bundles item='bundle'}>
Name: <{$bundle['bundle']->getName()}><br>
<{/foreach}>

Updating Product Checkout Details

file: block_cart_review.html

If your checkout page uses 'show_cart' function, in the template (which should be located at: modules/prodcataloguecart/templates/block_cart_review.html) of the block function you need to add bundles the same as products:

Bundles:<br>
<{foreach from=$new_cart_bundles item='bundle'}>
Name: <{$bundle['bundle']->getName()}><br>
<{/foreach}>

Updating your results template

Open the file at modules/sitesearch/templates/results.html inside your site directory and replace any of the links to prodcat with the following: 

results.html
<a href="<{$result->getLink()}>" title="<{$result->getObject()->getName()}> - Click for more details">

Viewing bundles and products

Add the following code inside your products template, you will need to check for both products and bundles and show each in the same <ul>

products.html
<{if $bundles and $bundles|count gt 0}>
<{section name=b_count loop=$bundles}>
<li class="product_item">
<a href="http://<{$smarty.session.centre_host}>/prodcatalogue/bundle/<{$bundles[b_count]->getId()}>/<{$bundles[b_count]->getImage()}>?<{$smarty.now}>" target="_blank">
<img src="http://<{$smarty.session.centre_host}>/prodcatalogue/bundle/<{$bundles[b_count]->getId()}>/s_<{$bundles[b_count]->getImage()}>?<{$smarty.now}>" />
</a>
<p>
<a href="http://<{$smarty.session.centre_host}>/index.php?action=prodcatalogue&form_name=view_bundle&bundle_id=<{$bundles[b_count]->getId()}>" title="<{$bundles[b_count]->getName()}> - Click for more details">
<{$bundles[b_count]->getName()|truncate:50:"..."}>
</a>
</p>
<br><a href="http://<{$smarty.session.centre_host}>/index.php?action=prodcatalogue&form_name=view_bundle&bundle_id=<{$bundles[b_count]->getId()}>" title="<{$bundles[b_count]->getName()}> - Click for more details" class="button_checkout_login button moreinfo_prod">More info</a>
</li>
<{/section}>
<{/if}>

Here is an example products.html with both products and bundles working together, this is only a reference and cannot be copied and pasted into every site.

html document

How to view a bundle in order mail

Update templates/new_order_letter.html with the following code. Clear templates_c.

new_order_letter.html
<{foreach key=key name=main from=$bundles item=currbund}>
<tr>
<td style="font-size: 11px; padding-left: 10px; border-bottom: 1px solid #B39964;font-family: Arial, Helvetica, sans-serif;"><{$currbund.quantity}></td>
<td style="font-size: 11px; border-bottom: 1px solid #B39964;font-family: Arial, Helvetica, sans-serif;">$<{$currbund.name}></td>
<td style="font-size: 11px; border-bottom: 1px solid #B39964;font-family: Arial, Helvetica, sans-serif;">$<{$currbund.unit_price|string_format:"%.2f"}></td>
<td style="font-size: 11px; border-bottom: 1px solid #B39964;font-family: Arial, Helvetica, sans-serif;">$<{$currbund.final_price|string_format:"%.2f"}></td>
</tr>
<{/foreach}>

note: you can use $discount_total instead of $discount to show the discount including shipping. $discount is the amount applied to the product.

Searching for bundles through sitesearch

In order to search bundles on sitesearch, modify the URL search params to: index=prodcat_products+bundles

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Bundle Links

.

viewing bundles and products

In order to view bundles and products you must navigate to the following URL:

Example: http://www.yoursite.com/index.php?action=prodcatalogue&form_name=view_bundles_products

You can pass the following URL args 

Viewing a single bundles and orders

You may view a bundle by visiting the appropriate url and specifying &bundle_id=id 

Example:http://www.yoursite.com/index.php?action=prodcatalogue&form_name=view_bundle&bundle_id=9

Bundle Reorder

You may view an order by visiting the appropriate url and specifying &order_id=id

Example: http://www.yoursite.com/index.php?action=prodcatalogueorder&form_name=trackorders&order_id=26029

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------