Товар в корзине
Блок выводится в корзине и отвечает за показ информации по конкретному товару, добавленному пользователем.
Шаблон "по-умолчанию" для отдельного блока:
<div class="jstore-tag lsp-block-cart-item-row lsp-block-cart-item-row-name"> <b class="jstore-tag lsp-block-cart-item-name lsp-js-item-show"><%= name %><span class="lsp-js-modifier-tail"><%= typesTail %></span></b> <span class="jstore-tag lsp-block-cart-item-discount <% if(discount === 0){%>lsp-js-hidden<%}%>"> <% if(discount >= (amount * price)){ %> <%= jStoreApp.t('gift')%> <% }else if(discount){ %> <%= jStoreApp.t('discount')%> <% } %> </span> </div> <div class="jstore-tag lsp-block-cart-item-row lsp-block-cart-item-row-subname"> <em class="jstore-tag lsp-block-cart-item-amount-c"> <input class="jstore-tag lsp-block-cart-item-amount-c-count" name="count" value="<%= amount %>"> <em class="jstore-tag lap-block-cart-item-amount-c-type"><%= jStoreApp.t(useBalanceForSell ? 'amount_kg' : 'amount')%></em> </em> <strong class="jstore-tag lsp-block-cart-item-price-c"> <em class="jstore-tag lsp-block-cart-item-price-c-count lsp-js-price"><%= price %></em> <em class="jstore-tag lsp-block-cart-item-price-c-type"><%= jStoreApp.getCurrency()%></em> </strong> <span class="jstore-tag lsp-block-cart-item-pmc"> <% if(active){ %> <span class="jstore-tag lsp-button-minus lsp-button-minus lsp-js-item-minus">–</span> <span class="jstore-tag lsp-button-plus lsp-js-item-plus">+</span> <% }else{ %> <span class="jstore-tag lsp-button-cross lsp-button-red lsp-js-item-delete">x</span> <% } %> </span> <div class="jstore-tag lsp-block-cart-modifiers lsp-js-cart-modifiers"></div> </div> <div class="jstore-tag lsp-help-info lsp-js-help-info"> <% if(!active){ %> <%= not_active_message %> <% } else if(priceChanged){ %> <%= jStoreApp.t('cart_item_price_changed') %> <% } %> </div>
Шаблон "по-умолчанию" для вывода на странице корзины:
<td class="jstore-tag lsp-cartblock-image-cont"><span class="jstore-tag lsp-delete-item lsp-js-item-delete"></span><img class="jstore-tag lsp-cartblock-image lsp-js-item-show" src="<%= smallImageUrl %>" /></td> <td class="jstore-tag"> <div class="jstore-tag lsp-cartblock-title-cont"> <span class="jstore-tag lsp-js-item-show lsp-cartblock-title"><%= name %><% _.each(types, function(type){ print(', ' + type.name); }) %></span> <% if(discount >= (amount * price)){ %> <span class="jstore-tag lsp-block-cart-item-discount"><%= jStoreApp.t('gift')%></span> <% }else if(discount){ %> <span class="jstore-tag lsp-block-cart-item-discount"><%= jStoreApp.t('discount')%></span> <% } %> <div class="jstore-tag lsp-help-info"> <% if(priceChanged){ %> <%= jStoreApp.t('cart_item_price_changed') %> <% }else if(!active){ %> <%= jStoreApp.t('cart_item_unActive') %> <% } %> </div> </div> <div class="jstore-tag lsp-block-cart-modifiers lsp-js-cart-modifiers"></div> </td> <td class="jstore-tag lsp-cartblock-amount-cont"><!-- --><!-- <% if(active){ %> --><span class="jstore-tag lsp-button-minus lsp-js-item-minus">–</span><!-- --><input class="jstore-tag lsp-block-cartblock-item-amount-c-count" name="count" value="<%= amount %>"><!-- --><span class="jstore-tag lsp-button-plus lsp-js-item-plus">+</span><!-- --><em class="jstore-tag lap-block-cartblock-item-amount-c-type"><%= jStoreApp.t(useBalanceForSell ? 'amount_kg' : 'amount')%></em><!-- <% }else{ %> --><span class="jstore-tag lsp-button-cross lsp-button-red lsp-js-item-delete">x</span><!-- --><em class="jstore-tag lsp-block-cartblock-item-amount-c-count"><%= amount %></em><!-- --><em class="jstore-tag lap-block-cartblock-item-amount-c-type"><%= jStoreApp.t(useBalanceForSell ? 'amount_kg' : 'amount')%></em><!-- <% } %> --></td> <td class="jstore-tag lsp-block-cartblock-item-price-c-count"> <span class="lsp-js-price"><%= price %></span> <%= jStoreApp.getCurrency()%> </td>
Шаблоны предусматривают использование следующих переменных:
Название | Тип | Описание | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
name | Integer | Название товара | |||||||||
types | Array | Массив выбранных групповых модификаторов товаров, у которых в ограничениях стоит min. 1 и max. 1. Содержащий следующие переменные:
|
|||||||||
amount | Integer | Количество товара в корзине | |||||||||
price | Integer | Цена товара | |||||||||
discount | Integer | Скидка на товар | |||||||||
description | String | Описание товара | |||||||||
smallImageUrl | String | URL маленькой картинки | |||||||||
mediumImageUrl | String | URL средней картинки | |||||||||
largeImageUrl | String | URL большой картинки |