';
bundleHtml += widgetView.getBundleTitle(bundle.title, bundle.name, bundle.id);
bundleHtml += '
';
if (bundle.product_level == 'variant' && bundle.bundle_image !== '') {
// Show custom bundle image
bundleHtml += widgetView.getBundleImage(bundle.bundle_image, bundle.title, bundle.name, bundle.id);
}
var style = ''
if (bundle.product_level == 'variant' && bundle.bundle_image !== '' && hideProductsIfImageIsSet) {
// Hide products because we will show custom bundle image
style='display:none;';
}
bundleHtml += '
';
for (var p = 0; p < bundleRequiredProducts.length; p++) {
var productId = bundleRequiredProducts[p].id;
if (typeof requiredProducts[productId] !== 'undefined') {
var productHtml = this.getProductHtml(requiredProducts[productId], bundle, true);
bundleHtml += productHtml;
}
}
for (var p = 0; p < orderedProducts.length; p++) {
var productId = orderedProducts[p].id;
if (typeof discountedProducts[productId] !== 'undefined') {
var productHtml = this.getProductHtml(discountedProducts[productId], bundle);
bundleHtml += productHtml;
}
}
bundleHtml += '
';
if (bundle.product_level == 'variant' && bundle.bundle_image !== '' && bundle.list_product_names === 'true' && hideProductsIfImageIsSet) {
// Add list of product names
bundleHtml += '
';
var listSeparator = ', ';
listSeparator = ',
';
// Get required and bundle products and show their names!
for (var p = 0; p < orderedProducts.length; p++) {
var productId = orderedProducts[p].id;
if (typeof discountedProducts[productId] !== 'undefined') {
var productHtml = this.getProductListName(discountedProducts[productId], bundle, false, bundleKey);
bundleHtml += productHtml + listSeparator;
}
}
for (var p = 0; p < bundleRequiredProducts.length; p++) {
var productId = bundleRequiredProducts[p].id;
if (typeof requiredProducts[productId] !== 'undefined') {
var productHtml = this.getProductListName(requiredProducts[productId], bundle, true, bundleKey);
bundleHtml += productHtml + listSeparator;
}
}
// Strip last comma
bundleHtml = bundleHtml.replace(/,\s*$/, '').replace(/,
$/, '');
bundleHtml += '
';
}
if (bundle.total_price_text !== '') {
bundleHtml += '
' + this.getTotalPriceText(bundle, bundleKey) + '
';
}
var addToCartButtonText = bundle.button_text;
if (this.widgetCanBeDisplayed === false) {
addToCartButtonText = 'Agotado';
}
addToCartButtonText = this.replacePricePlaceholders(addToCartButtonText, bundle, bundleKey);
bundleHtml += '
' + addToCartButtonText + '
';
bundleHtml += '