How to link shop logo to external url?

Solved
jenniferwlwong
New Member
3 0 0

I found some other threads responding to this question however the advice did not work for me. Whenever I go into liquid.header and replace href="{{ routes.root_url }}" with href="{new URL}"  (both times it appears in code) it doesn't redirect to my url.

I'm trying to get my store https://launcherspaceshop.myshopify.com/ to redirect to launcherspace.com, but when I do the above change in code, it redirects to:

https://launcherspaceshop.myshopify.com/collections/%7Blauncherspace.com%7D

Not sure why it reads as a collection within the shop? Any advice would be much appreciated. Thanks!

Accepted Solution (1)

Accepted Solutions
LitExtension
Shopify Partner
1935 317 391

This is an accepted solution.

Please change {{ routes.root_url }} => https://launcherspace.com/ Ex: https://i.imgur.com/cpYvcZE.png

It will work fine.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!

View solution in original post

Replies 6 (6)
AvidBrio
Shopify Expert
231 12 18

@jenniferwlwong   can you please provide the code snippets here so I can help you 

If you find our comment helpful, hit the like button and accept it as a solution.
Want us to implement custom changes in your store? Contact us
Email me directly - jim@avidbrio.com
IttantaTech
Shopify Partner
510 55 92

Hello , @jenniferwlwong 

 

Just put below code in theme.liquid file below <head>

<script type="text/javascript">
var thecookie = readCookie('doRedirect');
if(!thecookie) {
createCookie('doRedirect','true','1');
window.location = 'https://launcherspace.com/'; 
};
function createCookie(name,value,days){

}
function readCookie(name){

}
</script>

Thanks,
Ittanta Technologies Pvt. Ltd. | Shopify Expert
If reply is helpful, please Like and Accept Solution.
To hire us, contact us at info@ittanta.com
jenniferwlwong
New Member
3 0 0

@IttantaTech 

Hi, thank you for the reply, but adding this code just made my shop url redirect to launcherspace.com, so that I can't access my shop website at all.

jenniferwlwong
New Member
3 0 0

@AvidBrio 

 

  <header class="site-header{% if section.settings.align_logo == 'left' %} border-bottom logo--left{% else %} logo--center{% endif %}" role="banner">
    <div class="grid grid--no-gutters grid--table site-header__mobile-nav">
      {% if section.settings.align_logo == 'center' %}
        {%- assign logo_classes = 'medium-up--one-third medium-up--push-one-third logo-align--center' -%}
      {% else %}
        {%- assign logo_classes = 'medium-up--one-quarter logo-align--left' -%}
      {% endif %}

      <div class="grid__item {{ logo_classes }}">
        {% comment %}
          Use the uploaded logo from theme settings if enabled.
          Site name gets precedence with H1 tag on homepage, div on other pages.
        {% endcomment %}
        {% if request.page_type == 'index' %}
          <h1 class="h2 site-header__logo">
        {% else %}
          <div class="h2 site-header__logo">
        {% endif %}
          {% if section.settings.logo %}
            {%- assign img_url = section.settings.logo | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
            <a href="{{ routes.root_url }}" class="site-header__logo-image{% if section.settings.align_logo == 'center' %} site-header__logo-image--centered{% endif %}" data-image-loading-animation>
              {% capture logo_alt %}{{ section.settings.logo.alt | default: shop.name }}{% endcapture %}
              <img class="lazyload js"
                   src="{{ section.settings.logo | img_url: '300x300' }}"
                   data-src="{{ img_url }}"
                   data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
                   data-aspectratio="{{ section.settings.logo.aspect_ratio }}"
                   data-sizes="auto"
                   alt="{{ logo_alt | escape }}"
                   style="max-width: {{ section.settings.logo_max_width }}px">
              <noscript>
                {% capture image_size %}{{ section.settings.logo_max_width | escape }}x{% endcapture %}
                <img src="{{ section.settings.logo | img_url: image_size }}"
                     srcset="{{ section.settings.logo | img_url: image_size }} 1x, {{ section.settings.logo | img_url: image_size, scale: 2 }} 2x"
                     alt="{{ section.settings.logo.alt | default: shop.name }}"
                     style="max-width: {{ section.settings.logo_max_width }}px;">
              </noscript>
            </a>
          {% else %}
            <a class="site-header__logo-link" href="{{ routes.root_url }}">{{ shop.name }}</a>
          {% endif %}
        {% if request.page_type == 'index' %}
          </h1>
        {% else %}
          </div>
        {% endif %}
      </div>

 

 

 

This is in header.liquid, was putting {launcherspace.com} where {{routes.root_url}} is.

LitExtension
Shopify Partner
1935 317 391

This is an accepted solution.

Please change {{ routes.root_url }} => https://launcherspace.com/ Ex: https://i.imgur.com/cpYvcZE.png

It will work fine.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!

View solution in original post

AvidBrio
Shopify Expert
231 12 18

@jenniferwlwong   you don't need to change the URL  manually.  have linked your domain launcherspace.com with the Shopify store?


{{ routes.root_url }}

 This code is correct for the logo url

Refer to this Shopify documents https://help.shopify.com/en/manual/online-store/domains

If you find our comment helpful, hit the like button and accept it as a solution.
Want us to implement custom changes in your store? Contact us
Email me directly - jim@avidbrio.com