There are two ways to interact with social networks.
1. If you want to share the page with custom product builder you may use the service https://sharethis.com/ and follow instructions for Shopify CMS. This way gives you a lot of possible social networks for sharing.
2. If you want to share your custom product with preselected options please do the following:
(Described steps refer to Shopify Venture theme, but they should be similar for other themes)
Please create a new snippet with the name "customproductbuilder-social":
Please enter the following code to the blank tab and click on "Save" after that:
{% if item.properties and item.properties.configId %}
{% assign customlink = item.url | split: '?' | first | append: '?configid=' | append: item.properties.configId %}
{% if settings.share_twitter %}
<a target="_blank" href="//twitter.com/share?text={{ share_title | url_param_escape }}&url={{ shop.url | append: customlink }}" class="social-sharing__link share-twitter" title="{{ 'general.social.alt_text.share_on_twitter' | t }}">
{% include 'icon-twitter' %}
<span class="share-title visually-hidden">{{ 'general.social.alt_text.share_on_twitter' | t }}</span>
</a>
{% endif %}
{% if settings.share_facebook %}
<a target="_blank" href="//www.facebook.com/sharer.php?u={{ shop.url | append: customlink }}" class="social-sharing__link share-facebook" title="{{ 'general.social.alt_text.share_on_facebook' | t }}">
{% include 'icon-facebook' %}
<span class="share-title visually-hidden">{{ 'general.social.alt_text.share_on_facebook' | t }}</span>
</a>
{% endif %}
{% endif %}
Go to the cart-template.liquid and find lines similar with:
<p>
<a href="/cart/change?line={{ forloop.index }}&quantity=0">{{ 'cart.general.remove' | t }}</a>
</p>
</td>
and please insert following line below the </p> tag and above the </td>:
{% include 'customproductbuilder-social' %}
You should get the following code:
After those steps you can see at the cart page buttons of the social networks:
These buttons gives the ability to share the product with preselected options.
Currently, Twitter and Facebook supported.
Social Sharing - How to Generate Current Custom Product Configuration Image & ConfigID
Comments
0 comments
Please sign in to leave a comment.