1

In Magento 2, when a user logs out of their account, they are redirected to customer/account/logoutsuccess page, which then redirects to the homepage after 5 seconds.

How can I temporarily disable this redirect so that I can theme it with custom CSS?

0
1

Copy this file in your theme

From

vendor/magento/module-customer/view/frontend/templates/logout.phtml

To

app/design/frontend/Vendor/theme/Magento_Customer/templates/logout.phtml

Now just comment this line

// $($.mage.redirect("<?php /* @escapeNotVerified */ echo $block->getUrl() ?>", "assign", 5000));
0

By Default page will redirect after 5 second, 5 second setting are coming from logout.phtml file.

Just change value at below line

$($.mage.redirect("<?php /* @escapeNotVerified */ echo $block->getUrl() ?>", "assign", 5000));

To,

$($.mage.redirect("<?php /* @escapeNotVerified */ echo $block->getUrl() ?>", "assign", 36000));

Now page will redirect after 10 Hour. You can change value according your need and after your work is completed you can set 5000 in above file.

Core file is,

vendor/magento/module-customer/view/frontend/templates/logout.phtml
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.