Redirect Shopify customer to specific page after logout

By | April 25, 2018 | 2 Comments
Category: Shopify Tags: ,

By default, Shopify redirects the customers to home page after logout. If you want to redirect the customer to show a specific page, there is no built in way to do it. Here is a small script to achieve the same. Save this script at the end of Shopify Admin > Online Store > Themes > Edit Code > Assets > theme.js

This script will work for all the logout links that you may have on the page

$(document).ready( function() {
  $('a[href^="/account/logout"]').on("click", function() {
    $.ajax( $(this).attr('href') )
      .done(function() {
      	// Here you will change the url to whatever page you want to redirect to
      	window.location.href = "/pages/my-shopify-page";
      });
    return false;
  });
});

About Vishal Monpara

Vishal Monpara is a full stack Solution Developer/Architect with 13 years of experience primarily using Microsoft stack. He is currently working in Retail industry and moving 1's and 0's from geographically dispersed hard disks to geographically dispersed user leveraging geographically dispersed team members.

2 thoughts on “Redirect Shopify customer to specific page after logout



Leave a Reply

Your email address will not be published. Required fields are marked *