Product Details > Bundles
Bundles can be used on the Aurora product details page.
Rules
- If any item within a bundle is out of stock, the entire bundle will vanish. The only exception to this is if the out of stock item is set to a Stock Action on Zero of "Leave available, and can be pre-ordered"
Variables and Data-points
The following data-points relate to and are demonstrated within the example code below.
Name | Description |
---|---|
{$bundles} | The main template variable containing all bundles available for the current product. |
{$bundle.bundle_price} | The price of the bundle. |
{$bundle.products} | A list of products within each bundle. |
{$bundle.is_related} | True or False depending on if the bundle is a related bundle or not. |
{$bundleproduct.attributes} | A list of attributes within each bundled product. |
{$bundleproduct.fields} | A list of product field values within each bundled product keyed by the field name i.e. {$bundleproduct.fields.brand} |
Example Code
{if $bundles}
<div id="details_bundles">
<div class="details_bundles">
<h2 class="large_tabs_box_title">{site_text page="Product Details" part="Title: Bundles" manageable=1}</h2>
{foreach from = $bundles item=bundle name="managersbundles"}
<form action="{if $language_iso}/{$language_iso}{/if}/basket" method="post" class="add-to-basket bundleadd">
<div class="details_bundles_container">
<div class="details_bundles_total">
<p>{site_text page="Product Details" part="Label: Bundle Discount" manageable=1}</p>
<p><span class="details_bundles_save">{$bundle.bundle_complete_saving|displayPrice} <span class="details_bundles_small">({$bundle.bundle_complete_saving_percent}%)</span></span><br /><span class="details_bundles_small">discounted</span></p>
<div class="details_bundles_totalprice">{site_text page="Product Details" part="Text: Only" manageable=1} {$bundle.bundle_price|displayPrice}</div></p>
<p><input class="template_button" rel="bundle" type="submit" value="Add all to Basket" /></p>
<input type="hidden" name="bundle_id" value="{$bundle.id}" />
<input type="hidden" name="product_id" value="{$product.id}" />
</div><!-- end of bundle total -->
{foreach from = $bundle.products item=bundleproduct name="bundles"}
<input type="hidden" name="bundle_product_ids[]" value="{$bundleproduct.id}" />
<div class="details_bundles_item quicklook_container">
<div class="details_bundles_image"><a href="{$bundleproduct.product_filename}"><img src="{product_image_uri product=$bundleproduct width=180 height=180}" alt="{$bundleproduct.product_name}" /></a></div>
<div class="details_bundles_quicklookbutton quicklook_button">
<p><a href="#" class="template_button quicklook" rel="{$bundleproduct.id}">{site_text page="Global" part="Link: Quick Look" manageable=1}</a></p>
</div>
<div class="clear"></div>
<h3>{$bundleproduct.fields.brand}<br /><a href="{$bundleproduct.product_filename}">{$bundleproduct.product_name}{if $bundleproduct.quantity > 1} x {$bundleproduct.quantity}{/if}</a></h3>
{if $bundleproduct.product_price_rrp > $bundleproduct.my_price}
<p><span class="details_bundles_rrp">{site_text page="Global" part="Product Box Label: Was" manageable=1} <span class="strikethrough">{$bundleproduct.product_price_rrp*$bundleproduct.quantity|displayPrice}</span></span> <span class="details_bundles_price_now">{site_text page="Global" part="Product Box Label: Now" manageable=1} {$bundleproduct.my_price*$bundleproduct.quantity|displayPrice}</span></p>
{*<p class="details_bundles_save">{site_text page="Global" part="Product Box Label: Save" manageable=1} {$bundleproduct.price_saving|displayPrice} ({$bundleproduct.price_saving_percent}%)</p>*}
{else}
<p>
<span class="details_bundles_price">{$bundleproduct.my_price*$bundleproduct.quantity|displayPrice}</span>
</p>
{/if}
{if $bundleproduct.product_stock > 0}
<p class="details_instock">In Stock</p>
{else}
<p class="details_outofstock">Pre Order Now{if $bundleproduct.product.restock_date|strtotime > 0} - Due In {$bundleproduct.product.restock_date|strtotime|date:"jS M"}{/if}</p>
{/if}
<div class="clear"></div>
{if $related.product_rating > 0}
<p class="details_productlist_stars">
{assign var='product_rating' value=$related.product_rating|productRating}
<img src="/templates/{$templates_dir}/_images/template/star_{$product_rating}.png" alt="" width="74" height="14" />
</p>
{/if}
<div class="clear"></div>
{include file="products/attributes.tpl.html" type="bundle" product_id=$bundleproduct.id attributes=$bundleproduct.attributes hideLabels=true}
</div>
<div class="{if $smarty.foreach.bundles.last}bundle_noplus{else}bundle_plus{/if}"></div>
{/foreach}
<div class="clear"></div>
</div>
</form>
{/foreach}
<div class="clear"></div>
</div><!-- end of details_bundles -->
</div>
{/if}
Updated 8 months ago