    {include file="$template/includes/common/layouts-vars.tpl"}
    {if (
            !isset($skipMainBody) || !$skipMainBody
        ) && (
            !isset($isOnePageOrder) || !$isOnePageOrder
        ) && (
            $pageType != "website" || $activeDisplay != "CMS"
        ) || (
            $pageType == "website" && $activeDisplay == "CMS" && !$pageContent && $templatefile !="homepage" && !$skipMainBody
        )
    }
        {if !isset($inShoppingCart) || !$inShoppingCart}</div>{/if}
        {if (!isset($skipMainBodyContainer) || !$skipMainBodyContainer) && !$inShoppingCart}</div>{/if}
            </div>
        </div>
    {/if}

    {if file_exists("templates/$template/core/layouts/footer/{$RSThemes['footer-layouts'].name}/footer.tpl")}
        {include file="{$template}/core/layouts/footer/{$RSThemes['footer-layouts'].name}/footer.tpl"}
    {/if}

    {if isset($pageContent) && is_array($pageContent)}
        {$lastSection = $pageContent|@end}
        {if $lastSection['variables']['overlay']}
            {$hasOverlay = true}
        {elseif $lastSection['variables']['combined']}
            {$isCombined = true}
        {/if}
    {/if}
    {if !isset($skipMainFooter) || (isset($skipMainFooter) && !$skipMainFooter)}
        <div class="main-footer{if $RSThemes['footer-layouts']['vars']['type'] == 'extended'} main-footer-extended main-footer-extended-{$extendedFooterStyle} {/if}{if $RSThemes['footer-layouts']['vars']['footerClass']} {$RSThemes['footer-layouts']['vars']['footerClass']}{/if}{if $hasOverlay} has-overlay{elseif $isCombined} is-combined{/if}">
            {if $RSThemes['footer-layouts']['vars']['type'] == 'extended'}
            <div class="footer-top">
                <div class="container">
                    <div class="footer-brand d-flex flex-column">
                        <div class="footer-company">
                            <div class="footer-company-intro">
                                {include file="$template/includes/common/logo.tpl" customClass="footer-company-logo" ignoreMobileVersion="true" footerLogo=true}
                                {if is_array($RSThemes.addonSettings.footer_company_description_message)}
                                    {if empty($RSThemes.addonSettings.footer_company_description_message[$activeLocale.language])}
                                        {if isset($RSThemes.addonSettings.footer_company_description_message[\WHMCS\Config\Setting::getValue("Language")])}
                                            <p class="footer-company-desc">{$RSThemes.addonSettings.footer_company_description_message[\WHMCS\Config\Setting::getValue("Language")]|unescape:"html"}</p>
                                        {else}

                                        {/if}
                                        <p class="footer-company-desc">{$rslang->trans('footer_extended.footer_desc')}</p>
                                    {else}
                                        <p class="footer-company-desc">{$RSThemes.addonSettings.footer_company_description_message[$activeLocale.language]|unescape:"html"}</p>
                                    {/if}
                                {else}
                                    <p class="footer-company-desc">{$rslang->trans('footer_extended.footer_desc')}</p>
                                {/if}
                            </div>
                            {include file="$template/includes/footer/footersocial.tpl"}
                        </div>
                        {if $RSThemes.addonSettings.show_footer_supported_payment_gateways == "displayed" && $RSThemes.addonSettings.footer_supported_payment_gateways_location == "default" }
                            <div class="footer-payment">
                                {if empty($RSThemes.addonSettings.footer_supported_payment_gateways_message[$activeLocale.language])}
                                    {if isset($RSThemes.addonSettings.footer_supported_payment_gateways_message[\WHMCS\Config\Setting::getValue("Language")])}
                                        <p class="footer-payment-header mb-0">{$RSThemes.addonSettings.footer_supported_payment_gateways_message[\WHMCS\Config\Setting::getValue("Language")]|unescape:"html"}</p>
                                    {else}

                                    {/if}
                                {else}
                                    <p class="footer-payment-header mb-0">{$RSThemes.addonSettings.footer_supported_payment_gateways_message[$activeLocale.language]}</p>
                                {/if}
                                {if is_array($RSThemes.addonSettings.footer_supported_payment_gateways_icons) && !empty($RSThemes.addonSettings.footer_supported_payment_gateways_icons)}
                                    <div class="footer-payment-gateway">
                                        {foreach from=$RSThemes.addonSettings.footer_supported_payment_gateways_icons  item=$paymentIcon}
                                            {$iconTooltip = false}
                                            {if isset($paymentIcon.nameTranslations[$language]) && $paymentIcon.nameTranslations[$language] != ""}
                                                {$iconTooltip = $paymentIcon.nameTranslations[$language]}
                                            {elseif isset($paymentIcon.name) && $paymentIcon.name != ""}
                                                {$iconTooltip = $paymentIcon.name}
                                            {/if}
                                            {if $paymentIcon.iconType == "gateways"}
                                            <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body" {/if}>
                                                {include file="$template/assets/svg-gateways/{$paymentIcon.iconName}"}
                                                </i>
                                            {else if $paymentIcon.iconType == "media"}
                                                <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body" {/if}>
                                                    <img src="{$WEB_ROOT}/templates/{$template}/assets/img/page-manager/{$paymentIcon.iconName}" role="presentation">
                                               </i>
                                            {/if}
                                        {/foreach}
                                    </div>
                                {/if}
                            </div>
                        {/if}
                    </div>
                    {include file="$template/includes/footer/footerprimary.tpl"}
                </div>
            </div>
            {/if}
            <div class="footer-bottom">
                <div class="container">
                    <div class="footer-copyright">{lang key="copyrightFooterNotice" year=$date_year company=$companyname}</div>
                    {if $RSThemes.addonSettings.show_footer_supported_payment_gateways == "displayed"  && is_array($RSThemes.addonSettings.footer_supported_payment_gateways_icons) && !empty($RSThemes.addonSettings.footer_supported_payment_gateways_icons)}
                        {if $RSThemes['footer-layouts']['vars']['type'] != 'extended' || ($RSThemes['footer-layouts']['vars']['type'] == 'extended') && $RSThemes.addonSettings.footer_supported_payment_gateways_location == "bottom" }
                            <div class="footer-payment-gateway">
                                {foreach from=$RSThemes.addonSettings.footer_supported_payment_gateways_icons  item=$paymentIcon}
                                    {$iconTooltip = false}
                                    {if isset($paymentIcon.nameTranslations[$language]) && $paymentIcon.nameTranslations[$language] != ""}
                                        {$iconTooltip = $paymentIcon.nameTranslations[$language]}
                                    {elseif isset($paymentIcon.name) && $paymentIcon.name != ""}
                                        {$iconTooltip = $paymentIcon.name}
                                    {/if}
                                    {if $paymentIcon.iconType == "gateways"}
                                        <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body"{/if}>
                                            {include file="$template/assets/svg-gateways/{$paymentIcon.iconName}"}
                                        </i>
                                    {else if $paymentIcon.iconType == "media"}
                                        <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body"{/if}>
                                            <img src="{$WEB_ROOT}/templates/{$template}/assets/img/page-manager/{$paymentIcon.iconName}" role="presentation">
                                        </i>
                                    {/if}
                                {/foreach}
                            </div>
                        {/if}
                    {/if}
                    {include file="$template/includes/footer/footersecondary.tpl"}
                </div>
            </div>
        </div>
    {/if}
</div> {* close app main *}
    {if $RSThemes.addonSettings.show_cookie_box == 'displayed'}
        <div class="cookie-bar cookie-bar--{$RSThemes.addonSettings.cookie_box_position} {if $RSThemes.addonSettings.cookie_box_position == 'bottom'}container{/if}" data-cookie data-cookie-name="cookie_bar" data-cookie-exp-time="365" data-delay="2000">
            <div class="cookie-bar__content">
                <div class="cookie-bar__icon">
                    {include file="$template/includes/common/svg-icon.tpl" icon="cookie_bites"}
                </div>
                <div class="cookie-bar__desc">
                    {if empty($RSThemes.addonSettings.cookie_box_message[$activeLocale.language])}
                        {if isset($RSThemes.addonSettings.cookie_box_message[\WHMCS\Config\Setting::getValue("Language")])}
                            {$RSThemes.addonSettings.cookie_box_message[\WHMCS\Config\Setting::getValue("Language")]|unescape:"html"}
                        {else}

                        {/if}
                    {else}
                        {$RSThemes.addonSettings.cookie_box_message[$activeLocale.language]|unescape:"html"}
                    {/if}
                </div>
                <div class="cookie-bar__action">
                    <button tabindex="0" class="btn btn-primary" data-close>{$LANG.continue}</button>
                </div>
            </div>
        </div>
    {/if}
    <div id="fullpage-overlay" class="hidden">
        <div class="outer-wrapper">
            <div class="inner-wrapper">
                <img class="lazyload" data-src="{$WEB_ROOT}/assets/img/overlay-spinner.svg">
                <br>
                <span class="msg"></span>
            </div>
        </div>
    </div>
    <div class="modal system-modal fade" id="modalAjax" tabindex="-1" role="dialog" aria-hidden="true" style="display: none">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button tabindex="0" type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="lm lm-close"></i></button>
                    <h5 class="modal-title"></h5>
                </div>
                <div class="modal-body">
                    <div class="loader">
                        {include file="$template/includes/common/loader.tpl"}
                    </div>
                </div>
                <div class="modal-footer">
                    <button tabindex="0" type="button" class="btn btn-primary modal-submit">
                        {$LANG.submit}
                    </button>
                    <button tabindex="0" type="button" class="btn btn-default" data-dismiss="modal">
                    {$LANG.close}
                    </button>
                </div>
            </div>
        </div>
    </div>

    {if isset($lagomClientAlerts) && $lagomClientAlerts->footer}
        {$lagomClientAlerts->footer}
    {/if}
    {include file="$template/includes/generate-password.tpl"}
    {$footeroutput}
    <div class="overlay"></div>
    <script {if isset($activeDisplay) && $activeDisplay == 'CMS' && $pageType == "website" && isset($RSThemes['pageSettings'])}defer{/if} src="{$WEB_ROOT}/templates/{$template}/assets/js/vendor.js?v={$RSThemes['templateVersion']}-{$assetsCacheKey}"></script>
    <script {if isset($activeDisplay) && $activeDisplay == 'CMS' && $pageType == "website" && isset($RSThemes['pageSettings'])}defer{/if} src="{$WEB_ROOT}/templates/{$template}/assets/js/lagom-app.js?v={$RSThemes['templateVersion']}-{$assetsCacheKey}"></script>
    {if isset($activeDisplay) && $activeDisplay == 'CMS' && $pageType == "website" && isset($RSThemes['pageSettings'])}
    {else}
        <script src="{$WEB_ROOT}/templates/{$template}/assets/js/whmcs-custom.min.js?v={$RSThemes['templateVersion']}-{$assetsCacheKey}"></script>
    {/if}
</body>
</html>