master
parent
5f79d45b5b
commit
b8e77ca5f4
|
@ -294,20 +294,25 @@
|
|||
objProducts[index].quantity = quantity;
|
||||
updateProductsInLocalStorage();
|
||||
});
|
||||
let url = null;
|
||||
if(window.location.origin == 'http://localhost') url = window.location.origin+'/areya-energy/public/'+btoa(JSON.stringify(objProducts));
|
||||
else url = window.location.origin+'/'+btoa(JSON.stringify(objProducts));
|
||||
$('#cart-link').attr('href', url);
|
||||
$('#cart-link').text(url);
|
||||
const shareData = {
|
||||
title: "Share cart list",
|
||||
text: 'share cart list',
|
||||
url: url,
|
||||
};
|
||||
$("#btn-share").click(async function() {
|
||||
if(navigator.share) { try { await navigator.share(shareData); } catch(err) { console.warn(err); } }
|
||||
else { console.warn('Native Web Sharing not supported'); }
|
||||
});
|
||||
if(objProducts.length > 0) {
|
||||
let url = null;
|
||||
if(window.location.origin == 'http://localhost') url = window.location.origin+'/areya-energy/public/'+btoa(JSON.stringify(objProducts));
|
||||
else url = window.location.origin+'/'+btoa(JSON.stringify(objProducts));
|
||||
$('#cart-link').attr('href', url);
|
||||
$('#cart-link').text(url);
|
||||
const shareData = {
|
||||
title: "Share cart list",
|
||||
text: 'share cart list',
|
||||
url: url,
|
||||
};
|
||||
$("#btn-share").click(async function() {
|
||||
if(navigator.share) { try { await navigator.share(shareData); } catch(err) { console.warn(err); } }
|
||||
else { console.warn('Native Web Sharing not supported'); }
|
||||
});
|
||||
}else{
|
||||
$('#cart-link').hide();
|
||||
$("#btn-share").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@yield('scripts')
|
||||
|
|
Loading…
Reference in New Issue