Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
YSHOP2-670: Themes > Google Analytics doesn't give the full page url (#…
Browse files Browse the repository at this point in the history
…119)

* add page title

* add product name

* add translation

* assign variable

* update to switch case

* update

---------

Co-authored-by: adilmarghadi1 <[email protected]>
  • Loading branch information
adildev101 and adilmarghadi1 authored Jul 12, 2023
1 parent c879e09 commit 5340935
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
5 changes: 5 additions & 0 deletions locales/ar.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"show_more_button": "عرض المزيد",
"buy_now": "اشتري الأن"
},
"head_metadata": {
"collections" : "التصنيفات",
"thankyou": "شكرا جزيلا على ثقتكم",
"cart": "سلة مشترياتي"
},
"navbar": {
"search": {
"placeholder": "أدخل الكلمة الرئيسية للبحث عنها..."
Expand Down
5 changes: 5 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"general": {
"buy_now": "Buy now"
},
"head_metadata": {
"collections" : "Collections",
"thankyou": "Thank you",
"cart": "Shopping Cart"
},
"navbar": {
"search": {
"placeholder": "Enter keyword to search for..."
Expand Down
5 changes: 5 additions & 0 deletions locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"general": {
"buy_now": "Acheter maintent"
},
"head_metadata": {
"collections" : "Collections",
"thankyou": "Merci",
"cart": "Panier d'achat"
},
"navbar": {
"search": {
"placeholder": "Entrez un mot-clé à rechercher..."
Expand Down
25 changes: 21 additions & 4 deletions snippets/head-config.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,27 @@
{{ 'utils.css' | asset_url | stylesheet_tag }}
{{ 'dropdown.css' | asset_url | stylesheet_tag }}

{% assign store_title = store.title | default: store.name %}

<title>
{%- if settings.meta_title %}
{{ settings.meta_title }}
{% else %}
{{ store.name }}
{% if page %}
{{ store_title }} | {{ page.name }}
{% elsif product %}
{{ store_title }} | {{ product.name }}
{% elsif category %}
{{ store_title }} | {{ category.name }}
{% elsif template %}
{% case template.name %}
{% when 'index' %}
{{ store_title }}
{% when 'list-collections' %}
{{ store_title }} | {{ 'head_metadata.collections' | t }}
{% when 'cart' %}
{{ store_title }} | {{ 'head_metadata.cart' | t }}
{% when 'thankyou' %}
{{ store_title }} | {{ 'head_metadata.thankyou' | t }}
{% else %}
{{ store_title }} | {{ template.name }}
{% endcase %}
{% endif %}
</title>

0 comments on commit 5340935

Please sign in to comment.