How to force “Grid View” as default on the ERPNext Webshop “All Products” page?

Page still boots in “List” mode whenever I clear cookies or first visit
I’d like it to always start in “Grid” unless the user explicitly switches

Please apply the Website Script.

if (location.pathname === "/all-products") {
    localStorage.setItem("product_view", "Grid View");
}

Then reload and check.

1 Like