Ecommerce Shopify WordPress Discussion

How to setup hreflang tags based on the main URL of the page on Shopify?

I want to add hreflang tags based on the main URL of the page on Shopify. However, when I'm trying to set this up on Shopify, my site's German version URLs are becoming the default for all versions in the hreflang tags. I also want to include the English version in the hreflang tags. I have achieved this dynamically using the canonical variable in the theme.liquid file, but I want the hreflang tags to be based on the main URL loaded on the page. How can I set this up properly? This code I have written in the theme.liquid file: <link rel="alternate" hreflang="en" href="{{ canonical_url | replace: '.com', '.com/en'}}"> <link rel="alternate" href="{{ canonical_url | replace: '.com', '.com/en'}}" hreflang="x-default" /> <link rel="alternate" hreflang="de" href="{{ canonical_url }}"> <link rel="alternate" hreflang="de-ch" href="{{ canonical_url | replace: '.com', '.com/de-us'}}"> <link rel="alternate" hreflang="en-ch" href="{{ canonical_url | replace: '.com', '.com/en-ch'}}"> <link rel="alternate" hreflang="de-gb" href="{{ canonical_url | replace: '.com', '.com/de-gb'}}"> <link rel="alternate" hreflang="en-gb" href="{{ canonical_url | replace: '.com', '.com/en-gb'}}"> <link rel="alternate" hreflang="de-us" href="{{ canonical_url | replace: '.com', '.com/de-us'}}"> <link rel="alternate" hreflang="en-us" href="{{ canonical_url | replace: '.com', '.com/en-us'}}"> English version of the site Translated with the Shopify Weglot app. I can't understand why it's happening. Here are two versions of my site:
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.