{if file_exists("templates/orderforms/lagom2/overwrites/ordersummary.tpl")}
    {include file="templates/orderforms/lagom2/overwrites/ordersummary.tpl"}
{else}
    {assign var="currSuffix" value=""}
    {if isset($currency.suffix)}
        {assign var="currSuffix" value=$currency.suffix}
    {/if}
    {assign var="currPrefix" value=""}
    {if isset($currency.prefix)}
        {assign var="currPrefix" value=$currency.prefix}
    {/if}
    {if $producttotals}
        <div class="panel-body">
            <div class="summary-content content" tabindex="0" aria-label="{$LANG.ordersummary}">
                <div class="summary-item">
                    <span class="graphic-item graphic-item-sm" data-product-main-graphic></span>
                    <span class="item-name">
                        <span class="name">
                                <span data-toggle="tooltip" data-original-title="{$producttotals.productinfo.groupname} - {$producttotals.productinfo.name}" data-placement="bottom"><div class="pg-name d-inline">{$producttotals.productinfo.groupname} - </div>{$producttotals.productinfo.name}</span>
                                {if $producttotals.allowqty && $producttotals.qty > 1}
                                    <div class="qty-number-container">
                                        <div class="qty-number">{$producttotals.qty}x</div>
                                    </div>
                                {/if}
                        </span>
                        <span class="subname">{$producttotals.domain}</span>
                    </span>
                    <span class="item-value">
                        {if $dc_product_price}
                            <span class="text-faded line-through">{$dc_product_price}</span> 
                            {if $dc_product_discount_price|replace:$currSuffix:""|replace:$currPrefix:"" == "0,00" || $dc_product_discount_price|replace:$currSuffix:""|replace:$currPrefix:"" == "0.00"}
                                <span class="item-value-free">{$LANG.orderfree}</span>
                            {/if}
                            <span>{$dc_product_discount_price}</span>
                        {else}
                            {if $producttotals.pricing.baseprice|replace:$currSuffix:""|replace:$currPrefix:"" == "0,00" || $producttotals.pricing.baseprice|replace:$currSuffix:""|replace:$currPrefix:"" == "0.00"}
                                <span class="item-value-free">{$LANG.orderfree}</span>
                            {/if}
                            <span class="item-value-price">
                                <span class="text-nowrap">
                                {$producttotals.pricing.totalTodayExcludingTaxSetup|replace:$currSuffix:""} {$currSuffix}{if $producttotals.billingcycle != "free" && $producttotals.billingcycle != "onetime"}/{/if}{if $producttotals.billingcycle == "monthly"}{$LANG.pricingCycleShort.monthly}{elseif $producttotals.billingcycle == "quarterly"}{$LANG.pricingCycleShort.quarterly}{elseif $producttotals.billingcycle == "semiannually"}{$LANG.pricingCycleShort.semiannually}{elseif $producttotals.billingcycle == "annually"}{$LANG.pricingCycleShort.annually}{elseif $producttotals.billingcycle == "biennially"}{$LANG.pricingCycleShort.biennially}{elseif $producttotals.billingcycle == "triennially"}{$LANG.pricingCycleShort.triennially}{/if}
                                </span>
                                {if $producttotals.pricing.productonlysetup}
                                    <span class="setup-fee">+ {$producttotals.pricing.productonlysetup} {$currSuffix} {$LANG.ordersetupfee}</span>
                                {/if}
                            </span>
                        {/if}
                    </span>
                </div> 
                {if $producttotals.configoptions}
                    <ul class="summary-list summary-list-configoptions hoverable">
                        {foreach $producttotals.configoptions as $configoption}
                            {if $configoption}
                                <li class="list-item">
                                    <span class="item-name">{$configoption.name}: <span class="item-optionname">{$configoption.optionname}</span></span>
                                    <span class="item-value">{if $configoption.recurring|replace:$currPrefix:""|replace:$currSuffix:"" != ""}
                                        {if $configoption.recurring|replace:$currSuffix:""|replace:$currPrefix:"" == "0,00" || $configoption.recurring|replace:$currSuffix:""|replace:$currPrefix:"" == "0.00"}
                                            <span class="item-value-free">{$LANG.orderfree}</span>
                                        {/if}
                                        <span>{$configoption.recurring|replace:$currSuffix:""} {$currSuffix}{else}-{/if}</span>
                                        <span>{if $configoption.setup} + {$configoption.setup|replace:$currSuffix:""} {$currSuffix} {$LANG.ordersetupfee}{/if}</span>
                                    </span>
                                </li>
                            {/if}
                        {/foreach}
                    </ul>
                {/if} 
                {if $producttotals.addons}
                    {foreach $producttotals.addons as $addon}
                        <div class="summary-item summary-item-addon">
                            <span class="graphic-item graphic-item-sm" data-addon-main-graphic="{$addon.addonid}"></span>
                            <span class="item-name">
                                <span class="name">
                                    <span data-toggle="tooltip" data-original-title="{$addon.name}" data-placement="bottom">{$addon.name}</span>
                                    {if $producttotals.allowqty === 1 && $addon.qty > 1}
                                        <div class="qty-number-container">
                                            <div class="qty-number">{$producttotals.qty}x</div>
                                        </div>
                                    {/if}
                                </span>
                            </span>
                            <span class="item-value">
                                {if $dc_addon_prices[$addon.name] && $dc_addon_prices[$addon.name] != $addon.recurring}
                                    <span class="text-faded line-through">{$dc_addon_prices[$addon.name]}</span>
                                {/if} 
                                {if $addon.recurring|replace:$currSuffix:""|replace:$currPrefix:"" == "0,00" || $addon.recurring|replace:$currSuffix:""|replace:$currPrefix:"" == "0.00"}
                                    <span class="item-value-free">{$LANG.orderfree}</span>
                                {/if}
                                <span class="item-value-price">
                                    <span>{$addon.recurring|replace:$currSuffix:""} {$currSuffix}{if $addon.billingcycle != "free" && $addon.billingcycle != "onetime"}/{/if}{if $addon.billingcycle == "monthly"}{$LANG.pricingCycleShort.monthly}{elseif $addon.billingcycle == "quarterly"}{$LANG.pricingCycleShort.quarterly}{elseif $addon.billingcycle == "semiannually"}{$LANG.pricingCycleShort.semiannually}{elseif $addon.billingcycle == "annually"}{$LANG.pricingCycleShort.annually}{elseif $addon.billingcycle == "biennially"}{$LANG.pricingCycleShort.biennially}{elseif $addon.billingcycle == "triennially"}{$LANG.pricingCycleShort.triennially}{/if}</span>
                                    {if $addon.setup} <span class="setup-fee">+ {$addon.setup|replace:$currSuffix:""} {$currSuffix} {$LANG.ordersetupfee}</span>{/if}
                                </span>
                            </span>
                        </div>
                    {/foreach}
                {/if}
            </div>
        </div>
        <div class="panel-footer">
            {if $loggedin && ($producttotals.pricing.tax1 || $producttotals.pricing.tax2)}
                {if $producttotals.pricing.tax1}
                    <div class="summary-item summary-item-tax">
                        <span class="item-name">
                            <span class="name">{if isset($carttotals.taxname)}{$carttotals.taxname}{/if} @ {if isset($carttotals.taxrate)}{$carttotals.taxrate}{/if}%</span>
                        </span>
                        <span class="item-value text-right">{$producttotals.pricing.tax1|replace:$currSuffix:""} {$currSuffix}</span>
                    </div>
                {/if}
                {if $producttotals.pricing.tax2}
                    <div class="summary-item summary-item-tax summary-item-tax2">
                        <span class="item-name">
                            <span class="name">{if isset($carttotals.taxname2)}{$carttotals.taxname2}{/if} @ {if isset($carttotals.taxrate2)}{$carttotals.taxrate2}{/if}%</span>
                        </span>
                        <span class="item-value text-right">{$producttotals.pricing.tax2|replace:$currSuffix:""} {$currSuffix}</span>
                    </div>
                {/if}
            {/if}
            <div class="price price-left-h">
                <span class="price-total" data-total-text="{if $loggedin && ($producttotals.pricing.tax1 || $producttotals.pricing.tax2) }incVat{elseif !$loggedin && ($producttotals.pricing.tax1 || $producttotals.pricing.tax2) }exVat{/if}">{$LANG.ordertotalduetoday}</span> 
                <div class="price-amount price-amount-total amt">
                    {if $loggedin && ($producttotals.pricing.tax1 || $producttotals.pricing.tax2)}
                        {$producttotals.pricing.totaltoday|replace:$currSuffix:""} {$currSuffix}
                    {else}
                        {$producttotals.pricing.totaltodayexcltax|replace:$currSuffix:""} {$currSuffix}
                    {/if}
                </div>
            </div>
            <div class="summary-actions">
                <button tabindex="0" class="btn btn-lg btn-primary{if $summaryStyle == "primary"}-faded{/if} btn-checkout" type="submit" id="btnCompleteProductConfig">
                    <span><i class="ls ls-share m-r-0" aria-hidden="true"></i>{$LANG.continue}</span>
                    <div class="loader loader-button hidden">{include file="$template/includes/common/loader.tpl" classes="spinner-sm"} </div>
                </button>
            </div>
        </div>
    {elseif !empty($renewals) || !empty($serviceRenewals)}
        <div class="panel-body">
            <div class="summary-content">
                {if !empty($serviceRenewals)}
                    {if !empty($carttotals.renewalsByType.services)}
                        {foreach $carttotals.renewalsByType.services as $serviceId => $serviceRenewal}
                            <ul class="summary-list">
                                <li class="list-item list-item-main list-item-services" id="cartServiceRenewal{$serviceId}">
                                    <span class="item-name">
                                        {$serviceRenewal.name}
                                    </span>
                                    <span class="item-actions">
                                        <a tabindex="0" onclick="removeItem('r','{$serviceId}','service');" aria-label="Remove" data-toggle="tooltip" title="Remove"  data-placement="top" data-trigger="manual">
                                            <i class="ls ls-trash"></i>
                                        </a>
                                    </span>
                                </li>
                                <li class="list-item list-item-domain">
                                    <span class="item-domain text-small">
                                        {$serviceRenewal.domainName}
                                    </span>
                                </li>
                                <li class="list-item faded">
                                    <span class="item-name">{$serviceRenewal.recurringBeforeTax}</span>
                                    <span class="item-cycle">{$serviceRenewal.billingCycle}</span>
                                </li>
                            </ul>
                        {/foreach}
                    {/if}
                    {if !empty($carttotals.renewalsByType.addons)}
                        {foreach $carttotals.renewalsByType.addons as $serviceAddonId => $serviceAddonRenewal}
                            <ul class="summary-list">
                                <li class="list-item list-item-main list-item-services" id="cartServiceAddonRenewal{$serviceAddonId}">
                                    <span class="item-name">
                                        {$serviceAddonRenewal.name}
                                    </span>
                                    <span class="item-actions">
                                        <a tabindex="0" onclick="removeItem('r','{$serviceAddonId}','addon');" aria-label="Remove" data-toggle="tooltip" title="Remove"  data-placement="top" data-trigger="manual"> 
                                            <i class="ls ls-trash"></i>
                                        </a>
                                    </span>
                                </li>
                                <li class="list-item list-item-domain">
                                    <span class="item-domain text-small">
                                        {$serviceAddonRenewal.domainName}
                                    </span>
                                </li>
                                <li class="list-item faded">
                                    <span class="item-name">{$serviceAddonRenewal.recurringBeforeTax}</span>
                                    <span class="item-cycle">{$serviceAddonRenewal.billingCycle}</span>
                                </li>
                            </ul>
                        {/foreach}
                    {/if}
                {elseif !empty($renewals) && !empty($carttotals.renewalsByType.domains)}
                    {foreach $carttotals.renewalsByType.domains as $domainId => $renewal}
                        <ul class="summary-list">
                            <li class="list-item list-item-main" id="cartDomainRenewal{$domainId}">
                                <span class="item-name">
                                    {$renewal.domain} - {$renewal.regperiod} {if $renewal.regperiod == 1}{lang key='orderForm.year'}{else}{lang key='orderForm.years'}{/if}
                                </span>
                                <span class="item-value">
                                    {$renewal.priceBeforeTax}
                                </span>
                                <span class="item-actions">
                                    <a tabindex="0" aria-label="Remove" data-toggle="tooltip" title="Remove"  data-placement="top" data-trigger="manual" onclick="removeItem('r','{$domainId}','domain'); return false;" href="#" id="linkCartRemoveDomainRenewal{$domainId}">
                                        <i class="ls ls-trash"></i>
                                    </a>
                                </span>
                            </li>
                            {if $renewal.dnsmanagement}
                                <li class="list-item faded">
                                    <span class="item-name">{lang key='domaindnsmanagement'}</span>
                                </li>
                            {/if}
                            {if $renewal.emailforwarding}
                                <li class="list-item faded">
                                    <span class="item-name">{lang key='domainemailforwarding'}</span>
                                </li>
                            {/if}
                            {if $renewal.idprotection}
                                <li class="list-item faded">
                                    <span class="item-name">{lang key='domainidprotection'}</span>
                                </li>
                            {/if}
                            {if $renewal.hasGracePeriodFee}
                                <li class="list-item faded">
                                    <span class="item-name">{lang key='domainRenewal.graceFee'}</span>
                                </li>
                            {/if}
                            {if $renewal.hasRedemptionGracePeriodFee}
                                <li class="list-item faded">
                                    <span class="item-name">{lang key='domainRenewal.redemptionFee'}</span>
                                </li>
                            {/if}
                        </ul>
                    {/foreach}
                {/if}
                <ul class="summary-list">
                        <li class="list-item">
                        <span class="item-name">{lang key='ordersubtotal'}</span>
                        <span class="item-value">{if isset($carttotals.subtotal)}{$carttotals.subtotal}{/if}</span>
                    </li>
                </ul>
                {if (isset($carttotals.taxrate) && $carttotals.taxrate && isset($carttotals.taxtotal) && $carttotals.taxtotal) || (isset($carttotals.taxrate2) && $carttotals.taxrate2 && isset($carttotals.taxtotal2) && $carttotals.taxtotal2)}
                <ul class="summary-list faded">
                    {if isset($carttotals.taxrate) && $carttotals.taxrate}
                        <li class="list-item">
                            <span class="item-name">{if isset($carttotals.taxname)}{$carttotals.taxname}{/if} @ {if isset($carttotals.taxrate)}{$carttotals.taxrate}{/if}%</span>
                            <span class="item-value">{if isset($carttotals.taxtotal)}{$carttotals.taxtotal}{/if}</span>
                        </li>
                    {/if}
                    {if isset($carttotals.taxrate2) && $carttotals.taxrate2}
                        <li class="list-item">
                            <span class="item-name">{if isset($carttotals.taxname2)}{$carttotals.taxname2}{/if} @ {if isset($carttotals.taxrate2)}{$carttotals.taxrate2}{/if}%</span>
                            <span class="item-value">{if isset($carttotals.taxtotal2)}{$carttotals.taxtotal2}{/if}</span>
                        </li>
                    {/if}
                </ul>
                {/if}
            </div>
        </div>
        <div class="panel-footer">
            <div class="price price-left-h">
                <span class="price-total">{$LANG.ordertotalduetoday}</span> 
                <div class="price-amount amt">{if isset($carttotals.total)}{$carttotals.total|replace:$currSuffix:""} {$currSuffix}{/if}</div>
            </div>
            <div class="summary-actions">
                <a tabindex="0" href="{$WEB_ROOT}/cart.php?a=view" class="btn btn-lg btn-primary{if $summaryStyle == "primary"}-faded{/if} btn-checkout" id="checkout">  
                    <span><i class="ls ls-share"></i> {$LANG.orderForm.checkout}</span>
                    <div class="loader loader-button hidden">{include file="$template/includes/common/loader.tpl" classes="spinner-sm"} </div>
                </a>
            </div>
        </div>
    {/if}
{/if}