Remove last 2 decimal places from the product price on Wishlist Page

If you want to remove the last 2 decimal places from the Price displayed on Wishlist page, follow these 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 current_price=$(this).html();
			$(this).html(current_price.slice(0,-3));

		});
			
	}	
};
</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. Required fields are marked *