A
A
ayapergenov2016-01-14 13:49:13
1C-Bitrix
ayapergenov, 2016-01-14 13:49:13

How to make a redirect to the catalog page after user authorization?

It is necessary that after authorization on the site, the user automatically gets to the catalog page with the address /katalog.php
The authorization code is located in the header and has the following code:

<div class="pull-right">
                            <?
                            if($USER->IsAuthorized()) {
                            $APPLICATION->IncludeComponent(
    "bitrix:sale.basket.basket.line",
    "basket_link_t54",
    array(
        "PATH_TO_BASKET" => SITE_DIR."personal/cart/",
        "SHOW_NUM_PRODUCTS" => "Y",
        "SHOW_TOTAL_PRICE" => "Y",
        "SHOW_EMPTY_VALUES" => "Y",
        "SHOW_PERSONAL_LINK" => "N",
        "PATH_TO_PERSONAL" => SITE_DIR."personal/",
        "SHOW_AUTHOR" => "N",
        "PATH_TO_REGISTER" => SITE_DIR."login/",
        "PATH_TO_PROFILE" => SITE_DIR."personal/",
        "SHOW_PRODUCTS" => "N",
        "POSITION_FIXED" => "N"
    ),
    false
);}?>
            <?
            if(!$USER->IsAuthorized()) {
            $APPLICATION->IncludeComponent("bitrix:system.auth.form", "login_t54", Array(
            "REGISTER_URL" => SITE_DIR."login/",    // Страница регистрации
                "FORGOT_PASSWORD_URL" => "",    // Страница забытого пароля
                "PROFILE_URL" => SITE_DIR."personal/",  // Страница профиля
                "SHOW_ERRORS" => "N",   // Показывать ошибки
            ),
            false
        );
        }
        ?>
                    </div>
                </div>
            </div>
        </div>
    </div>

</header>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Neverov, 2016-01-14
@ayapergenov

In init.php put the following code:

AddEventHandler("main", "OnAfterUserAuthorize", 'openCatalogAfterAuth');
function openCatalogAfterAuth($arUser) {
     LocalRedirect('/katalog.php');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question