We use the following JS code to check localStorage and save this.
require(["jquery"], function (e) {
const t = function () {
const t = e("#togglebtw").is(":checked");
e(".price-container .price-including-tax").toggle(!t), e(".price-container .price-excluding-tax").toggle(t), localStorage.setItem("togglebtw", t ? "true" : "false");
};
e(function () {
e("#togglebtw")
.on("click", t)
.prop("checked", "true" === localStorage.getItem("togglebtw")),
t();
});
});
How can we also add/remove a class to the body when the #togglebtw is checked?