Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I want to add a whatsapp icon with a link associated to it to redirect to whatsapp .
I'm having some trouble adding it on the publisher theme
Can someone explain how to do it ?
Hello, I was also wondering the same thing, and with a little trial and error, plus some help from a previous post, I worked out how to do it for the ‘Spotlight’ theme. Maybe the same method will work on another Shopify 2.0 theme.
aria-hidden="false" focusable="true" class="icon icon-whatsapp"
<li class="list-social__item">
<a href="INSERT YOUR WHATSAPP LINK HERE" class="link list-social__link">
{%- render 'icon-whatsapp' -%}
</a>
</li>
Finally, click save and preview to see whether it worked! I hope it does - fingers crossed. 😊
Here's how mine looked.
<a href="{{ section.settings.link_whatsapp }}" class="whatsapp-icon"><img src="{{ section.settings.imagen_whatsapp | image_url }}" alt="whatsapp"></a>
{% style %}
.whatsapp-icon img{
width:{{ section.settings.size_img_whatsapp }}px;
}
{% endstyle %}
{% if section.settings.alineacion_horizontal == 'left' %}
<style>
.whatsapp-icon{
position: fixed;
left: 1%;
padding:10px;
z-index:10;
bottom: {{ section.settings.alineacion_horizontal_img_whatsapp }}%;
}
</style>
{% endif %}
{% if section.settings.alineacion_horizontal == 'right' %}
<style>
.whatsapp-icon{
position: fixed;
right: 1%;
bottom: 50%;
padding:10px;
z-index:10;
bottom: {{ section.settings.alineacion_horizontal_img_whatsapp }}%;
}
</style>
{% endif %}
{% schema %}
{
"name": "whatsapp",
"settings": [
{
"type": "image_picker",
"id":"imagen_whatsapp",
"label":"ingresa la imagen de whatsapp"
},
{
"type":"url",
"id":"link_whatsapp",
"label":"Ingresa el link de whatsapp"
},
{
"type":"range",
"id": "size_img_whatsapp",
"label": "Ingresa el tamaño para el icono de whatsapp",
"min":16,
"max": 100,
"unit": "px",
"default": 18
},
{
"type": "select",
"id": "alineacion_horizontal",
"label": "Alineacion Horizontal",
"options": [
{
"value": "left",
"label": "left"
},
{
"value": "right",
"label": "right"
}
],
"default": "left"
},
{
"type":"range",
"id": "alineacion_horizontal_img_whatsapp",
"label": "Ingresa la alineacion del icono de whatsapp",
"min":5,
"max": 50,
"unit": "%",
"default": 5
}
],
"presets": [
{
"name":"whatsapp"
}
]
}
{% endschema %}
Hola solo crea un archivo en la carpeta sections de tu tema, puedes nombrarlo whatsapp-icon.liquid , esto hara que lo puedas utilizar en cualquier template del tema , incluso con diferentes url de whatsapp, ya trae controles para el tamaño del icono posicionamiento del icono y agregar la url de whatsapp a la que va apuntar 🙂
Hey,
I have the Previous Post method on my Shopify store but it is not working for me. Can someone please check it and guide me. I want to integrate it in my Shopify website.
https://community.shopify.com/c/technical-q-a/how-to-add-a-whatsapp-icon-to-a-november-theme-footer/
I want to add it in footer.
Thanks & Regards
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024