Display Price in Multiple currencies on the Wishlist page

Using Smart Wishlist, one can easily display the product price in multiple currencies on the Wishlist page. Before you begin, make sure that you have multiple currencies enabled and working on the remaining pages of the store. Here we use the currency conversion factor provided by Shopify to convert the price to different currencies.

NOTE: This is merely a workaround meant till the time we integrate this feature permanently in the App.

STEPS

1. Create a new snippet titled wishlist-enhancements. It creates the file snippets/wishlist-enhancements.liquid. If this file already exists, skip this step.

2. Add the following code and save it.

{% unless template %}
<script type="text/javascript">
WishlistLoadedCallback=function(){
	if($("#bookmarks").has(".price").length>0)
	{
	
		$("#bookmarks .price").each(function()
		{
			var original_amount=$(this).attr("data-amount");
			var converted_amount=parseFloat(Shopify.currency.rate)*parseFloat(original_amount);	
			$(this).html(Shopify.currency.active+" "+converted_amount.toFixed(2));

		});
			
	}	
};

</script>
{% endunless %}

3. Add the following code anywhere before closing </head> in layout/theme.liquid.

{% include 'wishlist-enhancements' %} 

Leave a Reply

Your email address will not be published.