{$_.before_items}
{/if}{/foreach}
{* ITEMS LIST *}
{if !empty($cart.items)}
{foreach $cart.items as $_item}
{* this code sets default values for empty SKU fields *}
{$_item.product = shopFrac::inheritSkuFieldsFromProduct($_item.product)}
{$_active_sku = $_item.product.skus[$_item.product.sku_id]|default:null}
{$_show_fractional = !empty($formatted_units[$_item.product["stock_unit_id"]]) && !empty($formatted_units[$_item.product["base_unit_id"]]) && ($_item.product["stock_unit_id"] !== $_item.product["base_unit_id"]) && !empty($_active_sku["stock_base_ratio"])}
{$_product_front_uri = $wa->shop->productUrl($_item.product)}
{$_product_image_uri = $wa->shop->productImgHtml($_item.product, '200', ['default' => "`$wa_app_static_url`img/image-dummy.png"])}
{$_stock_count = null}
{$_is_in_stock = false}
{$_is_out_of_stock = false}
{$_is_more_than_limit = false}
{$_is_limit = false}
{$_is_product_disabled = false}
{if empty($_item.sku_available)}
{$_is_product_disabled = true}
{/if}
{if $_item.stock_count === null}
{$_is_in_stock = true}
{else}
{$_stock_count = $_item.stock_count|floatval}
{$_min_max = (!empty($_item["order_count_min"]) && ($_item["order_count_min"] > $_stock_count))}
{if ($_stock_count === 0 || $_stock_count === 0.0 || $_min_max)}
{$_is_out_of_stock = true}
{elseif $_stock_count > 0 && $_item.quantity <= $_stock_count}
{$_is_in_stock = true}
{if $_item.quantity == $_stock_count}
{$_is_limit = true}
{/if}
{elseif $_item.quantity > $_stock_count}
{$_is_more_than_limit = true}
{/if}
{/if}
{$_product_classes = []}
{if !empty($_is_out_of_stock)}
{$_product_classes[] = "is-out-of-stock"}
{/if}
{if !empty($_is_more_than_limit)}
{$_product_classes[] = "is-more-than-limit"}
{/if}
{if !empty($_is_product_disabled)}
{$_product_classes[] = "is-disabled"}
{/if}
{/foreach}
{/if}
{* @event frontend_order_cart_vars *}
{foreach $event_hook as $_}{if isset($_.after_items)}
{* IMAGE *}
{* DETAILS *}
{* QUANTITY *}
{* @event frontend_order_cart_vars
* Items can be modified to insert custom HTML here. *}
{if isset($_item.cart_custom_html)}
{$_item.product.name|escape}
{if isset($_item.sku_name) && strlen($_item.sku_name) && $_item.sku_name != $_item.product.name}
{$_item.sku_name|escape}
{/if}
{if !empty($_config["show_weight"]) && !empty($_item.weight_html)}
{$_item.weight_html}
{/if}
{if !empty($_config.change_sku) && $_item.product.sku_count > 1}
[`Select another SKU`]
{/if}
[`Delete`]
{if !empty($_item.services)}
{foreach $_item.services as $_service_id => $_service}
{$_is_active = !empty($_service.id)}
{/if}
{if isset($_service.variants)}
{else}
{/if}
{/foreach}
{*
{* PRICE *}
{$_hint = ""}
{if !empty($_is_more_than_limit)}
{$_hint = $_locales["quantity_empty"]}
{elseif !empty($_is_limit)}
{$_hint = $_locales["quantity_limit"]}
{else}
{$_hint = $_locales["quantity_increase"]}
{/if}
{$_errors = []}
{if !empty($_is_product_disabled)}
{$_errors[] = $_locales["product_disabled"]}
{elseif !empty($_is_out_of_stock)}
{$_errors[] = "[`Out of stock`]"}
{elseif !empty($_is_more_than_limit)}
{$_errors[] = sprintf($_locales["quantity_stock_error"], $_item.stock_count)}
{/if}
{foreach $_errors as $_error}
{_renderError _text=$_error}
{/foreach}
*}
{if !empty($_config.change_sku) && $_item.product.sku_count > 1}
{/if}
{$_full_price = $_item.full_price}
{if !empty($_item.discount)}
{$_full_price = $_full_price - $_item.discount}
{/if}
{shop_currency($_full_price, ['in_currency' => true, 'format' => 'h'])}
{$_compare_price = null}
{if !empty($_item.discount)}
{$_compare_price = $_item.full_price}
{/if}
{if !empty($_compare_price)}
{shop_currency($_compare_price, ['in_currency' => true, 'format' => 'h'])}
{else}0{/if}
{*{if $_config.discount_item === shopCheckoutConfig::DISCOUNT_ITEM_TYPE_STRIKEOUT}*}
{if $_config.discount_item === shopCheckoutConfig::DISCOUNT_ITEM_TYPE_AMOUNT}
[`Discount`]
{if !empty($_item.discount)}
{shop_currency($_item.discount, ['in_currency' => true, 'format' => 'h'])}
{else}0{/if}
{/if}
{$_item.cart_custom_html}
{/if}
{$_.after_items}
{/if}{/foreach}
{* COUPONS *}
{if isset($coupon_code)}
{$_is_active = false}
{$_is_bad_code = false}
{if !empty($coupon_code)}
{if empty($coupon_discount) && empty($coupon_free_shipping)}
{$_is_bad_code = true}
{else}
{$_is_active = true}
{/if}
{/if}
{strip}
{/strip}
{/if}
{* AFFILIATE BONUS *}
{if !empty($affiliate)}
{$_is_active = false}
{if !empty($affiliate.use_affiliate)}{$_is_active = true}{/if}
[`Coupon applied`]
{if $_is_bad_code}
{_renderError _text=_w("Invalid coupon code")}
{/if}
{if $affiliate.affiliate_bonus > 0}
{strip}
{/strip}
{/if}
{if !empty($affiliate.add_affiliate_bonus)}
{/if}
{sprintf(
_w('You have %s bonus point! You can use it to get an additional discount of up to %s.', 'You have %s bonus points! You can use some of them to get an additional discount of up to %s.', $affiliate.affiliate_bonus, false),
"{$affiliate.affiliate_bonus}",
"{shop_currency_html($affiliate.affiliate_discount, true)}"
)}
[`Bonus used`]
{sprintf("[`This order will add +%s bonuses to your account, which you will be able to spend on getting additional discounts later.`]", $affiliate.add_affiliate_bonus)}
{/if}
{if $_config.discount_general === shopCheckoutConfig::DISCOUNT_GENERAL_TYPE_AMOUNT}
{*discount*}
{$_total_discount = $cart.discount}
{strip}
{$_show_weight = ( !empty($_config["show_weight"]) && !empty($cart.total_weight_html) && !empty($cart.count_html) )}
{elseif $_config.discount_general === shopCheckoutConfig::DISCOUNT_GENERAL_TYPE_SEPARATION}
{*subtotal*}
{/strip}
[`Subtotal`]
{shop_currency($cart.subtotal, [
'in_currency' => true,
'format' => 'h'
])}
{*
* discount without coupon and affiliate
*}
{$_partial_discount = $cart.discount}
{if !empty($coupon_discount)}
{$_partial_discount = $_partial_discount - $coupon_discount}
{/if}
{if !empty($affiliate.use_affiliate) && !empty($affiliate.affiliate_discount)}
{$_partial_discount = $_partial_discount - $affiliate.affiliate_discount}
{/if}
{*coupon*}
{*affiliate*}
{/if}
{*total*}
[`Total`]
{shop_currency($cart.total, [
'in_currency' => true,
'format' => 'h'
])}
{$_.bottom}
{/if}{/foreach}