Product description - add code there

Vlk1
Excursionist
19 1 0

Hi guys, I am looking for a way to add a specific code to the product description, which would display the product name (title) on one line and the SKU / Barcode for each variant on the second line (depending on which one is selected). I tried to add something in this style, but unfortunately, nothing works for me. Thank you.

 

<div class="card__content">
<div class="card__information">
<h3 class="card__heading">
<a href="{{ card_product.url }}" class="full-unstyled-link">
{{ card_product.title }} 
</a>
</h3>
<div class="product-sku">
SKU: {{ card_product.sku }}
</div>
<div class="product-release-date">
Datum vydání: {{ card_product.release_date }}
</div>
</div>
</div>

Replies 4 (4)

EBOOST
Shopify Partner
833 229 256

Hi @Vlk1 ,

May I suggest code below:

 

<div class="card__content">
    <div class="card__information">
        <h3 class="card__heading">
            <a href="{{ card_product.url }}" class="full-unstyled-link">
                {{ card_product.title }}
            </a>
        </h3>
        <div class="product-sku">
            SKU: {{ card_product.selected_or_first_available_variant.sku }}
        </div>
        <div class="product-release-date">
            Datum vydání: {{ card_product.published_at  | date: "%a, %b %d, %y" }}
        </div>
    </div>
</div>

 

Hope can help

If you find my reply helpful, please hit Like and Mark as Solution

https://www.eboosttech.net

EBOOST
DONATE ❤❤
Vlk1
Excursionist
19 1 0

Hello, I have tried to put it there. It does not show what code suppose to show, it gets stucked on this. Do you have any idea why? Thank you

Vlk1_0-1715498689798.png

 

EBOOST
Shopify Partner
833 229 256

Hi,

You must to put this code to liquid file.

1. Go to Store Online-> theme -> edit code

EBOOST_1-1672356985580.png

2. snippets/card-product.liquid

3. Your screenshot used in the product page. So you need replace "card_product" to " product "

4. The case that is not work. Could you share your content of the file that you put code? I will help to add after that you only copy to replace old code.

Hope can help

If you find my reply helpful, please hit Like and Mark as Solution

https://www.eboosttech.net

EBOOST
DONATE ❤❤

BSSTech-Venture
Shopify Expert
425 103 117

Hi @Vlk1 

Can you kindly download your theme and share your file zip with us or your theme name? We will help you check it and suggest you a solution.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.

For B2B solutions and custom pricing, check out B2B Solution & Custom Pricing |
For adding product labels/badges, visit Product Labels by BSS

BSS Commerce - Shopify Apps & Store Development Service Provider

Hire a Shopify expert | Shopify Plus Store Development