Created
May 29, 2015 09:01
-
-
Save riq363/5518850496c937ddd975 to your computer and use it in GitHub Desktop.
Replace $0.00 price with 'Call for price' text
This file contains 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
<script> | |
Ecwid.OnPageLoaded.add(function(page){ | |
setTimeout(function hidePrice() { | |
$(".ecwid-productBrowser-price").each(function(idx, el){ | |
if ($(el).text() == Ecwid.formatCurrency(0)) { | |
if(page.type == "CATEGORY") { | |
$(el).text('Call for price'); | |
$('.ecwid-BuyNow-outOfStockLabel').hide(); | |
} | |
else if (page.type == "PRODUCT") { | |
$(this).text('Call for price'); | |
$('.ecwid-productBrowser-details-inStockLabel').show(); | |
$('.ecwid-productBrowser-details-outOfStockLabel').hide(); | |
$('.ecwid-AddToBagButton').hide(); | |
} | |
} | |
else { | |
$('.ecwid-productBrowser-details-outOfStockLabel').show(); | |
$('.ecwid-AddToBagButton').show(); | |
} | |
}); | |
}, 50); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment