Commit ea10d923 authored by gaseema.n's avatar gaseema.n

inventory update

parent 5e8fad5c
......@@ -1442,13 +1442,12 @@
<path style="fill:#231F20;" d="M224,344h64c13.255,0,24-10.745,24-24s-10.745-24-24-24h-64c-13.255,0-24,10.745-24,24 S210.745,344,224,344z M224,312h64c4.418,0,8,3.582,8,8s-3.582,8-8,8h-64c-4.418,0-8-3.582-8-8S219.582,312,224,312z"></path>
</svg>
</div>
<h5 style="margin:0px;font-size: 1.3rem;padding-top: 10px;">SPONSORED PRODUCTS</h5>
<h5 style="margin:0px;font-size: 1.3rem;padding-top: 10px;">Add Items To Your Inventory</h5>
</div>
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<input type="text" id="check-prod-input" class="autocomplete sponsoredPrd" placeholder="Add Sponsored Products">
<label for="check-prod-input"></label>
<div class="autocomplete" style="width: 90%; display: block; margin: 20px auto;">
<input id="check-prod-input" type="text" name="myCountry" placeholder="Add Sponsored Products" class="sponsoredPrd">
</div>
</div>
<div class="row sprndProd"></div>
......
......@@ -18,18 +18,21 @@ function sponpProdNamesInput() {
data: inputVal,
filter: 'sponsored'
}).then(function(e) {
console.log('=======================')
console.log(e)
var dat = {}
var itemDat = new Array();
sponProds = e.products;
for (var iii in e.products) {
var nm = e.products[iii].name + " - " + e.products[iii].price;
var icn = e.products[iii].icon;
var itemName = e.products[iii].name
//var id = e.users[iii].id;
dat[nm] = icn;
itemDat.push(itemName)
}
inventoryInput = M.Autocomplete.init(document.querySelectorAll('#check-prod-input'), {});
inventoryInput[0].updateData(dat);
autocomplete(document.getElementById("check-prod-input"), itemDat);
});
}
......
......@@ -171,17 +171,19 @@ $(document).on('touchstart click', '#noSponsoredBtn', function (event) {
$("#rmvSpnsrdProd").hide();
});
$('#spnsrdModal').on('click', $('ul.autocomplete-content li'), function () {
var value = $('.sponsoredPrd').val();
$('#spnsrdModal').on('click', $('.autocomplete-items div'), function () {
var value = $('#check-prod-input').val();
console.log('============')
console.log(value)
if (value != '') {
var sponsoredProduct = $('.sponsoredPrd').val();
var sponsoredProduct = value;
for (var i in sponProds) {
var name = sponProds[i].name;
var id = sponProds[i].id;
var price = sponProds[i].price;
if (sponsoredProduct == name + " - " + price) {
if (sponsoredProduct == name) {
M.toast({
html: 'Adding sponsored produc',
html: 'Adding sponsored product',
classes: 'spnsrdTst',
displayLength: 10000
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment