';
let customIngredients = 'data-product-custom-ingredients';
let chooseMax = productInfo.attr(customIngredients + '-max-choose');
let inPrice = productInfo.attr(customIngredients + '-in-price');
if (chooseMax === Config.STATE.STR_ACTIVE || inPrice === Config.STATE.STR_ACTIVE) {
let ingredientsMax = productInfo.attr(customIngredients + '-max');
let ingredientsInPriceMax = productInfo.attr(customIngredients + '-in-price-max');
let view2 = '
';
if (chooseMax === Config.STATE.STR_ACTIVE) {
view2 += 'Maksymalna liczba składników do wyboru: ' + ingredientsMax + '';
}
if (inPrice === Config.STATE.STR_ACTIVE) {
view2 += 'Ilość składników do wyboru w cenie: ' + ingredientsInPriceMax + '';
}
view2 += '
';
view += view2;
}
if (response.options !== undefined) {
$.each(response.options, function (k, option) {
let items = option.items;
let token = option.token;
if (items !== undefined) {
let type = option.type;
const groupName = option.name;
let maxChoose = option.custom_ingredients_max_choose;
let inPrice = option.custom_ingredients_in_price_max;
let hasChoose = !App.empty(maxChoose);
let hasInPrice = !App.empty(inPrice);
view +=
'
' +
'
' +
'' +
'
' + groupName + '
' +
'
';
if (type === Config.ATTR_TYPE.SELECT) {
view +=
'
' +
'
' +
'
' +
'' +
'
' +
'
';
} else {
view += '
';
}
$.each(items, function (k, item) {
let price = item.price;
let name = item.name;
let id = item.id;
let dependent = JSON.stringify(item.dependent);
switch (type) {
case Config.ATTR_TYPE.CHECKBOX:
view +=
'