Fix errors on new product creation

This commit is contained in:
Amanmyrat 2023-09-14 23:22:37 +05:00
parent 6a0be7f0ba
commit 4c9d754d02
2 changed files with 44 additions and 44 deletions

View File

@ -13,7 +13,6 @@ layout = "seller-master"
<div class="intro-y col-span-12 flex flex-wrap sm:flex-nowrap items-center mt-2">
<a href="/seller/product/add" class="btn btn-primary shadow-md mr-2">{{'add.prod.title'|_}}</a>
<div class="hidden md:block mx-auto text-slate-500">Showing 1 to 10 of 150 entries</div>
<div class="w-full sm:w-auto mt-3 sm:mt-0 sm:ml-auto md:ml-0">
<div class="w-56 relative text-slate-500">
<input type="text" class="form-control w-56 box pr-10" placeholder="Search...">

View File

@ -192,6 +192,7 @@
// $("input[name='images[files][]']").val(product.images[0].original_image_url);
// $("select[name='status']").val(product.status);
if (product) {
$("#product_status").html(`
<option value="1" ` + (product.status == 1 ? `selected` : ``) + `>{{'product.enable'|_}}</option>
<option value="0" ` + (product.status == 0 ? `selected` : ``) + `>{{'product.disable'|_}}</option>
@ -200,7 +201,6 @@
<option value="1" ` + (product.featured == 1 ? `selected` : ``) + `>{{'product.enable'|_}}</option>
<option value="0" ` + (product.featured == 0 ? `selected` : ``) + `>{{'product.disable'|_}}</option>
`);
$("div.product_featured select").val(product.featured);
// $("#product_featured select").val(product.featured).change();
@ -221,7 +221,6 @@
<option selected value="` + category.id + `">` + category.name + `</option>
`);
}
vendorCats();
product.images.forEach(image => {
let mockFile = {name: image.original_image_url, size: 12345};
@ -242,6 +241,8 @@
}
xhrr.send()
})
}
vendorCats();
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');