Example #1
0
function fn_twg_api_get_cart_promotion_input_field()
{
    $input_field = 'N';
    if (fn_display_promotion_input_field($_SESSION['cart'])) {
        $input_field = Registry::get('addons.gift_certificates.status') == 'A' ? 'G' : 'P';
    }
    return $input_field;
}
    function content_55d2f36398ead9_71552174($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('promo_code', 'promo_code', 'apply', 'coupon', 'promo_code', 'promo_code', 'apply', 'coupon'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            if (fn_display_promotion_input_field($_smarty_tpl->tpl_vars['cart']->value)) {
                ?>
<div>
    <form class="cm-ajax cm-ajax-force cm-ajax-full-render" name="coupon_code_form<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['position']->value, ENT_QUOTES, 'UTF-8');
                ?>
" action="<?php 
                echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                ?>
" method="post">
        <input type="hidden" name="result_ids" value="checkout*,cart_status*,cart_items,payment-methods" />
        <input type="hidden" name="redirect_url" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['config']->value['current_url'], ENT_QUOTES, 'UTF-8');
                ?>
" />

        <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:discount_coupons"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "checkout:discount_coupons"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <div class="ty-discount-coupon__control-group ty-input-append">
                <label for="coupon_field<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['position']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="hidden cm-required"><?php 
                    echo $_smarty_tpl->__("promo_code");
                    ?>
</label>
                <input type="text" class="ty-input-text cm-hint" id="coupon_field<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['position']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" name="coupon_code" size="40" value="<?php 
                    echo $_smarty_tpl->__("promo_code");
                    ?>
" />
                <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/go.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "checkout.apply_coupon", 'alt' => __("apply")), 0);
                    ?>

            </div>
        <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "checkout:discount_coupons"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

    </form>
</div>
<?php 
            }
            ?>

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:applied_discount_coupons"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "checkout:applied_discount_coupons"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("promotion_info", null, null);
                ob_start();
                ?>
        <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:applied_coupons_items"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "checkout:applied_coupons_items"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    $_smarty_tpl->tpl_vars["coupon"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["coupon"]->_loop = false;
                    $_smarty_tpl->tpl_vars["coupon_code"] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['cart']->value['coupons'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["coupon"]->key => $_smarty_tpl->tpl_vars["coupon"]->value) {
                        $_smarty_tpl->tpl_vars["coupon"]->_loop = true;
                        $_smarty_tpl->tpl_vars["coupon_code"]->value = $_smarty_tpl->tpl_vars["coupon"]->key;
                        ?>
            <li class="ty-coupons__item">
                <?php 
                        echo $_smarty_tpl->__("coupon");
                        ?>
 "<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['coupon_code']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"
                <?php 
                        $_smarty_tpl->tpl_vars["_redirect_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["coupon_code"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['coupon_code']->value), null, 0);
                        ?>
                <?php 
                        echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "checkout.delete_coupon?coupon_code=" . (string) $_smarty_tpl->tpl_vars['coupon_code']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['_redirect_url']->value, 'but_role' => "delete", 'but_meta' => "ty-coupons__item-delete cm-ajax cm-ajax-full-render", 'but_target_id' => "checkout*,cart_status*,cart_items"), 0);
                        ?>

            </li>
            <?php 
                    }
                    ?>
            
        <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "checkout:applied_coupons_items"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

    <?php 
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                ?>

    <?php 
                if (trim(Smarty::$_smarty_vars['capture']['promotion_info'])) {
                    ?>
        <ul class="ty-coupons__list ty-discount-info">
            <li class="ty-caret-info"><span class="ty-caret-outer"></span><span class="ty-caret-inner"></span></li>
            <?php 
                    echo Smarty::$_smarty_vars['capture']['promotion_info'];
                    ?>

        </ul>
    <?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "checkout:applied_discount_coupons"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="views/checkout/components/promotion_coupon.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "views/checkout/components/promotion_coupon.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            if (fn_display_promotion_input_field($_smarty_tpl->tpl_vars['cart']->value)) {
                ?>
<div>
    <form class="cm-ajax cm-ajax-force cm-ajax-full-render" name="coupon_code_form<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['position']->value, ENT_QUOTES, 'UTF-8');
                ?>
" action="<?php 
                echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                ?>
" method="post">
        <input type="hidden" name="result_ids" value="checkout*,cart_status*,cart_items,payment-methods" />
        <input type="hidden" name="redirect_url" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['config']->value['current_url'], ENT_QUOTES, 'UTF-8');
                ?>
" />

        <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:discount_coupons"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "checkout:discount_coupons"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <div class="ty-discount-coupon__control-group ty-input-append">
                <label for="coupon_field<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['position']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="hidden cm-required"><?php 
                    echo $_smarty_tpl->__("promo_code");
                    ?>
</label>
                <input type="text" class="ty-input-text cm-hint" id="coupon_field<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['position']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" name="coupon_code" size="40" value="<?php 
                    echo $_smarty_tpl->__("promo_code");
                    ?>
" />
                <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/go.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "checkout.apply_coupon", 'alt' => __("apply")), 0);
                    ?>

            </div>
        <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "checkout:discount_coupons"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

    </form>
</div>
<?php 
            }
            ?>

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:applied_discount_coupons"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "checkout:applied_discount_coupons"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("promotion_info", null, null);
                ob_start();
                ?>
        <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:applied_coupons_items"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "checkout:applied_coupons_items"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    $_smarty_tpl->tpl_vars["coupon"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["coupon"]->_loop = false;
                    $_smarty_tpl->tpl_vars["coupon_code"] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['cart']->value['coupons'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["coupon"]->key => $_smarty_tpl->tpl_vars["coupon"]->value) {
                        $_smarty_tpl->tpl_vars["coupon"]->_loop = true;
                        $_smarty_tpl->tpl_vars["coupon_code"]->value = $_smarty_tpl->tpl_vars["coupon"]->key;
                        ?>
            <li class="ty-coupons__item">
                <?php 
                        echo $_smarty_tpl->__("coupon");
                        ?>
 "<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['coupon_code']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"
                <?php 
                        $_smarty_tpl->tpl_vars["_redirect_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["coupon_code"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['coupon_code']->value), null, 0);
                        ?>
                <?php 
                        echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "checkout.delete_coupon?coupon_code=" . (string) $_smarty_tpl->tpl_vars['coupon_code']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['_redirect_url']->value, 'but_role' => "delete", 'but_meta' => "ty-coupons__item-delete cm-ajax cm-ajax-full-render", 'but_target_id' => "checkout*,cart_status*,cart_items"), 0);
                        ?>

            </li>
            <?php 
                    }
                    ?>
            
        <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "checkout:applied_coupons_items"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

    <?php 
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                ?>

    <?php 
                if (trim(Smarty::$_smarty_vars['capture']['promotion_info'])) {
                    ?>
        <ul class="ty-coupons__list ty-discount-info">
            <li class="ty-caret-info"><span class="ty-caret-outer"></span><span class="ty-caret-inner"></span></li>
            <?php 
                    echo Smarty::$_smarty_vars['capture']['promotion_info'];
                    ?>

        </ul>
    <?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "checkout:applied_discount_coupons"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
    }