Can someone please help me to create a block like this in product info section in dawn theme thanks
This should be vertical like the image. 1-3 icons and text
Can someone please help me to create a block like this in product info section in dawn theme thanks
This should be vertical like the image. 1-3 icons and text
@NOT1 Yes, I can help you with this one.
@Hardik2903 How can I do it?
@NOT1 I will need the access of the Shopify store to achieve this feature.
Okay sure what to do
Instructions
Go to ‘Online Store’ → Themes → Edit Code
In the sections folder locate the file ‘main-product.liquid’
Copy the above file’s contents
Create a new file in the sections folder called ‘main-product-backup.liquid’
Paste the contents in the new file
Go to the ‘main-product.liquid’ file
Scroll down until you find the {% schema %}
Inside the blocks property right after the:
{
"type": "@app"
},
add the below code
{
"type": "information_icon",
"name": "Information with Icon",
"settings": [
{
"type": "image_picker",
"id": "custom_information_icon",
"label": "Information Icon"
},
{
"type": "richtext",
"id": "custom_information",
"label": "Information"
}
]
},
In the current file that you are ‘main-product.liquid’ search for this : {%- for block in section.blocks -%}
Inside that for loop just after this
{%- when '@app' -%}
{% render block %}
add the below code
{%- when 'information_icon' %}
{{ block.settings.custom_information }}
In the assets folder locate the file ‘base.css’
At the end of the file paste the below code
/* Product Custom Information Block */
.custom_information_container {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
}
.product_custom_information {
margin-left: 20px;
line-height: 1.5em;
}
.product_custom_information p {
margin: 0;
}
.product_custom_information a {
color: inherit;
}
Now you can go to your theme’s customization and add blocks.
If you have a problem and it doesn’t work, please share the modifications you did to the code so I instantly check if there is a problem with the code.
I truly appreciate everything you’ve done.
Thank you so much!
If you don’t like how it looks and would prefer a different style, I’d be happy to help.
No no its good but i would be happy if i had more options to customize it like A extra title option and ability to change font size (For font size it will be also ok if you just tell me which code to change). Thank you
Solution:
{
"type": "information_icon",
"name": "Information with Icon",
"settings": [
{
"type": "header",
"content": "Title Section"
},
{
"type": "text",
"id": "custom_information_title",
"label": "Title"
},
{
"type": "header",
"content": "Image Section"
},
{
"type": "image_picker",
"id": "custom_information_icon",
"label": "Information Icon"
},
{
"type": "header",
"content": "Text Section"
},
{
"type": "font_picker",
"id": "custom_information_font",
"label": "Font",
"default": "sans-serif"
},
{
"type": "richtext",
"id": "custom_information",
"label": "Information"
}
]
},
{%- when 'information_icon' %}
## {{ block.settings.custom_information_title }}
{{ block.settings.custom_information }}
/* Product Custom Information Block */
.custom_information_container {
}
.product_custom_information{
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
}
.product_custom_information_text {
margin-left: 20px;
line-height: 1.5em;
}
.product_custom_information p {
margin: 0;
}
.product_custom_information a {
color: inherit;
}
Which section? The one with the icons or the one below?
The one with Icons
Yea that’s what I designed.
can you please share your store’s URL? so I can see if the code you’ve added is correct? Or can you check from that the code I provided you the last time is the one you included in the implementation?
Thank you
It looks pretty similar to the one you shown. What don’t you like, so we can fix it to your requirements!
I mean like the icon should be on the left and on the right there should be a title or heading whatever it is which I can make it bold and below that there will be some info or text like this (the icon should be in the center of the 2 texts
And thanks a lot for your patience I really very much appreciate it
Yea In the text section you can bold text to make it look like the one in the image, and then enter a new line. That’s why it’s a rich text. Because you can bold, italic, etc. When you told me about title I thought you wanted title of the section in general.