buy now issue

This commit is contained in:
rahul shukla 2019-06-14 21:04:22 +05:30
parent ad5890f88b
commit 076f197de7
2 changed files with 1 additions and 15 deletions

View File

@ -205,19 +205,6 @@
}
document.getElementById("quantity").value = quantity;
var buyNowLink = $('.btn.buynow').attr('data-href');
var splitted = buyNowLink.split("/");
lastItem = splitted[splitted.length - 2];
splitted.pop();
splitted.pop();
var joined = splitted.join('/');
var newBuyNowUrl = joined + '/' + lastItem + '/' + quantity;
$('.btn.buynow').attr('data-href', newBuyNowUrl);
event.preventDefault();
}
</script>

View File

@ -148,14 +148,13 @@
if (this.selectedProductId != '' && buyNowLink) {
var splitted = buyNowLink.split("/");
splitted.pop();
splitted.pop();
lastItem = this.selectedProductId;
var joined = splitted.join('/');
var newBuyNowUrl = joined + '/' + lastItem + '/' + quantity;
var newBuyNowUrl = joined + '/' + lastItem;
$('.btn.buynow').attr('data-href', newBuyNowUrl);
}