Liquid, JavaScript, Themes
Hey there so i am using the debut theme for my one product store and i want to change/ add text like in the picture from another store i attached "Weihnachtsrabatt endet bald" .
I edit the translation for "tax included" but i wasn't able to make the text bold or change color. Could someone help me out?
Gelöst! Zur Lösung
Erfolg.
Im Prinzip kannst du den Code überall, von wo CSS Code zugeladen wird hinklatschen. Das ist nur fürs Styling dieser Nachricht. Schlimmstenfalls gehts auch als inline CSS.
freut mich geholfen zu haben! Freu mich über eine markierte Lösung. 😉
Nachdem Du im deutschen Community-Forum gepostet hast und auch der Screenshot deutschsprachig ist, antworte ich jetzt frecherweise auch auf Deutsch. Hoffe, dass das ok ist.
Zusammengefasst, Du hast den Text "tax included" als "Vorweihnachtsrabatt endet bald" übersetzt – korrekt?
Dazu ein paar Anmerkungen:
Ein Link zur Seite würde helfen in Sachen Styling konkreten Input zu geben. Wobei: der Text sieht zumindest schon ziemlich bold aus.
LG, Mario
https://stickyballstore.com/products/stickyball is der Produktlink.
Danke für die Antwort. Alles klar habs jetzt wieder geändert.
Der Anhang den ich gesendet habe ist ein Screenshot von einem anderen Shop und ich würde dies gerne in meinem eigenen Shop so einfügen. Könntest du mir die product template coding Anweisungen geben? Das wäre sehr hilfreich!
Vielen Dank,
Nicolas
https://stickyballstore.com/products/stickyball is der Produktlink.
Schwierig zu sagen, ohne dem Quelltext – da gibt's mehrere Möglichkeiten, wie das implementiert sein könnte. Kannst Du aus product.liquid die 15 Zeilen vor und nach der Zeile, in der "product__price" vorkommt rauskopieren und hier reinpasten?
<div class="grid__item {{ product_description_width }}">
<div class="product-single__meta">
<h1 class="product-single__title">{{ product.title }}</h1>
<a href="#looxReviews"><div class="loox-rating" data-id="{{ product.id }}" data-rating="{{ product.metafields.loox.avg_rating }}" data-raters="{{ product.metafields.loox.num_reviews }}"></div></a>
{% comment %}Start automatically added Judge.me widget{% endcomment %}
{% render 'judgeme_widgets', widget_type: 'judgeme_preview_badge', concierge_install: true, product: product %}
{% comment %}End automatically added Judge.me widget{% endcomment %}
<script>window.performance.mark('debut:product:title_visible');</script>
<div class="product__price">
{% include 'product-price', variant: current_variant, show_vendor: section.settings.show_vendor %}
</div>
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}
<div class="product__policies rte" data-product-policies>
{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- endif -%}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}
</div>
{%- endif -%}
{% capture "form_classes" -%}
product-form product-form-{{ section.id }}
{%- if section.settings.enable_payment_button and product.has_only_default_variant %} product-form--payment-button-no-variants {%- endif -%}
{%- if current_variant.available == false %} product-form--variant-sold-out {%- endif -%}
{%- endcapture %}
{% form 'product', product, class:form_classes, novalidate: 'novalidate', data-product-form: '' %}
{% unless product.has_only_default_variant %}
<div class="product-form__controls-group">
{% for option in product.options_with_values %}
<div class="selector-wrapper js product-form__item">
<label for="SingleOptionSelector-{{ forloop.index0 }}">
{{ option.name }}
</label>
<select class="single-option-selector single-option-selector-{{ section.id }} product-form__input"
id="SingleOptionSelector-{{ forloop.index0 }}"
data-index="option{{ forloop.index }}"
>
{% for value in option.values %}
<option value="{{ value | escape }}"{% if option.selected_value == value %} selected="selected"{% endif %}>{{ value }}</option>
{% endfor %}
</select>
</div>
{% endfor %}
</div>
{% endunless %}
<select name="id" id="ProductSelect-{{ section.id }}" class="product-form__variants no-js">
{% for variant in product.variants %}
<option value="{{ variant.id }}"
{%- if variant == current_variant %} selected="selected" {%- endif -%}
>
{{ variant.title }} {%- if variant.available == false %} - {{ 'products.product.sold_out' | t }}{% endif %}
</option>
{% endfor %}
</select>
korrekt?
Hier ist der angepasste Code:
<div class="grid__item {{ product_description_width }}">
<div class="product-single__meta">
<h1 class="product-single__title">{{ product.title }}</h1>
<a href="#looxReviews"><div class="loox-rating" data-id="{{ product.id }}" data-rating="{{ product.metafields.loox.avg_rating }}" data-raters="{{ product.metafields.loox.num_reviews }}"></div></a>
{% comment %}Start automatically added Judge.me widget{% endcomment %}
{% render 'judgeme_widgets', widget_type: 'judgeme_preview_badge', concierge_install: true, product: product %}
{% comment %}End automatically added Judge.me widget{% endcomment %}
<script>window.performance.mark('debut:product:title_visible');</script>
<div class="product__price">
{% include 'product-price', variant: current_variant, show_vendor: section.settings.show_vendor %}
</div>
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}
<div class="product__policies rte" data-product-policies>
{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- endif -%}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}
</div>
{%- endif -%}
<!-- r8r: promo string – https://community.shopify.com/c/Technische-Fragen-Antworten/Change-Text-under-Price/m-p/984164/highlight/false#M4169 -->
<div class="smdm-promo-string">
Vorweihnachtsrabatt endet bald!
</div>
<!-- r8r: promo string END-->
{% capture "form_classes" -%}
product-form product-form-{{ section.id }}
{%- if section.settings.enable_payment_button and product.has_only_default_variant %} product-form--payment-button-no-variants {%- endif -%}
{%- if current_variant.available == false %} product-form--variant-sold-out {%- endif -%}
{%- endcapture %}
{% form 'product', product, class:form_classes, novalidate: 'novalidate', data-product-form: '' %}
{% unless product.has_only_default_variant %}
<div class="product-form__controls-group">
{% for option in product.options_with_values %}
<div class="selector-wrapper js product-form__item">
<label for="SingleOptionSelector-{{ forloop.index0 }}">
{{ option.name }}
</label>
<select class="single-option-selector single-option-selector-{{ section.id }} product-form__input"
id="SingleOptionSelector-{{ forloop.index0 }}"
data-index="option{{ forloop.index }}"
>
{% for value in option.values %}
<option value="{{ value | escape }}"{% if option.selected_value == value %} selected="selected"{% endif %}>{{ value }}</option>
{% endfor %}
</select>
</div>
{% endfor %}
</div>
{% endunless %}
<select name="id" id="ProductSelect-{{ section.id }}" class="product-form__variants no-js">
{% for variant in product.variants %}
<option value="{{ variant.id }}"
{%- if variant == current_variant %} selected="selected" {%- endif -%}
>
{{ variant.title }} {%- if variant.available == false %} - {{ 'products.product.sold_out' | t }}{% endif %}
</option>
{% endfor %}
</select>
Dazu brauchst Du noch am Ende deiner theme.scss.liquid sowas in der Richtung:
/* r8r: promo string – https://community.shopify.com/c/Technische-Fragen-Antworten/Change-Text-under-Price/m-p/984164/highlight/false#M4169 */
.smdm-promo-string {
color: #00ff00;
font-weight: bold;
text-transform: uppercase;
}
/* r8r: promo string END */
Getestet hab ich's nicht – also proceed with caution 😉
Erster Code hat funktioniert 🙂 , allerdings kann ich die Datei theme.scss.liquid nicht finden
Erfolg.
Im Prinzip kannst du den Code überall, von wo CSS Code zugeladen wird hinklatschen. Das ist nur fürs Styling dieser Nachricht. Schlimmstenfalls gehts auch als inline CSS.
freut mich geholfen zu haben! Freu mich über eine markierte Lösung. 😉
Alles geklappt, vielen Dank!
Keine Ursache - freut mich, dass ich helfen konnte!
Mario
Shopify unterstützt die weltweit innovativsten Marken und Unternehmer:innen. Um Unterne...
By SarahF_Shopify Mar 25, 2024Was ist ein kleines Element eines Shopify Shops mit großer Wirkung? Ein Element ganz we...
By Kai Mar 14, 2024Was genau ist POD? Von T-Shirts bis hin zu Plakaten, Kaffeetassen, Wandmatten, alles was m...
By Kai Feb 29, 2024