-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAmazonVATFree.user.js
36 lines (33 loc) · 1.55 KB
/
AmazonVATFree.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// ==UserScript==
// @name Amazon Show VAT-Free Prices
// @namespace http://alexanderstopher.com
// @version 0.3
// @description Shows VAT-free prices on Amazon. Only shows for items in your basket, as well as basket total.
// @author Alexander Stopher
// @match *.amazon.co.uk/*
// @grant none
// @require https://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
(function() {
'use strict';
var $ = window.jQuery;
$(".sc-price, #priceblock_ourprice").each(function() {
if ($("#merchant-info").text().indexOf("Amazon") > -1 && !($("#merchant-info").text().indexOf("Fulfilled") > -1))
{
showVatFreePrice(this);
$("#priceBadging_feature_div").css("font-size", "12px");
}
else if (window.location.href.indexOf("www.amazon.co.uk/gp/cart/view.html") > -1)
{
showVatFreePrice($(this));
}
});
function showVatFreePrice(t)
{
$(t).html("£" + (Number(($(t).text().replace(/[^0-9.-]+/g,"")))/1.2).toFixed(2) + " <sup>(inc. VAT: " + $(t).text() + ")</sup>");
}
if (window.location.href.indexOf("www.amazon.co.uk/gp/cart/view.html") > -1)
{
$("#cart-about-cart-warning").html($("#cart-about-cart-warning").html() + "The \"VAT-free Prices\" plugin does not guarantee that the prices shown are what you will pay. As a result, this tool does not modify prices shown within the checkout process as a safeguard. We are not liable for any incorrect charges as a result of you using this tool.<br /><br />");
}
})();