Skip to content

Instantly share code, notes, and snippets.

@saranyan
Last active December 21, 2015 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saranyan/6270679 to your computer and use it in GitHub Desktop.
Save saranyan/6270679 to your computer and use it in GitHub Desktop.
Bigcommerce - add soldout watermark to product thumbnail. Ideally paste this code in a script tag in the Footer template.
if($('.ProductMain').find('.OutOfStockMessage').html().length > 10)
{
$('.ProductThumbImage a img').attr('id','watermark');
var top = $('.ProductThumbImage a img').position.top;
var left = $('.ProductThumbImage a img').position.left;
$('<img id="overlay" src="' + window.location.origin + '/product_images/uploaded_images/soldout.png" />').insertBefore(".ProductThumbImage a > img:first");
$("#overlay").css({"position":"absolute","top":top,"left":left,"height":"100px","width":"100px"});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment