All things Shopify and commerce
Solved! Go to the solution
This is an accepted solution.
Hello @zurain ,
Replace your code with this one.
<div class="container">
<div class="row">
<div class="col-lg-6">
<a href="{{ section.settings.First_product_url }}">
<img src="{{ section.settings.First_product | img_url: '600x' }}"/>
</a>
</div>
<div class="col-lg-6">
<div class="row">
<div class="col-lg-6">
<a href="{{ section.second_product_url }}">
<img src="{{ section.settings.second_product | img_url: '600x' }}"/>
</a>
</div>
</div>
</div>
</div>
</div>
{% schema %}
{
"name": "Collection-Images-z",
"settings": [
{
"type":"product",
"id":"First_product",
"label":"select product"
},
{
"type":"url",
"id":"First_product_url",
"label":"First product url"
},
{
"type":"product",
"id":"second_product",
"label":"select product"
},
{
"type":"url",
"id":"second_product_url",
"label":"Second product url"
}
],
"presets": [
{
"name": "product_test",
"category": "ADVANCED LAYOUT"
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
Thanks
This is an accepted solution.
Hello @zurain ,
Replace your code with this one.
<div class="container">
<div class="row">
<div class="col-lg-6">
<a href="{{ section.settings.First_product_url }}">
<img src="{{ section.settings.First_product | img_url: '600x' }}"/>
</a>
</div>
<div class="col-lg-6">
<div class="row">
<div class="col-lg-6">
<a href="{{ section.second_product_url }}">
<img src="{{ section.settings.second_product | img_url: '600x' }}"/>
</a>
</div>
</div>
</div>
</div>
</div>
{% schema %}
{
"name": "Collection-Images-z",
"settings": [
{
"type":"product",
"id":"First_product",
"label":"select product"
},
{
"type":"url",
"id":"First_product_url",
"label":"First product url"
},
{
"type":"product",
"id":"second_product",
"label":"select product"
},
{
"type":"url",
"id":"second_product_url",
"label":"Second product url"
}
],
"presets": [
{
"name": "product_test",
"category": "ADVANCED LAYOUT"
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
Thanks
no you dont understand its not collection image its product image when someone click on it it will go to single product page or if someone click on cart button he/she will go to cart page i need product image with auto get its link like a loop
@zurain You asked for hyperlink in image and I provided an option in code through which you can link your image either to collection or product single.
Seems you are not clear what you need I suggest post your requirement to shopify expert or some job portals.
Thanks
ok listen plz i need these below settings in block settings or in loop plz check this code
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024