master
parent
57844a9804
commit
8c2404cfa1
|
@ -248,6 +248,11 @@
|
|||
catch(e) { return false; }
|
||||
return true;
|
||||
}
|
||||
function isEncoded(str){
|
||||
try { atob(str); }
|
||||
catch(e) { return false; }
|
||||
return true;
|
||||
}
|
||||
$(window).on('load', function(){
|
||||
if(localStorage.getItem("dismiss-message") == 1) $('.alert-dismissible').remove();
|
||||
else $('.alert-dismissible').show();
|
||||
|
@ -256,6 +261,7 @@
|
|||
let urlPath = window.location.pathname;
|
||||
let code = urlPath.split("/");
|
||||
code = code[code.length-1];
|
||||
if(isEncoded(code)){
|
||||
let productLink = atob(code);
|
||||
if(isJson(productLink)){
|
||||
if(objProducts.length > 0) $('#modal-confirm-product-replacement').modal('show');
|
||||
|
@ -266,6 +272,7 @@
|
|||
updateProductsInLocalStorage();
|
||||
window.location.replace($('meta[name="checkout"]').attr('content'));
|
||||
});
|
||||
}
|
||||
updateProductsInLocalStorage();
|
||||
$(document).on('click', '.btn-remove-product', function(){
|
||||
let productId = $(this).attr('data-id');
|
||||
|
|
Loading…
Reference in New Issue