Skip to content

Instantly share code, notes, and snippets.

View SmellyFish's full-sized avatar

Nikita Makeyev SmellyFish

View GitHub Profile
@SmellyFish
SmellyFish / gist:7475558
Created November 14, 2013 22:38
This code will replace an actual registered sign symbol (R in a circle) with "®".
$name = str_replace(html_entity_decode('®', null, 'UTF-8'), '®', $name);
@SmellyFish
SmellyFish / gist:7420007
Last active December 28, 2015 01:19
jQuery code to remove decimals on the front end.
jQuery(function(){
$('.sprice, #price, #cartItems .list, #orderDetails .list, #orderList tr td').each(function(){
cleanPriceText($(this));
});
});
function cleanPriceText($ele){
var text;
text = $ele.text();
text = text.replace(/(\$[0-9\.\,\s]+)\.00/g, '$1');