How can I obtain a product link in Collection-Images-z?

plz help me i want to get product with its link waiting for answer

{% schema %}
{
“name”: “Collection-Images-z”,
“settings”: [

{
“type”:“product”,
“id”:“First_product”,
“label”:“select product”
},

{
“type”:“product”,
“id”:“second_product”,
“label”:“select product”
}

],
“presets”: [
{
“name”: “product_test”,
“category”: “ADVANCED LAYOUT”
}
]

}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

Hello @zurain ,

Replace your code with this one.


 
  

 
    

 
    
 
    

  
    
    
      

      
        

         
            
 
        
        

      
      
    
    
    
 
 
  

 

 
{% 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

1 Like

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

@Guleria
check this i want these settings in loop in blocks

{%- assign product = all_products[section.settings.First_product] -%}
{%- assign product = all_products[section.settings.second_product] -%}
{%- assign product = all_products[section.settings.third_product] -%}
{%- assign product = all_products[section.settings.Fourth_product] -%}
{%- assign product = all_products[section.settings.Fifth_product] -%}

{% schema %}
{
“name”: “Collection-Images-z”,
“settings”: [

{
“type”:“product”,
“id”:“First_product”,
“label”:“First product”
},

{
“type”:“product”,
“id”:“second_product”,
“label”:“second product”
},

{
“type”:“product”,
“id”:“third_product”,
“label”:“third product”
},

{
“type”:“product”,
“id”:“Fourth_product”,
“label”:“Fourth product”
},

{
“type”:“product”,
“id”:“Fifth_product”,
“label”:“Fifth product”
}
],
“presets”: [
{
“name”: “product_test”,
“category”: “ADVANCED LAYOUT”
}
]

}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

img.home_img { height: 776.5px; }

@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

1 Like

@Guleria

ok listen plz i need these below settings in block settings or in loop plz check this code

{%- assign product = all_products[section.settings.First_product] -%}
{%- assign product = all_products[section.settings.second_product] -%}
{%- assign product = all_products[section.settings.third_product] -%}
{%- assign product = all_products[section.settings.Fourth_product] -%}
{%- assign product = all_products[section.settings.Fifth_product] -%}

{% schema %}
{
“name”: “Collection-Images-z”,
“settings”: [

{
“type”:“product”,
“id”:“First_product”,
“label”:“First product”
},

{
“type”:“product”,
“id”:“second_product”,
“label”:“second product”
},

{
“type”:“product”,
“id”:“third_product”,
“label”:“third product”
},

{
“type”:“product”,
“id”:“Fourth_product”,
“label”:“Fourth product”
},

{
“type”:“product”,
“id”:“Fifth_product”,
“label”:“Fifth product”
}
],
“presets”: [
{
“name”: “product_test”,
“category”: “ADVANCED LAYOUT”
}
]

}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

img.home_img { height: 776.5px; }