How can I modify my theme's cookie banner code for better translation and mobile display?

Hi Shopify Community,

I need your help with making some changes on code of the Theme Cookie Banner.

As you can see in the first picture (Original) that is how the cookie banner before making any changes. I changed the Cross(X) to a button (Only necessary) so I am not able to translate this word into German because my store is Multilanguage, What should i do so the word appear in the translation app ?

My second problem is the banner on the mobile version. The Options have been mixed as you can see in the third picture and the banner is not centered as i modified it in the desktop. What should i do?


  {% for block in section.blocks %}
    {% case block.type %}
      {% when 'popup' %}
        

          
          
            
          

        

        {% when 'cookie' %}
        
          {%- assign markup = 'general.cookies.cookies_link' | t -%}
          
          {%- if shop.privacy_policy -%}
            {% capture markup %} {{ 'general.cookies.cookies_link' | t }} {% endcapture %}
          {%- endif -%}

          
            

            #### {{- 'general.cookies.title' | t -}}
            

{{- 'general.cookies.text_html' | t: cookies: markup -}}

            
            

          

        

      {% else %}
    {% endcase %}
  {% endfor %}

{% schema %}
{
  "name": "Popups",
  "settings": [],
  "blocks" : [
    {
      "type": "popup",
      "name": "Newsletter",
      "limit": 1,
      "settings": [
        {
          "type": "text",
          "id": "promo_modal_subtitle",
          "label": "Subheading",
          "default": "Broadcast"
        },
        {
          "type": "text",
          "id": "promo_modal_title",
          "label": "Heading",
          "default": "Newsletter"
        },
        {
          "id": "promo_modal_richtext",
          "type": "richtext",
          "label": "Description",
          "default": "

Subscribe to get special offers, free giveaways, and once-in-a-lifetime deals.

"
        },
        {
          "type": "checkbox",
          "id": "enable_name",
          "label": "Show name field",
          "default": false
        },
        {
          "type": "text",
          "id": "promo_button_text",
          "label": "Button text",
          "default": "Join"
        },
        {
          "type": "image_picker",
          "id": "promo_image",
          "label": "Image"
        },
        {
          "type": "header",
          "content": "Colors"
        },
        {
          "type": "color",
          "id": "promo_bg_color",
          "label": "Background",
          "default": "#fff"
        },
        {
          "type": "select",
          "id": "promo_text_color",
          "label": "Text",
          "default": "dark",
          "options": [
            { "value": "light", "label": "Light" },
            { "value": "dark", "label": "Dark" }
          ]
        }
      ]
    },
    {
      "type": "cookie",
      "name": "Cookie consent",
      "limit": 1,
      "settings": [
        {
          "type": "checkbox",
          "id": "show_cookies_popup",
          "label": "Enable cookie tracking popup",
          "info": "This feature uses the Shopify [consent tracking API](https://help.shopify.com/en/manual/your-account/privacy/cookies) and will not show in all regions.  Customer privacy tracking limits must be enabled in your [online store settings](/admin/online_store/preferences).  [Learn More](https://invisiblethemes.com/link/broadcast/docs/cookies)",
          "default": true
        }
      ]
    }
  ]
}
{% endschema %}

@Muhannad

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

1 Like

Hi

i hired a shopify-Expert and he did fixed the problem but you can check it if you want.

www.gracias-store.com

PW: meamub