Last active
December 21, 2015 07:19
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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