Giter Site home page Giter Site logo

hydrogen-redirect-theme's Introduction

Hydrogen Redirect Theme

Download

When launching a Hydrogen storefront, you’ll likely also want to redirect any traffic that happens to hit your Liquid store too. This theme allows you helps you do that while also making sure you retain features like the bot detection checkpoint, and discount links.

Setup

  1. Download the theme
  2. Navigate to Online Store -> Themes in your Shopify admin
  3. Upload the theme to your Theme Library
  4. Customize the Redirect theme
  5. Go to Theme settings -> Storefront and configure storefront_hostname
  6. Publish the theme

Custom redirects

You can configure the custom_redirects value in Theme settings > Storefront.

The redirect rule format is as following:

Shopify path > Storefront path

Each line in the textarea represents a single redirect rule.

Example configuration

The example below removes the /account prefix from the login, register and reset password redirects.

/account/login > /login
/account/register > /register
/account/reset > /reset-password
/account/activate > /activate-account

Customer accounts integration

You can integrate with customer accounts by enabling it in Theme settings > Integrate with customer accounts.

This will add query params to the redirect URL based on the situation:

  • logged_in=true: Present only if the customer has logged in. You can use this value to initiate a login that should be transparent to the customer.
  • company_location_id=<id>: Present only if your store is B2B-enabled, a B2B customer has logged in, and has selected a location. Your storefront should still confirm whether the customer has access to this location through the Customer Account API.

Gift cards

Since the Shopify Storefront API does not yet support fetching gift cards, a customizable gift_card.liquid template has been added.

Checkpoint template for Bot Protection

See: https://shopify.dev/docs/custom-storefronts/oxygen/migrate/redirect-traffic#enabling-bot-protection-for-flash-sales

Credit

This was based on a theme from Instant Commerce, which you can find here.

hydrogen-redirect-theme's People

Contributors

benjaminsehl avatar leeuwis avatar shopify[bot] avatar lancelafontaine avatar mathieulag avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.