Nuevos cambios hechos de diseño
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
59
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/config.json
Normal file
59
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/config.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name":"Wholesale",
|
||||
"unique_identifier":"wholesale",
|
||||
"version":"1.4",
|
||||
"minimum_item_version":"6.4.0",
|
||||
"addon_banner":"wholesale.png",
|
||||
"directory":[
|
||||
{
|
||||
"name":[
|
||||
"app/Services",
|
||||
"resources/views/wholesale/products",
|
||||
"resources/views/wholesale/frontend/seller_products"
|
||||
]
|
||||
}
|
||||
],
|
||||
"sql_file":"",
|
||||
"files":[
|
||||
{
|
||||
"root_directory":"addons/wholesale/assets/wholesale.png",
|
||||
"update_directory":"public/wholesale.png"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/controllers/WholesaleProductController.php",
|
||||
"update_directory":"app/Http/Controllers/WholesaleProductController.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/requests/WholesaleProductRequest.php",
|
||||
"update_directory":"app/Http/Requests/WholesaleProductRequest.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/services/WholesaleService.php",
|
||||
"update_directory":"app/Services/WholesaleService.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/views/wholesale/frontend/seller_products/create.blade.php",
|
||||
"update_directory":"resources/views/wholesale/frontend/seller_products/create.blade.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/views/wholesale/frontend/seller_products/edit.blade.php",
|
||||
"update_directory":"resources/views/wholesale/frontend/seller_products/edit.blade.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/views/wholesale/frontend/seller_products/index.blade.php",
|
||||
"update_directory":"resources/views/wholesale/frontend/seller_products/index.blade.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/views/wholesale/products/create.blade.php",
|
||||
"update_directory":"resources/views/wholesale/products/create.blade.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/views/wholesale/products/edit.blade.php",
|
||||
"update_directory":"resources/views/wholesale/products/edit.blade.php"
|
||||
},
|
||||
{
|
||||
"root_directory":"addons/wholesale/views/wholesale/products/index.blade.php",
|
||||
"update_directory":"resources/views/wholesale/products/index.blade.php"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use CoreComponentRepository;
|
||||
use App\Models\Category;
|
||||
use App\Models\Product;
|
||||
use App\Models\ProductTranslation;
|
||||
use App\Services\WholesaleService;
|
||||
use App\Services\ProductTaxService;
|
||||
use App\Services\ProductFlashDealService;
|
||||
use Auth;
|
||||
use App\Http\Requests\WholesaleProductRequest;
|
||||
use Artisan;
|
||||
|
||||
class WholesaleProductController extends Controller
|
||||
{
|
||||
public function __construct() {
|
||||
// Staff Permission Check
|
||||
$this->middleware(['permission:view_all_wholesale_products'])->only('all_wholesale_products');
|
||||
$this->middleware(['permission:view_inhouse_wholesale_products'])->only('in_house_wholesale_products');
|
||||
$this->middleware(['permission:view_sellers_wholesale_products'])->only('seller_wholesale_products');
|
||||
$this->middleware(['permission:add_wholesale_product'])->only('product_create_admin');
|
||||
$this->middleware(['permission:edit_wholesale_product'])->only('product_edit_admin');
|
||||
$this->middleware(['permission:delete_wholesale_product'])->only('product_destroy_admin');
|
||||
}
|
||||
|
||||
public function all_wholesale_products(Request $request)
|
||||
{
|
||||
CoreComponentRepository::instantiateShopRepository();
|
||||
|
||||
$type = 'All';
|
||||
$col_name = null;
|
||||
$query = null;
|
||||
$sort_search = null;
|
||||
$seller_id = null;
|
||||
|
||||
$products = Product::where('wholesale_product', 1)->orderBy('created_at', 'desc');
|
||||
|
||||
if ($request->has('user_id') && $request->user_id != null) {
|
||||
$products = $products->where('user_id', $request->user_id);
|
||||
$seller_id = $request->user_id;
|
||||
}
|
||||
|
||||
if ($request->type != null){
|
||||
$var = explode(",", $request->type);
|
||||
$col_name = $var[0];
|
||||
$query = $var[1];
|
||||
$products = $products->orderBy($col_name, $query);
|
||||
$sort_type = $request->type;
|
||||
}
|
||||
if ($request->search != null){
|
||||
$products = $products
|
||||
->where('name', 'like', '%'.$request->search.'%');
|
||||
$sort_search = $request->search;
|
||||
}
|
||||
|
||||
$products = $products->paginate(15);
|
||||
|
||||
return view('wholesale.products.index', compact('products','type', 'col_name', 'query', 'sort_search','seller_id'));
|
||||
}
|
||||
|
||||
public function in_house_wholesale_products(Request $request)
|
||||
{
|
||||
CoreComponentRepository::instantiateShopRepository();
|
||||
|
||||
$type = 'In House';
|
||||
$col_name = null;
|
||||
$query = null;
|
||||
$sort_search = null;
|
||||
|
||||
$products = Product::where('wholesale_product', 1)->where('added_by','admin')->orderBy('created_at', 'desc');
|
||||
|
||||
if ($request->type != null){
|
||||
$var = explode(",", $request->type);
|
||||
$col_name = $var[0];
|
||||
$query = $var[1];
|
||||
$products = $products->orderBy($col_name, $query);
|
||||
$sort_type = $request->type;
|
||||
}
|
||||
if ($request->search != null){
|
||||
$products = $products
|
||||
->where('name', 'like', '%'.$request->search.'%');
|
||||
$sort_search = $request->search;
|
||||
}
|
||||
|
||||
$products = $products->paginate(15);
|
||||
|
||||
return view('wholesale.products.index', compact('products','type', 'col_name', 'query', 'sort_search'));
|
||||
}
|
||||
|
||||
public function seller_wholesale_products(Request $request)
|
||||
{
|
||||
CoreComponentRepository::instantiateShopRepository();
|
||||
|
||||
$type = 'Seller';
|
||||
$col_name = null;
|
||||
$query = null;
|
||||
$sort_search = null;
|
||||
$seller_id = null;
|
||||
|
||||
$products = Product::where('wholesale_product', 1)->where('added_by','seller')->orderBy('created_at', 'desc');
|
||||
|
||||
if ($request->has('user_id') && $request->user_id != null) {
|
||||
$products = $products->where('user_id', $request->user_id);
|
||||
$seller_id = $request->user_id;
|
||||
}
|
||||
|
||||
if ($request->type != null){
|
||||
$var = explode(",", $request->type);
|
||||
$col_name = $var[0];
|
||||
$query = $var[1];
|
||||
$products = $products->orderBy($col_name, $query);
|
||||
$sort_type = $request->type;
|
||||
}
|
||||
if ($request->search != null){
|
||||
$products = $products
|
||||
->where('name', 'like', '%'.$request->search.'%');
|
||||
$sort_search = $request->search;
|
||||
}
|
||||
|
||||
$products = $products->paginate(15);
|
||||
|
||||
return view('wholesale.products.index', compact('products','type', 'col_name', 'query', 'sort_search','seller_id'));
|
||||
}
|
||||
|
||||
// Wholesale Products list in Seller panel
|
||||
public function wholesale_products_list_seller(Request $request)
|
||||
{
|
||||
$sort_search = null;
|
||||
$col_name = null;
|
||||
$query = null;
|
||||
$products = Product::where('wholesale_product',1)->where('user_id',Auth::user()->id)->orderBy('created_at', 'desc');
|
||||
if ($request->type != null){
|
||||
$var = explode(",", $request->type);
|
||||
$col_name = $var[0];
|
||||
$query = $var[1];
|
||||
$products = $products->orderBy($col_name, $query);
|
||||
$sort_type = $request->type;
|
||||
}
|
||||
if ($request->search != null){
|
||||
$products = $products
|
||||
->where('name', 'like', '%'.$request->search.'%');
|
||||
$sort_search = $request->search;
|
||||
}
|
||||
|
||||
$products = $products->paginate(15);
|
||||
|
||||
return view('wholesale.frontend.seller_products.index', compact('products', 'sort_search','col_name'));
|
||||
}
|
||||
|
||||
public function product_create_admin()
|
||||
{
|
||||
CoreComponentRepository::initializeCache();
|
||||
|
||||
$categories = Category::where('parent_id', 0)
|
||||
->where('digital', 0)
|
||||
->with('childrenCategories')
|
||||
->get();
|
||||
return view('wholesale.products.create', compact('categories'));
|
||||
|
||||
}
|
||||
|
||||
public function product_create_seller()
|
||||
{
|
||||
$categories = Category::where('parent_id', 0)
|
||||
->where('digital', 0)
|
||||
->with('childrenCategories')
|
||||
->get();
|
||||
|
||||
if(get_setting('seller_wholesale_product') == 1){
|
||||
if(addon_is_activated('seller_subscription')){
|
||||
if(Auth::user()->shop->seller_package != null && Auth::user()->shop->seller_package->product_upload_limit > Auth::user()->products()->count()){
|
||||
return view('wholesale.frontend.seller_products.create', compact('categories'));
|
||||
}
|
||||
else {
|
||||
flash(translate('Upload limit has been reached. Please upgrade your package.'))->warning();
|
||||
return back();
|
||||
}
|
||||
}
|
||||
else{
|
||||
return view('wholesale.frontend.seller_products.create', compact('categories'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function product_store_admin(WholesaleProductRequest $request)
|
||||
{
|
||||
$product = (new WholesaleService)->store($request->except([
|
||||
'_token', 'button', 'flat_shipping_cost', 'tax_id', 'tax', 'tax_type', 'flash_deal_id', 'flash_discount', 'flash_discount_type'
|
||||
]));
|
||||
$request->merge(['product_id' => $product->id]);
|
||||
|
||||
//VAT & Tax
|
||||
if ($request->tax_id) {
|
||||
(new productTaxService)->store($request->only([
|
||||
'tax_id', 'tax', 'tax_type', 'product_id'
|
||||
]));
|
||||
}
|
||||
|
||||
//Flash Deal
|
||||
(new productFlashDealService)->store($request->only([
|
||||
'flash_deal_id', 'flash_discount', 'flash_discount_type'
|
||||
]), $product);
|
||||
|
||||
// Product Translations
|
||||
$request->merge(['lang' => env('DEFAULT_LANGUAGE')]);
|
||||
ProductTranslation::create($request->only([
|
||||
'lang', 'name', 'unit', 'description', 'product_id'
|
||||
]));
|
||||
|
||||
flash(translate('Product has been inserted successfully'))->success();
|
||||
|
||||
Artisan::call('view:clear');
|
||||
Artisan::call('cache:clear');
|
||||
|
||||
return redirect()->route('wholesale_products.in_house');
|
||||
}
|
||||
|
||||
public function product_store_seller(WholesaleProductRequest $request)
|
||||
{
|
||||
if (addon_is_activated('seller_subscription')) {
|
||||
if (
|
||||
(Auth::user()->shop->seller_package == null) ||
|
||||
(Auth::user()->shop->seller_package->product_upload_limit <= Auth::user()->products()->count())
|
||||
) {
|
||||
flash(translate('Upload limit has been reached. Please upgrade your package.'))->warning();
|
||||
return back();
|
||||
}
|
||||
}
|
||||
|
||||
$product = (new WholesaleService)->store($request->except([
|
||||
'_token', 'tax_id', 'tax', 'tax_type', 'flash_deal_id', 'flash_discount', 'flash_discount_type'
|
||||
]));
|
||||
$request->merge(['product_id' => $product->id]);
|
||||
//VAT & Tax
|
||||
if ($request->tax_id) {
|
||||
(new productTaxService)->store($request->only([
|
||||
'tax_id', 'tax', 'tax_type', 'product_id'
|
||||
]));
|
||||
}
|
||||
|
||||
// Product Translations
|
||||
$request->merge(['lang' => env('DEFAULT_LANGUAGE')]);
|
||||
ProductTranslation::create($request->only([
|
||||
'lang', 'name', 'unit', 'description', 'product_id'
|
||||
]));
|
||||
|
||||
flash(translate('Product has been inserted successfully'))->success();
|
||||
|
||||
Artisan::call('view:clear');
|
||||
Artisan::call('cache:clear');
|
||||
|
||||
return redirect()->route('seller.wholesale_products_list');
|
||||
}
|
||||
|
||||
|
||||
public function product_edit_admin(Request $request, $id)
|
||||
{
|
||||
CoreComponentRepository::initializeCache();
|
||||
|
||||
$product = Product::findOrFail($id);
|
||||
if($product->digital == 1) {
|
||||
return redirect('digitalproducts/' . $id . '/edit');
|
||||
}
|
||||
|
||||
$lang = $request->lang;
|
||||
$tags = json_decode($product->tags);
|
||||
$categories = Category::where('parent_id', 0)
|
||||
->where('digital', 0)
|
||||
->with('childrenCategories')
|
||||
->get();
|
||||
|
||||
return view('wholesale.products.edit', compact('product', 'categories', 'tags','lang'));
|
||||
}
|
||||
|
||||
public function product_edit_seller(Request $request, $id)
|
||||
{
|
||||
$product = Product::findOrFail($id);
|
||||
if($product->digital == 1) {
|
||||
return redirect('digitalproducts/' . $id . '/edit');
|
||||
}
|
||||
|
||||
$lang = $request->lang;
|
||||
$tags = json_decode($product->tags);
|
||||
$categories = Category::where('parent_id', 0)
|
||||
->where('digital', 0)
|
||||
->with('childrenCategories')
|
||||
->get();
|
||||
|
||||
return view('wholesale.frontend.seller_products.edit', compact('product', 'categories', 'tags','lang'));
|
||||
}
|
||||
|
||||
|
||||
public function product_update_admin(WholesaleProductRequest $request, $id)
|
||||
{
|
||||
(new WholesaleService)->update($request, $id);
|
||||
flash(translate('Product has been updated successfully'))->success();
|
||||
|
||||
Artisan::call('view:clear');
|
||||
Artisan::call('cache:clear');
|
||||
return back();
|
||||
}
|
||||
|
||||
public function product_update_seller(WholesaleProductRequest $request, $id)
|
||||
{
|
||||
(new WholesaleService)->update($request, $id);
|
||||
flash(translate('Product has been updated successfully'))->success();
|
||||
|
||||
Artisan::call('view:clear');
|
||||
Artisan::call('cache:clear');
|
||||
return back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function product_destroy_admin($id)
|
||||
{
|
||||
(new WholesaleService)->destroy($id);
|
||||
flash(translate('Product has been deleted successfully'))->success();
|
||||
|
||||
Artisan::call('view:clear');
|
||||
Artisan::call('cache:clear');
|
||||
return back();
|
||||
}
|
||||
|
||||
public function product_destroy_seller($id)
|
||||
{
|
||||
(new WholesaleService)->destroy($id);
|
||||
flash(translate('Product has been deleted successfully'))->success();
|
||||
|
||||
Artisan::call('view:clear');
|
||||
Artisan::call('cache:clear');
|
||||
return back();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use App\Models\User;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class WholesaleProductRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$approved = 1;
|
||||
if (auth()->user()->user_type == 'seller') {
|
||||
$added_by = 'seller';
|
||||
$user_id = auth()->user()->id;
|
||||
if (get_setting('product_approve_by_admin') == 1) {
|
||||
$approved = 0;
|
||||
}
|
||||
} else {
|
||||
$added_by = 'admin';
|
||||
$user_id = User::where('user_type', 'admin')->first()->id;
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'slug' => ($this->slug == null) ? preg_replace('/[^A-Za-z0-9\-]/', '', str_replace(' ', '-', strtolower($this->name))) : $this->slug,
|
||||
'user_id' => $user_id,
|
||||
'approved' => $approved,
|
||||
'wholesale_product' => 1,
|
||||
'added_by' => $added_by,
|
||||
'shipping_cost' => ($this->shipping_type == 'free') ? 0 : $this->flat_shipping_cost,
|
||||
'published' => ($this->button == 'unpublish') ? 0 : 1,
|
||||
]);
|
||||
}
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
|
||||
$rules = [];
|
||||
|
||||
$rules['name'] = 'required|max:255';
|
||||
$rules['slug'] = ['required', 'max:255', Rule::unique('products')->ignore($this->id)];
|
||||
$rules['category_id'] = 'required';
|
||||
$rules['unit'] = 'required';
|
||||
$rules['min_qty'] = 'required|numeric';
|
||||
$rules['unit_price'] = 'required|numeric|gt:0';
|
||||
$rules['wholesale_min_qty.*'] = 'required';
|
||||
$rules['wholesale_max_qty.*'] = 'required';
|
||||
$rules['wholesale_price.*'] = 'required';
|
||||
$rules['current_stock'] = 'required|numeric';
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation messages of rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Product name is required',
|
||||
'category_id.required' => 'Category is required',
|
||||
'unit.required' => 'Unit field is required',
|
||||
'min_qty.required' => 'Minimum purchase quantity is required',
|
||||
'min_qty.numeric' => 'Minimum purchase must be numeric',
|
||||
'unit_price.required' => 'Unit price is required',
|
||||
'unit_price.numeric' => 'Unit price must be numeric',
|
||||
'current_stock.required' => 'Current stock is required',
|
||||
'current_stock.numeric' => 'Current stock must be numeric',
|
||||
'wholesale_min_qty.*.required' => 'Product minimum qantity is required',
|
||||
'wholesale_max_qty.*.required' => 'Product maximum qantity is required',
|
||||
'wholesale_price.*.required' => 'Product price is required'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the error messages for the defined validation rules.*
|
||||
* @return array
|
||||
*/
|
||||
public function failedValidation(Validator $validator)
|
||||
{
|
||||
// dd($this->expectsJson());
|
||||
if ($this->expectsJson()) {
|
||||
throw new HttpResponseException(response()->json([
|
||||
'message' => $validator->errors()->all(),
|
||||
'result' => false
|
||||
], 422));
|
||||
} else {
|
||||
throw (new ValidationException($validator))
|
||||
->errorBag($this->errorBag)
|
||||
->redirectTo($this->getRedirectUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Cart;
|
||||
use App\Models\FlashDealProduct;
|
||||
use App\Models\ProductStock;
|
||||
use App\Models\ProductTax;
|
||||
use App\Models\ProductTranslation;
|
||||
use App\Models\Product;
|
||||
use App\Models\User;
|
||||
use App\Models\WholesalePrice;
|
||||
use Artisan;
|
||||
use Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class WholesaleService
|
||||
{
|
||||
public function store(array $data)
|
||||
{
|
||||
$collection = collect($data);
|
||||
|
||||
$tags = array();
|
||||
if ($collection['tags'][0] != null) {
|
||||
foreach (json_decode($collection['tags'][0]) as $key => $tag) {
|
||||
array_push($tags, $tag->value);
|
||||
}
|
||||
}
|
||||
$collection['tags'] = implode(',', $tags);
|
||||
|
||||
if ($collection['meta_title'] == null) {
|
||||
$collection['meta_title'] = $collection['name'];
|
||||
}
|
||||
if ($collection['meta_description'] == null) {
|
||||
$collection['meta_description'] = strip_tags($collection['description']);
|
||||
}
|
||||
|
||||
if ($collection['meta_img'] == null) {
|
||||
$collection['meta_img'] = $collection['thumbnail_img'];
|
||||
}
|
||||
|
||||
$data = $collection->toArray();
|
||||
|
||||
$product = Product::create($data);
|
||||
|
||||
$product_stock = new ProductStock;
|
||||
$product_stock->product_id = $product->id;
|
||||
$product_stock->variant = '';
|
||||
$product_stock->price = $collection['unit_price'];
|
||||
$product_stock->sku = $collection['sku'];
|
||||
$product_stock->qty = $collection['current_stock'];
|
||||
$product_stock->save();
|
||||
|
||||
if(request()->has('wholesale_price')){
|
||||
foreach(request()->wholesale_price as $key => $price){
|
||||
$wholesale_price = new WholesalePrice;
|
||||
$wholesale_price->product_stock_id = $product_stock->id;
|
||||
$wholesale_price->min_qty = request()->wholesale_min_qty[$key];
|
||||
$wholesale_price->max_qty = request()->wholesale_max_qty[$key];
|
||||
$wholesale_price->price = $price;
|
||||
$wholesale_price->save();
|
||||
}
|
||||
}
|
||||
|
||||
return $product;
|
||||
|
||||
}
|
||||
|
||||
public function update(Request $request , $id){
|
||||
$product = Product::findOrFail($id);
|
||||
$product->category_id = $request->category_id;
|
||||
$product->brand_id = $request->brand_id;
|
||||
$product->barcode = $request->barcode;
|
||||
$product->cash_on_delivery = 0;
|
||||
$product->featured = 0;
|
||||
$product->todays_deal = 0;
|
||||
$product->is_quantity_multiplied = 0;
|
||||
|
||||
if (addon_is_activated('refund_request')) {
|
||||
if ($request->refundable != null) {
|
||||
$product->refundable = 1;
|
||||
}
|
||||
else {
|
||||
$product->refundable = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if($request->lang == env("DEFAULT_LANGUAGE")){
|
||||
$product->name = $request->name;
|
||||
$product->unit = $request->unit;
|
||||
$product->description = $request->description;
|
||||
$product->slug = preg_replace('/[^A-Za-z0-9\-]/', '', str_replace(' ', '-', strtolower($request->slug)));
|
||||
}
|
||||
|
||||
if($request->slug == null){
|
||||
$product->slug = preg_replace('/[^A-Za-z0-9\-]/', '', str_replace(' ', '-', strtolower($request->name)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$product->photos = $request->photos;
|
||||
$product->thumbnail_img = $request->thumbnail_img;
|
||||
$product->min_qty = $request->min_qty;
|
||||
$product->low_stock_quantity = $request->low_stock_quantity;
|
||||
$product->stock_visibility_state = $request->stock_visibility_state;
|
||||
|
||||
$tags = array();
|
||||
if($request->tags[0] != null){
|
||||
foreach (json_decode($request->tags[0]) as $key => $tag) {
|
||||
array_push($tags, $tag->value);
|
||||
}
|
||||
}
|
||||
$product->tags = implode(',', $tags);
|
||||
|
||||
$product->video_provider = $request->video_provider;
|
||||
$product->video_link = $request->video_link;
|
||||
$product->unit_price = $request->unit_price;
|
||||
$product->discount = $request->discount;
|
||||
$product->discount_type = $request->discount_type;
|
||||
|
||||
if ($request->date_range != null) {
|
||||
$date_var = explode(" to ", $request->date_range);
|
||||
$product->discount_start_date = strtotime($date_var[0]);
|
||||
$product->discount_end_date = strtotime( $date_var[1]);
|
||||
}
|
||||
|
||||
$product->shipping_type = $request->shipping_type;
|
||||
$product->est_shipping_days = $request->est_shipping_days;
|
||||
|
||||
if (addon_is_activated('club_point')) {
|
||||
if($request->earn_point) {
|
||||
$product->earn_point = $request->earn_point;
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->has('shipping_type')) {
|
||||
if($request->shipping_type == 'free'){
|
||||
$product->shipping_cost = 0;
|
||||
}
|
||||
elseif ($request->shipping_type == 'flat_rate') {
|
||||
$product->shipping_cost = $request->flat_shipping_cost;
|
||||
}
|
||||
elseif ($request->shipping_type == 'product_wise') {
|
||||
$product->shipping_cost = json_encode($request->shipping_cost);
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->has('is_quantity_multiplied')) {
|
||||
$product->is_quantity_multiplied = 1;
|
||||
}
|
||||
if ($request->has('cash_on_delivery')) {
|
||||
$product->cash_on_delivery = 1;
|
||||
}
|
||||
|
||||
if ($request->has('featured')) {
|
||||
$product->featured = 1;
|
||||
}
|
||||
|
||||
if ($request->has('todays_deal')) {
|
||||
$product->todays_deal = 1;
|
||||
}
|
||||
|
||||
$product->meta_title = $request->meta_title;
|
||||
$product->meta_description = $request->meta_description;
|
||||
$product->meta_img = $request->meta_img;
|
||||
|
||||
if($product->meta_title == null) {
|
||||
$product->meta_title = $product->name;
|
||||
}
|
||||
|
||||
if($product->meta_description == null) {
|
||||
$product->meta_description = strip_tags($product->description);
|
||||
}
|
||||
|
||||
if($product->meta_img == null) {
|
||||
$product->meta_img = $product->thumbnail_img;
|
||||
}
|
||||
|
||||
$product->pdf = $request->pdf;
|
||||
|
||||
$colors = array();
|
||||
$product->colors = json_encode($colors);
|
||||
|
||||
$choice_options = array();
|
||||
$product->choice_options = json_encode($choice_options, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
$product_stock = $product->stocks->first();
|
||||
$product_stock->price = $request->unit_price;
|
||||
$product_stock->sku = $request->sku;
|
||||
$product_stock->qty = $request->current_stock;
|
||||
$product_stock->save();
|
||||
|
||||
$product->save();
|
||||
|
||||
foreach ($product->stocks->first()->wholesalePrices as $key => $wholesalePrice) {
|
||||
$wholesalePrice->delete();
|
||||
}
|
||||
|
||||
if($request->has('wholesale_price')){
|
||||
foreach($request->wholesale_price as $key => $price){
|
||||
$wholesale_price = new WholesalePrice;
|
||||
$wholesale_price->product_stock_id = $product_stock->id;
|
||||
$wholesale_price->min_qty = $request->wholesale_min_qty[$key];
|
||||
$wholesale_price->max_qty = $request->wholesale_max_qty[$key];
|
||||
$wholesale_price->price = $price;
|
||||
$wholesale_price->save();
|
||||
}
|
||||
}
|
||||
|
||||
//Flash Deal
|
||||
if($request->flash_deal_id) {
|
||||
if($product->flash_deal_product){
|
||||
$flash_deal_product = FlashDealProduct::findOrFail($product->flash_deal_product->id);
|
||||
if(!$flash_deal_product) {
|
||||
$flash_deal_product = new FlashDealProduct;
|
||||
}
|
||||
} else {
|
||||
$flash_deal_product = new FlashDealProduct;
|
||||
}
|
||||
|
||||
$flash_deal_product->flash_deal_id = $request->flash_deal_id;
|
||||
$flash_deal_product->product_id = $product->id;
|
||||
$flash_deal_product->discount = $request->flash_discount;
|
||||
$flash_deal_product->discount_type = $request->flash_discount_type;
|
||||
$flash_deal_product->save();
|
||||
}
|
||||
|
||||
//VAT & Tax
|
||||
if($request->tax_id) {
|
||||
ProductTax::where('product_id', $product->id)->delete();
|
||||
foreach ($request->tax_id as $key => $val) {
|
||||
$product_tax = new ProductTax;
|
||||
$product_tax->tax_id = $val;
|
||||
$product_tax->product_id = $product->id;
|
||||
$product_tax->tax = $request->tax[$key];
|
||||
$product_tax->tax_type = $request->tax_type[$key];
|
||||
$product_tax->save();
|
||||
}
|
||||
}
|
||||
|
||||
// Product Translations
|
||||
$product_translation = ProductTranslation::firstOrNew(['lang' => $request->lang, 'product_id' => $product->id]);
|
||||
$product_translation->name = $request->name;
|
||||
$product_translation->unit = $request->unit;
|
||||
$product_translation->description = $request->description;
|
||||
$product_translation->save();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function destroy($id){
|
||||
$product = Product::findOrFail($id);
|
||||
foreach ($product->product_translations as $key => $product_translations) {
|
||||
$product_translations->delete();
|
||||
}
|
||||
|
||||
foreach ($product->stocks as $key => $stock) {
|
||||
$stock->delete();
|
||||
}
|
||||
|
||||
Product::destroy($id);
|
||||
Cart::where('product_id', $id)->delete();
|
||||
}
|
||||
}
|
||||
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.1.sql
Normal file
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.1.sql
Normal file
@@ -0,0 +1 @@
|
||||
COMMIT;
|
||||
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.2.sql
Normal file
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.2.sql
Normal file
@@ -0,0 +1 @@
|
||||
COMMIT;
|
||||
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.3.sql
Normal file
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.3.sql
Normal file
@@ -0,0 +1 @@
|
||||
COMMIT;
|
||||
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.4.sql
Normal file
1
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/1.4.sql
Normal file
@@ -0,0 +1 @@
|
||||
COMMIT;
|
||||
31
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/update.sql
Normal file
31
desarrollo2/temp/UHzDZdgQCB/addons/wholesale/sql/update.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
CREATE TABLE `wholesale_prices` (
|
||||
`id` int(11) NOT NULL,
|
||||
`product_stock_id` int(11) NOT NULL,
|
||||
`min_qty` int(11) NOT NULL DEFAULT '0',
|
||||
`max_qty` int(11) NOT NULL DEFAULT '0',
|
||||
`price` double(20,2) NOT NULL DEFAULT '0.00',
|
||||
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
--
|
||||
-- Indexes for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Indexes for table `wholesale_prices`
|
||||
--
|
||||
ALTER TABLE `wholesale_prices`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `wholesale_prices`
|
||||
--
|
||||
ALTER TABLE `wholesale_prices`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
COMMIT;
|
||||
@@ -0,0 +1,652 @@
|
||||
@extends('seller.layouts.app')
|
||||
@section('panel_content')
|
||||
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<h5 class="mb-0 h6">{{translate('Add New Wholesale Product')}}</h5>
|
||||
</div>
|
||||
<div class="">
|
||||
<!-- Error Meassages -->
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<form class="form form-horizontal mar-top" action="{{route('wholesale_product_store.seller')}}" method="POST" enctype="multipart/form-data" id="choice_form">
|
||||
<div class="row gutters-5">
|
||||
<div class="col-lg-8">
|
||||
@csrf
|
||||
<input type="hidden" name="added_by" value="seller">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Information')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Product Name')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="name" placeholder="{{ translate('Product Name') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="category">
|
||||
<label class="col-md-3 col-from-label">{{translate('Category')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control aiz-selectpicker" name="category_id" id="category_id" data-live-search="true" required>
|
||||
@foreach ($categories as $category)
|
||||
<option value="{{ $category->id }}">{{ $category->getTranslation('name') }}</option>
|
||||
@foreach ($category->childrenCategories as $childCategory)
|
||||
@include('categories.child_category', ['child_category' => $childCategory])
|
||||
@endforeach
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="brand">
|
||||
<label class="col-md-3 col-from-label">{{translate('Brand')}}</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control aiz-selectpicker" name="brand_id" id="brand_id" data-live-search="true">
|
||||
<option value="">{{ translate('Select Brand') }}</option>
|
||||
@foreach (\App\Models\Brand::all() as $brand)
|
||||
<option value="{{ $brand->id }}">{{ $brand->getTranslation('name') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Unit')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="unit" placeholder="{{ translate('Unit (e.g. KG, Pc etc)') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Minimum Purchase Qty')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="number" lang="en" class="form-control" name="min_qty" value="1" min="1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Tags')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control aiz-tag-input" name="tags[]" placeholder="{{ translate('Type and hit enter to add a tag') }}">
|
||||
<small class="text-muted">{{translate('This is used for search. Input those words by which cutomer can find this product.')}}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (addon_is_activated('pos_system'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Barcode')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="barcode" placeholder="{{ translate('Barcode') }}">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (addon_is_activated('refund_request'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Refundable')}}</label>
|
||||
<div class="col-md-8">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="refundable" checked>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Images')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Gallery Images')}} <small>(600x600)</small></label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image" data-multiple="true">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="photos" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
<small class="text-muted">{{translate('These images are visible in product details page gallery. Use 600x600 sizes images.')}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Thumbnail Image')}} <small>(300x300)</small></label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="thumbnail_img" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
<small class="text-muted">{{translate('This image is visible in all product box. Use 300x300 sizes image. Keep some blank space around main object of your image as we had to crop some edge in different devices to make it responsive.')}}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Videos')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Video Provider')}}</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control aiz-selectpicker" name="video_provider" id="video_provider">
|
||||
<option value="youtube">{{translate('Youtube')}}</option>
|
||||
<option value="dailymotion">{{translate('Dailymotion')}}</option>
|
||||
<option value="vimeo">{{translate('Vimeo')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Video Link')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="video_link" placeholder="{{ translate('Video Link') }}">
|
||||
<small class="text-muted">{{translate("Use proper link without extra parameter. Don't use short share link/embeded iframe code.")}}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product price + stock')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Unit price')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="0.01" placeholder="{{ translate('Unit price') }}" name="unit_price" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(addon_is_activated('club_point'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Set Point')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="1" placeholder="{{ translate('1') }}" name="earn_point" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Quantity')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="1" placeholder="{{ translate('Quantity') }}" name="current_stock" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('SKU')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" placeholder="{{ translate('SKU') }}" name="sku" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Wholesale Prices')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<div class="qunatity-price">
|
||||
<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min QTY')}}" name="wholesale_min_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max QTY') }}" name="wholesale_max_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-soft-secondary btn-sm"
|
||||
data-toggle="add-more"
|
||||
data-content='<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min Qty')}}" name="wholesale_min_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max Qty') }}" name="wholesale_max_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>'
|
||||
data-target=".qunatity-price">
|
||||
{{ translate('Add More') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Description')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Description')}}</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="aiz-text-editor" name="description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Shipping Cost')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('PDF Specification')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('PDF Specification')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="document">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="pdf" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('SEO Meta Tags')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Meta Title')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="meta_title" placeholder="{{ translate('Meta Title') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Description')}}</label>
|
||||
<div class="col-md-8">
|
||||
<textarea name="meta_description" rows="8" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{ translate('Meta Image') }}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="meta_img" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">
|
||||
{{translate('Shipping Configuration')}}
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (get_setting('shipping_type') == 'product_wise_shipping')
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Free Shipping')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="free" checked>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Flat Rate')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="flat_rate">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flat_rate_shipping_div" style="display: none">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Shipping cost')}}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="0.01" placeholder="{{ translate('Shipping cost') }}" name="flat_shipping_cost" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Is Product Quantity Mulitiply')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="is_quantity_multiplied" value="1">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Product wise shipping cost is disable. Shipping cost is configured from here') }}
|
||||
<a href="{{route('shipping_configuration.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Shipping Configuration')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Low Stock Quantity Warning')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Quantity')}}
|
||||
</label>
|
||||
<input type="number" name="low_stock_quantity" value="1" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">
|
||||
{{translate('Stock Visibility State')}}
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock Quantity')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="quantity" checked>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock With Text Only')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="text">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Hide Stock')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="hide">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Cash On Delivery')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (get_setting('cash_payment') == '1')
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="cash_on_delivery" value="1" checked="">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Cash On Delivery option is disabled. Activate this feature from here') }}
|
||||
<a href="{{route('activation.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Cash Payment Activation')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Featured')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="featured" value="1">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Todays Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="todays_deal" value="1">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Flash Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Add To Flash')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_deal_id" id="flash_deal">
|
||||
<option value="">Choose Flash Title</option>
|
||||
@foreach(\App\Models\FlashDeal::where("status", 1)->get() as $flash_deal)
|
||||
<option value="{{ $flash_deal->id}}">
|
||||
{{ $flash_deal->title }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount')}}
|
||||
</label>
|
||||
<input type="number" name="flash_discount" value="0" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount Type')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_discount_type" id="flash_discount_type">
|
||||
<option value="">Choose Discount Type</option>
|
||||
<option value="amount">{{translate('Flat')}}</option>
|
||||
<option value="percent">{{translate('Percent')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Estimate Shipping Time')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Shipping Days')}}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input type="number" class="form-control" name="est_shipping_days" min="1" step="1" placeholder="{{translate('Shipping Days')}}">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="inputGroupPrepend">{{translate('Days')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('VAT & Tax')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@foreach(\App\Models\Tax::where('tax_status', 1)->get() as $tax)
|
||||
<label for="name">
|
||||
{{$tax->name}}
|
||||
<input type="hidden" value="{{$tax->id}}" name="tax_id[]">
|
||||
</label>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="0.01" placeholder="{{ translate('Tax') }}" name="tax[]" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<select class="form-control aiz-selectpicker" name="tax_type[]">
|
||||
<option value="amount">{{translate('Flat')}}</option>
|
||||
<option value="percent">{{translate('Percent')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="btn-toolbar float-right mb-3" role="toolbar" aria-label="Toolbar with button groups">
|
||||
<div class="btn-group mr-2" role="group" aria-label="First group">
|
||||
<button type="submit" name="button" value="draft" class="btn btn-warning">{{ translate('Save As Draft') }}</button>
|
||||
</div>
|
||||
<div class="btn-group mr-2" role="group" aria-label="Third group">
|
||||
<button type="submit" name="button" value="unpublish" class="btn btn-primary">{{ translate('Save & Unpublish') }}</button>
|
||||
</div>
|
||||
<div class="btn-group" role="group" aria-label="Second group">
|
||||
<button type="submit" name="button" value="publish" class="btn btn-success">{{ translate('Save & Publish') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
$('form').bind('submit', function (e) {
|
||||
// Disable the submit button while evaluating if the form should be submitted
|
||||
$("button[type='submit']").prop('disabled', true);
|
||||
|
||||
var valid = true;
|
||||
|
||||
if (!valid) {
|
||||
e.preventDefault();
|
||||
|
||||
// Reactivate the button if the form was not submitted
|
||||
$("button[type='submit']").button.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
$("[name=shipping_type]").on("change", function (){
|
||||
$(".flat_rate_shipping_div").hide();
|
||||
|
||||
if($(this).val() == 'flat_rate'){
|
||||
$(".flat_rate_shipping_div").show();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,686 @@
|
||||
@extends('seller.layouts.app')
|
||||
@section('panel_content')
|
||||
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<h1 class="mb-0 h6">{{ translate('Edit Product') }}</h5>
|
||||
</div>
|
||||
<div class="">
|
||||
<!-- Error Meassages -->
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<form class="form form-horizontal mar-top" action="{{route('wholesale_product_update.seller', $product->id)}}" method="POST" enctype="multipart/form-data" id="choice_form">
|
||||
<div class="row gutters-5">
|
||||
<div class="col-lg-8">
|
||||
<input name="_method" type="hidden" value="POST">
|
||||
<input type="hidden" name="id" value="{{ $product->id }}">
|
||||
<input type="hidden" name="lang" value="{{ $lang }}">
|
||||
@csrf
|
||||
<div class="card">
|
||||
<ul class="nav nav-tabs nav-fill border-light">
|
||||
@foreach (\App\Models\Language::all() as $key => $language)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-reset @if ($language->code == $lang) active @else bg-soft-dark border-light border-left-0 @endif py-3" href="{{ route('wholesale_product_edit.seller', ['id'=>$product->id, 'lang'=> $language->code] ) }}">
|
||||
<img src="{{ static_asset('assets/img/flags/'.$language->code.'.png') }}" height="11" class="mr-1">
|
||||
<span>{{$language->name}}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Product Name')}} <i class="las la-language text-danger" title="{{translate('Translatable')}}"></i></label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="name" placeholder="{{translate('Product Name')}}" value="{{ $product->getTranslation('name', $lang) }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="category">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Category')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<select class="form-control aiz-selectpicker" name="category_id" id="category_id" data-selected="{{ $product->category_id }}" data-live-search="true" required>
|
||||
@foreach ($categories as $category)
|
||||
<option value="{{ $category->id }}">{{ $category->getTranslation('name') }}</option>
|
||||
@foreach ($category->childrenCategories as $childCategory)
|
||||
@include('categories.child_category', ['child_category' => $childCategory])
|
||||
@endforeach
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="brand">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Brand')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<select class="form-control aiz-selectpicker" name="brand_id" id="brand_id" data-live-search="true">
|
||||
<option value="">{{ translate('Select Brand') }}</option>
|
||||
@foreach (\App\Models\Brand::all() as $brand)
|
||||
<option value="{{ $brand->id }}" @if($product->brand_id == $brand->id) selected @endif>{{ $brand->getTranslation('name') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Unit')}} <i class="las la-language text-danger" title="{{translate('Translatable')}}"></i> </label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="unit" placeholder="{{ translate('Unit (e.g. KG, Pc etc)') }}" value="{{$product->getTranslation('unit', $lang)}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Minimum Purchase Qty')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="number" lang="en" class="form-control" name="min_qty" value="@if($product->min_qty <= 1){{1}}@else{{$product->min_qty}}@endif" min="1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Tags')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control aiz-tag-input" name="tags[]" id="tags" value="{{ $product->tags }}" placeholder="{{ translate('Type to add a tag') }}" data-role="tagsinput">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (addon_is_activated('pos_system'))
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Barcode')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="barcode" placeholder="{{ translate('Barcode') }}" value="{{ $product->barcode }}">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (addon_is_activated('refund_request'))
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Refundable')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="aiz-switch aiz-switch-success mb-0" style="margin-top:5px;">
|
||||
<input type="checkbox" name="refundable" @if ($product->refundable == 1) checked @endif>
|
||||
<span class="slider round"></span></label>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Images')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Gallery Images')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image" data-multiple="true">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="photos" value="{{ $product->photos }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Thumbnail Image')}} <small>(290x300)</small></label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="thumbnail_img" value="{{ $product->thumbnail_img }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Videos')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Video Provider')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<select class="form-control aiz-selectpicker" name="video_provider" id="video_provider">
|
||||
<option value="youtube" <?php if ($product->video_provider == 'youtube') echo "selected"; ?> >{{translate('Youtube')}}</option>
|
||||
<option value="dailymotion" <?php if ($product->video_provider == 'dailymotion') echo "selected"; ?> >{{translate('Dailymotion')}}</option>
|
||||
<option value="vimeo" <?php if ($product->video_provider == 'vimeo') echo "selected"; ?> >{{translate('Vimeo')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Video Link')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="video_link" value="{{ $product->video_link }}" placeholder="{{ translate('Video Link') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product price + stock')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Unit price')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" placeholder="{{translate('Unit price')}}" name="unit_price" class="form-control" value="{{$product->unit_price}}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(addon_is_activated('club_point'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Set Point')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="{{ $product->earn_point }}" step="1" placeholder="{{ translate('1') }}" name="earn_point" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div id="show-hide-div">
|
||||
<div class="form-group row" id="quantity">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Quantity')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="number" lang="en" value="{{ optional($product->stocks->first())->qty }}" step="1" placeholder="{{translate('Quantity')}}" name="current_stock" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('SKU')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" placeholder="{{ translate('SKU') }}" value="{{ optional($product->stocks->first())->sku }}" name="sku" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Wholesale Prices')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<div class="qunatity-price">
|
||||
@foreach ($product->stocks->first()->wholesalePrices as $wholesalePrice)
|
||||
<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min QTY')}}" name="wholesale_min_qty[]" value="{{ $wholesalePrice->min_qty }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max QTY') }}" name="wholesale_max_qty[]" value="{{ $wholesalePrice->max_qty }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" value="{{ $wholesalePrice->price }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-soft-secondary btn-sm"
|
||||
data-toggle="add-more"
|
||||
data-content='<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min Qty')}}" name="wholesale_min_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max Qty') }}" name="wholesale_max_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>'
|
||||
data-target=".qunatity-price">
|
||||
{{ translate('Add More') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Description')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Description')}} <i class="las la-language text-danger" title="{{translate('Translatable')}}"></i></label>
|
||||
<div class="col-lg-9">
|
||||
<textarea class="aiz-text-editor" name="description">{{ $product->getTranslation('description', $lang) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Shipping Cost')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('PDF Specification')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('PDF Specification')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="pdf" value="{{ $product->pdf }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('SEO Meta Tags')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Meta Title')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="meta_title" value="{{ $product->meta_title }}" placeholder="{{translate('Meta Title')}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Description')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<textarea name="meta_description" rows="8" class="form-control">{{ $product->meta_description }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Meta Images')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image" data-multiple="true">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="meta_img" value="{{ $product->meta_img }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label">{{translate('Slug')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" placeholder="{{translate('Slug')}}" id="slug" name="slug" value="{{ $product->slug }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6" class="dropdown-toggle" data-toggle="collapse" data-target="#collapse_2">
|
||||
{{translate('Shipping Configuration')}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body collapse show" id="collapse_2">
|
||||
@if (get_setting('shipping_type') == 'product_wise_shipping')
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-6 col-from-label">{{translate('Free Shipping')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="free" @if($product->shipping_type == 'free') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-6 col-from-label">{{translate('Flat Rate')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="flat_rate" @if($product->shipping_type == 'flat_rate') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flat_rate_shipping_div" style="display: none">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-6 col-from-label">{{translate('Shipping cost')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="number" lang="en" min="0" value="{{ $product->shipping_cost }}" step="0.01" placeholder="{{ translate('Shipping cost') }}" name="flat_shipping_cost" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Is Product Quantity Mulitiply')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="is_quantity_multiplied" value="1" @if($product->is_quantity_multiplied == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Product wise shipping cost is disable. Shipping cost is configured from here') }}
|
||||
<a href="{{route('shipping_configuration.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Shipping Configuration')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Low Stock Quantity Warning')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Quantity')}}
|
||||
</label>
|
||||
<input type="number" name="low_stock_quantity" value="{{ $product->low_stock_quantity }}" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">
|
||||
{{translate('Stock Visibility State')}}
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock Quantity')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="quantity" @if($product->stock_visibility_state == 'quantity') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock With Text Only')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="text" @if($product->stock_visibility_state == 'text') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Hide Stock')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="hide" @if($product->stock_visibility_state == 'hide') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Cash On Delivery')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (get_setting('cash_payment') == '1')
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="cash_on_delivery" value="1" @if($product->cash_on_delivery == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Cash On Delivery option is disabled. Activate this feature from here') }}
|
||||
<a href="{{route('activation.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Cash Payment Activation')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Featured')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="featured" value="1" @if($product->featured == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Todays Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="todays_deal" value="1" @if($product->todays_deal == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Flash Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Add To Flash')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_deal_id" id="video_provider">
|
||||
<option value="">Choose Flash Title</option>
|
||||
@foreach(\App\Models\FlashDeal::where("status", 1)->get() as $flash_deal)
|
||||
<option value="{{ $flash_deal->id}}" @if($product->flash_deal_product && $product->flash_deal_product->flash_deal_id == $flash_deal->id) selected @endif>
|
||||
{{ $flash_deal->title }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount')}}
|
||||
</label>
|
||||
<input type="number" name="flash_discount" value="{{$product->flash_deal_product ? $product->flash_deal_product->discount : '0'}}" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount Type')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_discount_type" id="">
|
||||
<option value="">Choose Discount Type</option>
|
||||
<option value="amount" @if($product->flash_deal_product && $product->flash_deal_product->discount_type == 'amount') selected @endif>
|
||||
{{translate('Flat')}}
|
||||
</option>
|
||||
<option value="percent" @if($product->flash_deal_product && $product->flash_deal_product->discount_type == 'percent') selected @endif>
|
||||
{{translate('Percent')}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Estimate Shipping Time')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Shipping Days')}}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input type="number" class="form-control" name="est_shipping_days" value="{{ $product->est_shipping_days }}" min="1" step="1" placeholder="{{translate('Shipping Days')}}">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="inputGroupPrepend">{{translate('Days')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('VAT & Tax')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@foreach(\App\Models\Tax::where('tax_status', 1)->get() as $tax)
|
||||
<label for="name">
|
||||
{{$tax->name}}
|
||||
<input type="hidden" value="{{$tax->id}}" name="tax_id[]">
|
||||
</label>
|
||||
|
||||
@php
|
||||
$tax_amount = 0;
|
||||
$tax_type = '';
|
||||
foreach($tax->product_taxes as $row) {
|
||||
if($product->id == $row->product_id) {
|
||||
$tax_amount = $row->tax;
|
||||
$tax_type = $row->tax_type;
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<input type="number" lang="en" min="0" value="{{ $tax_amount }}" step="0.01" placeholder="{{ translate('Tax') }}" name="tax[]" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<select class="form-control aiz-selectpicker" name="tax_type[]">
|
||||
<option value="amount" @if($tax_type == 'amount') selected @endif>
|
||||
{{translate('Flat')}}
|
||||
</option>
|
||||
<option value="percent" @if($tax_type == 'percent') selected @endif>
|
||||
{{translate('Percent')}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="mb-3 text-right">
|
||||
<button type="submit" name="button" class="btn btn-info">{{ translate('Update Product') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
$(document).ready(function (){
|
||||
show_hide_shipping_div();
|
||||
$('.remove-files').on('click', function(){
|
||||
$(this).parents(".col-md-4").remove();
|
||||
});
|
||||
});
|
||||
|
||||
$("[name=shipping_type]").on("change", function (){
|
||||
show_hide_shipping_div();
|
||||
});
|
||||
|
||||
function show_hide_shipping_div() {
|
||||
var shipping_val = $("[name=shipping_type]:checked").val();
|
||||
|
||||
$(".flat_rate_shipping_div").hide();
|
||||
|
||||
if(shipping_val == 'flat_rate'){
|
||||
$(".flat_rate_shipping_div").show();
|
||||
}
|
||||
}
|
||||
|
||||
AIZ.plugins.tagify();
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,220 @@
|
||||
@extends('seller.layouts.app')
|
||||
@section('panel_content')
|
||||
|
||||
<div class="row gutters-10 justify-content-center">
|
||||
@if (addon_is_activated('seller_subscription'))
|
||||
<div class="col-md-4 mx-auto mb-3" >
|
||||
<div class="bg-grad-1 text-white rounded-lg overflow-hidden">
|
||||
<span class="size-30px rounded-circle mx-auto bg-soft-primary d-flex align-items-center justify-content-center mt-3">
|
||||
<i class="las la-upload la-2x text-white"></i>
|
||||
</span>
|
||||
<div class="px-3 pt-3 pb-3">
|
||||
<div class="h4 fw-700 text-center">{{ optional(Auth::user()->shop->seller_package)->product_upload_limit - Auth::user()->products()->count() }}</div>
|
||||
<div class="opacity-50 text-center">{{ translate('Remaining Uploads') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-4 mx-auto mb-3" >
|
||||
<a href="{{ route('wholesale_product_create.seller')}}">
|
||||
<div class="p-3 rounded mb-3 c-pointer text-center bg-white shadow-sm hov-shadow-lg has-transition">
|
||||
<span class="size-60px rounded-circle mx-auto bg-secondary d-flex align-items-center justify-content-center mb-3">
|
||||
<i class="las la-plus la-3x text-white"></i>
|
||||
</span>
|
||||
<div class="fs-18 text-primary">{{ translate('Add New Wholesale Product') }}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if (addon_is_activated('seller_subscription'))
|
||||
@php
|
||||
$seller_package = \App\Models\SellerPackage::find(Auth::user()->shop->seller_package_id);
|
||||
@endphp
|
||||
<div class="col-md-4">
|
||||
<a href="{{ route('seller.seller_packages_list') }}" class="text-center bg-white shadow-sm hov-shadow-lg text-center d-block p-3 rounded">
|
||||
@if($seller_package != null)
|
||||
<img src="{{ uploaded_asset($seller_package->logo) }}" height="44" class="mw-100 mx-auto">
|
||||
<span class="d-block sub-title mb-2">{{ translate('Current Package')}}: {{ $seller_package->getTranslation('name') }}</span>
|
||||
@else
|
||||
<i class="la la-frown-o mb-2 la-3x"></i>
|
||||
<div class="d-block sub-title mb-2">{{ translate('No Package Found')}}</div>
|
||||
@endif
|
||||
<div class="btn btn-outline-primary py-1">{{ translate('Upgrade Package')}}</div>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<form class="" id="sort_products" action="" method="GET">
|
||||
<div class="card-header row gutters-5">
|
||||
<div class="col">
|
||||
<h5 class="mb-md-0 h6">{{ translate('All Wholesale Product') }}</h5>
|
||||
</div>
|
||||
<div class="col-md-2 ml-auto">
|
||||
<select class="form-control form-control-sm aiz-selectpicker mb-2 mb-md-0" name="type" id="type" onchange="sort_products()">
|
||||
<option value="">{{ translate('Sort By') }}</option>
|
||||
<option value="rating,desc" @isset($col_name , $query) @if($col_name == 'rating' && $query == 'desc') selected @endif @endisset>{{translate('Rating (High > Low)')}}</option>
|
||||
<option value="rating,asc" @isset($col_name , $query) @if($col_name == 'rating' && $query == 'asc') selected @endif @endisset>{{translate('Rating (Low > High)')}}</option>
|
||||
<option value="num_of_sale,desc"@isset($col_name , $query) @if($col_name == 'num_of_sale' && $query == 'desc') selected @endif @endisset>{{translate('Num of Sale (High > Low)')}}</option>
|
||||
<option value="num_of_sale,asc"@isset($col_name , $query) @if($col_name == 'num_of_sale' && $query == 'asc') selected @endif @endisset>{{translate('Num of Sale (Low > High)')}}</option>
|
||||
<option value="unit_price,desc"@isset($col_name , $query) @if($col_name == 'unit_price' && $query == 'desc') selected @endif @endisset>{{translate('Base Price (High > Low)')}}</option>
|
||||
<option value="unit_price,asc"@isset($col_name , $query) @if($col_name == 'unit_price' && $query == 'asc') selected @endif @endisset>{{translate('Base Price (Low > High)')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group mb-0">
|
||||
<input type="text" class="form-control form-control-sm" id="search" name="search"@isset($sort_search) value="{{ $sort_search }}" @endisset placeholder="{{ translate('Type & Enter') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table aiz-table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-breakpoints="lg">#</th>
|
||||
<th>{{translate('Name')}}</th>
|
||||
<th data-breakpoints="sm">{{translate('Info')}}</th>
|
||||
<th data-breakpoints="md">{{translate('Total Stock')}}</th>
|
||||
@if(get_setting('product_approve_by_admin'))
|
||||
<th data-breakpoints="lg">{{translate('Approved')}}</th>
|
||||
@endif
|
||||
<th data-breakpoints="lg">{{translate('Published')}}</th>
|
||||
<th data-breakpoints="lg">{{translate('Featured')}}</th>
|
||||
<th data-breakpoints="sm" class="text-right">{{translate('Options')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($products as $key => $product)
|
||||
<tr>
|
||||
<td>{{ ($key+1) + ($products->currentPage() - 1)*$products->perPage() }}</td>
|
||||
<td>
|
||||
<div class="row gutters-5 w-200px w-md-300px mw-100">
|
||||
<div class="col-auto">
|
||||
<img src="{{ uploaded_asset($product->thumbnail_img)}}" alt="Image" class="size-50px img-fit">
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="text-muted text-truncate-2">{{ $product->getTranslation('name') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<strong>{{translate('Num of Sale')}}:</strong> {{ $product->num_of_sale }} {{translate('times')}} </br>
|
||||
<strong>{{translate('Base Price')}}:</strong> {{ single_price($product->unit_price) }} </br>
|
||||
<strong>{{translate('Rating')}}:</strong> {{ $product->rating }} </br>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$qty = 0;
|
||||
if($product->variant_product) {
|
||||
foreach ($product->stocks as $key => $stock) {
|
||||
$qty += $stock->qty;
|
||||
echo $stock->variant.' - '.$stock->qty.'<br>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$qty = optional($product->stocks->first())->qty;
|
||||
echo $qty;
|
||||
}
|
||||
@endphp
|
||||
@if($qty <= $product->low_stock_quantity)
|
||||
<span class="badge badge-inline badge-danger">Low</span>
|
||||
@endif
|
||||
</td>
|
||||
@if(get_setting('product_approve_by_admin') == 1)
|
||||
<td>
|
||||
@if ($product->approved == 1)
|
||||
<span class="badge badge-inline badge-success">{{ translate('Approved')}}</span>
|
||||
@else
|
||||
<span class="badge badge-inline badge-info">{{ translate('Pending')}}</span>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input onchange="update_published(this)" value="{{ $product->id }}" type="checkbox" <?php if ($product->published == 1) echo "checked"; ?> >
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input onchange="update_featured(this)" value="{{ $product->id }}" type="checkbox" <?php if ($product->seller_featured == 1) echo "checked"; ?> >
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-soft-success btn-icon btn-circle btn-sm" href="{{ route('product', $product->slug) }}" target="_blank" title="{{ translate('View') }}">
|
||||
<i class="las la-eye"></i>
|
||||
</a>
|
||||
<a class="btn btn-soft-info btn-icon btn-circle btn-sm" href="{{route('wholesale_product_edit.seller', ['id'=>$product->id, 'lang'=>env('DEFAULT_LANGUAGE')] )}}" title="{{ translate('Edit') }}">
|
||||
<i class="las la-edit"></i>
|
||||
</a>
|
||||
<a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="{{route('wholesale_product_destroy.seller', $product->id)}}" title="{{ translate('Delete') }}">
|
||||
<i class="las la-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="aiz-pagination">
|
||||
{{ $products->appends(request()->input())->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('modal')
|
||||
@include('modals.delete_modal')
|
||||
@endsection
|
||||
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
|
||||
function update_published(el){
|
||||
if(el.checked){
|
||||
var status = 1;
|
||||
}
|
||||
else{
|
||||
var status = 0;
|
||||
}
|
||||
$.post('{{ route('products.published') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
|
||||
if(data == 1){
|
||||
AIZ.plugins.notify('success', '{{ translate('Published products updated successfully') }}');
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function update_featured(el){
|
||||
if(el.checked){
|
||||
var status = 1;
|
||||
}
|
||||
else{
|
||||
var status = 0;
|
||||
}
|
||||
$.post('{{ route('seller.products.featured') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
|
||||
if(data == 1){
|
||||
AIZ.plugins.notify('success', '{{ translate('Featured products updated successfully') }}');
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sort_products(el){
|
||||
$('#sort_products').submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,649 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<h5 class="mb-0 h6">{{translate('Add New Wholesale Product')}}</h5>
|
||||
</div>
|
||||
<div class="">
|
||||
<!-- Error Meassages -->
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<form class="form form-horizontal mar-top" action="{{route('wholesale_product_store.admin')}}" method="POST" enctype="multipart/form-data" id="choice_form">
|
||||
<div class="row gutters-5">
|
||||
<div class="col-lg-8">
|
||||
@csrf
|
||||
<input type="hidden" name="added_by" value="admin">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Information')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Product Name')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="name" placeholder="{{ translate('Product Name') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="category">
|
||||
<label class="col-md-3 col-from-label">{{translate('Category')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control aiz-selectpicker" name="category_id" id="category_id" data-live-search="true" required>
|
||||
@foreach ($categories as $category)
|
||||
<option value="{{ $category->id }}">{{ $category->getTranslation('name') }}</option>
|
||||
@foreach ($category->childrenCategories as $childCategory)
|
||||
@include('categories.child_category', ['child_category' => $childCategory])
|
||||
@endforeach
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="brand">
|
||||
<label class="col-md-3 col-from-label">{{translate('Brand')}}</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control aiz-selectpicker" name="brand_id" id="brand_id" data-live-search="true">
|
||||
<option value="">{{ translate('Select Brand') }}</option>
|
||||
@foreach (\App\Models\Brand::all() as $brand)
|
||||
<option value="{{ $brand->id }}">{{ $brand->getTranslation('name') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Unit')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="unit" placeholder="{{ translate('Unit (e.g. KG, Pc etc)') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Minimum Purchase Qty')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="number" lang="en" class="form-control" name="min_qty" value="1" min="1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Tags')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control aiz-tag-input" name="tags[]" placeholder="{{ translate('Type and hit enter to add a tag') }}">
|
||||
<small class="text-muted">{{translate('This is used for search. Input those words by which cutomer can find this product.')}}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (addon_is_activated('pos_system'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Barcode')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="barcode" placeholder="{{ translate('Barcode') }}">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (addon_is_activated('refund_request'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Refundable')}}</label>
|
||||
<div class="col-md-8">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="refundable" checked>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Images')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Gallery Images')}} <small>(600x600)</small></label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image" data-multiple="true">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="photos" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
<small class="text-muted">{{translate('These images are visible in product details page gallery. Use 600x600 sizes images.')}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Thumbnail Image')}} <small>(300x300)</small></label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="thumbnail_img" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
<small class="text-muted">{{translate('This image is visible in all product box. Use 300x300 sizes image. Keep some blank space around main object of your image as we had to crop some edge in different devices to make it responsive.')}}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Videos')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Video Provider')}}</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control aiz-selectpicker" name="video_provider" id="video_provider">
|
||||
<option value="youtube">{{translate('Youtube')}}</option>
|
||||
<option value="dailymotion">{{translate('Dailymotion')}}</option>
|
||||
<option value="vimeo">{{translate('Vimeo')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Video Link')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="video_link" placeholder="{{ translate('Video Link') }}">
|
||||
<small class="text-muted">{{translate("Use proper link without extra parameter. Don't use short share link/embeded iframe code.")}}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product price + stock')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Unit price')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="0.01" placeholder="{{ translate('Unit price') }}" name="unit_price" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(addon_is_activated('club_point'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Set Point')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="1" placeholder="{{ translate('1') }}" name="earn_point" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Quantity')}} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="1" placeholder="{{ translate('Quantity') }}" name="current_stock" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('SKU')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" placeholder="{{ translate('SKU') }}" name="sku" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Wholesale Prices')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<div class="qunatity-price">
|
||||
<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min QTY')}}" name="wholesale_min_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max QTY') }}" name="wholesale_max_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-soft-secondary btn-sm"
|
||||
data-toggle="add-more"
|
||||
data-content='<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min Qty')}}" name="wholesale_min_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max Qty') }}" name="wholesale_max_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>'
|
||||
data-target=".qunatity-price">
|
||||
{{ translate('Add More') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Description')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Description')}}</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="aiz-text-editor" name="description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Shipping Cost')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('PDF Specification')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('PDF Specification')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="document">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="pdf" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('SEO Meta Tags')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Meta Title')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="meta_title" placeholder="{{ translate('Meta Title') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">{{translate('Description')}}</label>
|
||||
<div class="col-md-8">
|
||||
<textarea name="meta_description" rows="8" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{ translate('Meta Image') }}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="meta_img" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">
|
||||
{{translate('Shipping Configuration')}}
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (get_setting('shipping_type') == 'product_wise_shipping')
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Free Shipping')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="free" checked>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Flat Rate')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="flat_rate">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flat_rate_shipping_div" style="display: none">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Shipping cost')}}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="0.01" placeholder="{{ translate('Shipping cost') }}" name="flat_shipping_cost" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Is Product Quantity Mulitiply')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="is_quantity_multiplied" value="1">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Product wise shipping cost is disable. Shipping cost is configured from here') }}
|
||||
<a href="{{route('shipping_configuration.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Shipping Configuration')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Low Stock Quantity Warning')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Quantity')}}
|
||||
</label>
|
||||
<input type="number" name="low_stock_quantity" value="1" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">
|
||||
{{translate('Stock Visibility State')}}
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock Quantity')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="quantity" checked>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock With Text Only')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="text">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Hide Stock')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="hide">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Cash On Delivery')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (get_setting('cash_payment') == '1')
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="cash_on_delivery" value="1" checked="">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Cash On Delivery option is disabled. Activate this feature from here') }}
|
||||
<a href="{{route('activation.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Cash Payment Activation')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Featured')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="featured" value="1">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Todays Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="todays_deal" value="1">
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Flash Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Add To Flash')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_deal_id" id="flash_deal">
|
||||
<option value="">Choose Flash Title</option>
|
||||
@foreach(\App\Models\FlashDeal::where("status", 1)->get() as $flash_deal)
|
||||
<option value="{{ $flash_deal->id}}">
|
||||
{{ $flash_deal->title }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount')}}
|
||||
</label>
|
||||
<input type="number" name="flash_discount" value="0" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount Type')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_discount_type" id="flash_discount_type">
|
||||
<option value="">Choose Discount Type</option>
|
||||
<option value="amount">{{translate('Flat')}}</option>
|
||||
<option value="percent">{{translate('Percent')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Estimate Shipping Time')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Shipping Days')}}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input type="number" class="form-control" name="est_shipping_days" min="1" step="1" placeholder="{{translate('Shipping Days')}}">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="inputGroupPrepend">{{translate('Days')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('VAT & Tax')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@foreach(\App\Models\Tax::where('tax_status', 1)->get() as $tax)
|
||||
<label for="name">
|
||||
{{$tax->name}}
|
||||
<input type="hidden" value="{{$tax->id}}" name="tax_id[]">
|
||||
</label>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<input type="number" lang="en" min="0" value="0" step="0.01" placeholder="{{ translate('Tax') }}" name="tax[]" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<select class="form-control aiz-selectpicker" name="tax_type[]">
|
||||
<option value="amount">{{translate('Flat')}}</option>
|
||||
<option value="percent">{{translate('Percent')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="btn-toolbar float-right mb-3" role="toolbar" aria-label="Toolbar with button groups">
|
||||
<div class="btn-group mr-2" role="group" aria-label="Third group">
|
||||
<button type="submit" name="button" value="unpublish" class="btn btn-primary">{{ translate('Save & Unpublish') }}</button>
|
||||
</div>
|
||||
<div class="btn-group" role="group" aria-label="Second group">
|
||||
<button type="submit" name="button" value="publish" class="btn btn-success">{{ translate('Save & Publish') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
$('form').bind('submit', function (e) {
|
||||
// Disable the submit button while evaluating if the form should be submitted
|
||||
$("button[type='submit']").prop('disabled', true);
|
||||
|
||||
var valid = true;
|
||||
|
||||
if (!valid) {
|
||||
e.preventDefault();
|
||||
|
||||
// Reactivate the button if the form was not submitted
|
||||
$("button[type='submit']").button.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
$("[name=shipping_type]").on("change", function (){
|
||||
$(".flat_rate_shipping_div").hide();
|
||||
|
||||
if($(this).val() == 'flat_rate'){
|
||||
$(".flat_rate_shipping_div").show();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,686 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<h1 class="mb-0 h6">{{ translate('Edit Product') }}</h5>
|
||||
</div>
|
||||
<div class="">
|
||||
<!-- Error Meassages -->
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<form class="form form-horizontal mar-top" action="{{route('wholesale_product_update.admin', $product->id)}}" method="POST" enctype="multipart/form-data" id="choice_form">
|
||||
<div class="row gutters-5">
|
||||
<div class="col-lg-8">
|
||||
<input name="_method" type="hidden" value="POST">
|
||||
<input type="hidden" name="id" value="{{ $product->id }}">
|
||||
<input type="hidden" name="lang" value="{{ $lang }}">
|
||||
@csrf
|
||||
<div class="card">
|
||||
<ul class="nav nav-tabs nav-fill border-light">
|
||||
@foreach (\App\Models\Language::all() as $key => $language)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-reset @if ($language->code == $lang) active @else bg-soft-dark border-light border-left-0 @endif py-3" href="{{ route('wholesale_product_edit.admin', ['id'=>$product->id, 'lang'=> $language->code] ) }}">
|
||||
<img src="{{ static_asset('assets/img/flags/'.$language->code.'.png') }}" height="11" class="mr-1">
|
||||
<span>{{$language->name}}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Product Name')}} <i class="las la-language text-danger" title="{{translate('Translatable')}}"></i></label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="name" placeholder="{{translate('Product Name')}}" value="{{ $product->getTranslation('name', $lang) }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="category">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Category')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<select class="form-control aiz-selectpicker" name="category_id" id="category_id" data-selected="{{ $product->category_id }}" data-live-search="true" required>
|
||||
@foreach ($categories as $category)
|
||||
<option value="{{ $category->id }}">{{ $category->getTranslation('name') }}</option>
|
||||
@foreach ($category->childrenCategories as $childCategory)
|
||||
@include('categories.child_category', ['child_category' => $childCategory])
|
||||
@endforeach
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="brand">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Brand')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<select class="form-control aiz-selectpicker" name="brand_id" id="brand_id" data-live-search="true">
|
||||
<option value="">{{ translate('Select Brand') }}</option>
|
||||
@foreach (\App\Models\Brand::all() as $brand)
|
||||
<option value="{{ $brand->id }}" @if($product->brand_id == $brand->id) selected @endif>{{ $brand->getTranslation('name') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Unit')}} <i class="las la-language text-danger" title="{{translate('Translatable')}}"></i> </label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="unit" placeholder="{{ translate('Unit (e.g. KG, Pc etc)') }}" value="{{$product->getTranslation('unit', $lang)}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Minimum Purchase Qty')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="number" lang="en" class="form-control" name="min_qty" value="@if($product->min_qty <= 1){{1}}@else{{$product->min_qty}}@endif" min="1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Tags')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control aiz-tag-input" name="tags[]" id="tags" value="{{ $product->tags }}" placeholder="{{ translate('Type to add a tag') }}" data-role="tagsinput">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (addon_is_activated('pos_system'))
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Barcode')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="barcode" placeholder="{{ translate('Barcode') }}" value="{{ $product->barcode }}">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (addon_is_activated('refund_request'))
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Refundable')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="aiz-switch aiz-switch-success mb-0" style="margin-top:5px;">
|
||||
<input type="checkbox" name="refundable" @if ($product->refundable == 1) checked @endif>
|
||||
<span class="slider round"></span></label>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Images')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Gallery Images')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image" data-multiple="true">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="photos" value="{{ $product->photos }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Thumbnail Image')}} <small>(290x300)</small></label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="thumbnail_img" value="{{ $product->thumbnail_img }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Videos')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Video Provider')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<select class="form-control aiz-selectpicker" name="video_provider" id="video_provider">
|
||||
<option value="youtube" <?php if ($product->video_provider == 'youtube') echo "selected"; ?> >{{translate('Youtube')}}</option>
|
||||
<option value="dailymotion" <?php if ($product->video_provider == 'dailymotion') echo "selected"; ?> >{{translate('Dailymotion')}}</option>
|
||||
<option value="vimeo" <?php if ($product->video_provider == 'vimeo') echo "selected"; ?> >{{translate('Vimeo')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Video Link')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="video_link" value="{{ $product->video_link }}" placeholder="{{ translate('Video Link') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product price + stock')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Unit price')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" placeholder="{{translate('Unit price')}}" name="unit_price" class="form-control" value="{{$product->unit_price}}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(addon_is_activated('club_point'))
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Set Point')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" lang="en" min="0" value="{{ $product->earn_point }}" step="1" placeholder="{{ translate('1') }}" name="earn_point" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div id="show-hide-div">
|
||||
<div class="form-group row" id="quantity">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Quantity')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="number" lang="en" value="{{ optional($product->stocks->first())->qty }}" step="1" placeholder="{{translate('Quantity')}}" name="current_stock" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('SKU')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" placeholder="{{ translate('SKU') }}" value="{{ optional($product->stocks->first())->sku }}" name="sku" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-from-label">
|
||||
{{translate('Wholesale Prices')}}
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<div class="qunatity-price">
|
||||
@foreach ($product->stocks->first()->wholesalePrices as $wholesalePrice)
|
||||
<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min QTY')}}" name="wholesale_min_qty[]" value="{{ $wholesalePrice->min_qty }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max QTY') }}" name="wholesale_max_qty[]" value="{{ $wholesalePrice->max_qty }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" value="{{ $wholesalePrice->price }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-soft-secondary btn-sm"
|
||||
data-toggle="add-more"
|
||||
data-content='<div class="row gutters-5">
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{translate('Min Qty')}}" name="wholesale_min_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Max Qty') }}" name="wholesale_max_qty[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="{{ translate('Price per piece') }}" name="wholesale_price[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="mt-1 btn btn-icon btn-circle btn-sm btn-soft-danger" data-toggle="remove-parent" data-parent=".row">
|
||||
<i class="las la-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>'
|
||||
data-target=".qunatity-price">
|
||||
{{ translate('Add More') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Description')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Description')}} <i class="las la-language text-danger" title="{{translate('Translatable')}}"></i></label>
|
||||
<div class="col-lg-9">
|
||||
<textarea class="aiz-text-editor" name="description">{{ $product->getTranslation('description', $lang) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Product Shipping Cost')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('PDF Specification')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('PDF Specification')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="pdf" value="{{ $product->pdf }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('SEO Meta Tags')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Meta Title')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="meta_title" value="{{ $product->meta_title }}" placeholder="{{translate('Meta Title')}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label">{{translate('Description')}}</label>
|
||||
<div class="col-lg-8">
|
||||
<textarea name="meta_description" rows="8" class="form-control">{{ $product->meta_description }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Meta Images')}}</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image" data-multiple="true">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="meta_img" value="{{ $product->meta_img }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label">{{translate('Slug')}}</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" placeholder="{{translate('Slug')}}" id="slug" name="slug" value="{{ $product->slug }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6" class="dropdown-toggle" data-toggle="collapse" data-target="#collapse_2">
|
||||
{{translate('Shipping Configuration')}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body collapse show" id="collapse_2">
|
||||
@if (get_setting('shipping_type') == 'product_wise_shipping')
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-6 col-from-label">{{translate('Free Shipping')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="free" @if($product->shipping_type == 'free') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-6 col-from-label">{{translate('Flat Rate')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="shipping_type" value="flat_rate" @if($product->shipping_type == 'flat_rate') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flat_rate_shipping_div" style="display: none">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-6 col-from-label">{{translate('Shipping cost')}}</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="number" lang="en" min="0" value="{{ $product->shipping_cost }}" step="0.01" placeholder="{{ translate('Shipping cost') }}" name="flat_shipping_cost" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Is Product Quantity Mulitiply')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="is_quantity_multiplied" value="1" @if($product->is_quantity_multiplied == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Product wise shipping cost is disable. Shipping cost is configured from here') }}
|
||||
<a href="{{route('shipping_configuration.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Shipping Configuration')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Low Stock Quantity Warning')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Quantity')}}
|
||||
</label>
|
||||
<input type="number" name="low_stock_quantity" value="{{ $product->low_stock_quantity }}" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">
|
||||
{{translate('Stock Visibility State')}}
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock Quantity')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="quantity" @if($product->stock_visibility_state == 'quantity') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Show Stock With Text Only')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="text" @if($product->stock_visibility_state == 'text') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Hide Stock')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="radio" name="stock_visibility_state" value="hide" @if($product->stock_visibility_state == 'hide') checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Cash On Delivery')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (get_setting('cash_payment') == '1')
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="cash_on_delivery" value="1" @if($product->cash_on_delivery == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>
|
||||
{{ translate('Cash On Delivery option is disabled. Activate this feature from here') }}
|
||||
<a href="{{route('activation.index')}}" class="aiz-side-nav-link {{ areActiveRoutes(['shipping_configuration.index','shipping_configuration.edit','shipping_configuration.update'])}}">
|
||||
<span class="aiz-side-nav-text">{{translate('Cash Payment Activation')}}</span>
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Featured')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="featured" value="1" @if($product->featured == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Todays Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-6 col-from-label">{{translate('Status')}}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input type="checkbox" name="todays_deal" value="1" @if($product->todays_deal == 1) checked @endif>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Flash Deal')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Add To Flash')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_deal_id" id="video_provider">
|
||||
<option value="">Choose Flash Title</option>
|
||||
@foreach(\App\Models\FlashDeal::where("status", 1)->get() as $flash_deal)
|
||||
<option value="{{ $flash_deal->id}}" @if($product->flash_deal_product && $product->flash_deal_product->flash_deal_id == $flash_deal->id) selected @endif>
|
||||
{{ $flash_deal->title }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount')}}
|
||||
</label>
|
||||
<input type="number" name="flash_discount" value="{{$product->flash_deal_product ? $product->flash_deal_product->discount : '0'}}" min="0" step="1" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Discount Type')}}
|
||||
</label>
|
||||
<select class="form-control aiz-selectpicker" name="flash_discount_type" id="">
|
||||
<option value="">Choose Discount Type</option>
|
||||
<option value="amount" @if($product->flash_deal_product && $product->flash_deal_product->discount_type == 'amount') selected @endif>
|
||||
{{translate('Flat')}}
|
||||
</option>
|
||||
<option value="percent" @if($product->flash_deal_product && $product->flash_deal_product->discount_type == 'percent') selected @endif>
|
||||
{{translate('Percent')}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Estimate Shipping Time')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">
|
||||
{{translate('Shipping Days')}}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input type="number" class="form-control" name="est_shipping_days" value="{{ $product->est_shipping_days }}" min="1" step="1" placeholder="{{translate('Shipping Days')}}">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="inputGroupPrepend">{{translate('Days')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('VAT & Tax')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@foreach(\App\Models\Tax::where('tax_status', 1)->get() as $tax)
|
||||
<label for="name">
|
||||
{{$tax->name}}
|
||||
<input type="hidden" value="{{$tax->id}}" name="tax_id[]">
|
||||
</label>
|
||||
|
||||
@php
|
||||
$tax_amount = 0;
|
||||
$tax_type = '';
|
||||
foreach($tax->product_taxes as $row) {
|
||||
if($product->id == $row->product_id) {
|
||||
$tax_amount = $row->tax;
|
||||
$tax_type = $row->tax_type;
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<input type="number" lang="en" min="0" value="{{ $tax_amount }}" step="0.01" placeholder="{{ translate('Tax') }}" name="tax[]" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<select class="form-control aiz-selectpicker" name="tax_type[]">
|
||||
<option value="amount" @if($tax_type == 'amount') selected @endif>
|
||||
{{translate('Flat')}}
|
||||
</option>
|
||||
<option value="percent" @if($tax_type == 'percent') selected @endif>
|
||||
{{translate('Percent')}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="mb-3 text-right">
|
||||
<button type="submit" name="button" class="btn btn-info">{{ translate('Update Product') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
$(document).ready(function (){
|
||||
show_hide_shipping_div();
|
||||
$('.remove-files').on('click', function(){
|
||||
$(this).parents(".col-md-4").remove();
|
||||
});
|
||||
});
|
||||
|
||||
$("[name=shipping_type]").on("change", function (){
|
||||
show_hide_shipping_div();
|
||||
});
|
||||
|
||||
function show_hide_shipping_div() {
|
||||
var shipping_val = $("[name=shipping_type]:checked").val();
|
||||
|
||||
$(".flat_rate_shipping_div").hide();
|
||||
|
||||
if(shipping_val == 'flat_rate'){
|
||||
$(".flat_rate_shipping_div").show();
|
||||
}
|
||||
}
|
||||
|
||||
AIZ.plugins.tagify();
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,321 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto">
|
||||
<h1 class="h3">{{translate('All Wholesale Products')}}</h1>
|
||||
</div>
|
||||
@if($type != 'Seller' && auth()->user()->can('add_wholesale_product'))
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('wholesale_product_create.admin') }}" class="btn btn-circle btn-info">
|
||||
<span>{{translate('Add New Wholesale Product')}}</span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div class="card">
|
||||
<form class="" id="sort_products" action="" method="GET">
|
||||
<div class="card-header row gutters-5">
|
||||
<div class="col">
|
||||
<h5 class="mb-md-0 h6">{{ translate('All Wholesale Product') }}</h5>
|
||||
</div>
|
||||
|
||||
<div class="dropdown mb-2 mb-md-0">
|
||||
<button class="btn border dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
{{translate('Bulk Action')}}
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="#" onclick="bulk_delete()"> {{translate('Delete selection')}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($type != 'In House')
|
||||
<div class="col-md-2 ml-auto">
|
||||
<select class="form-control form-control-sm aiz-selectpicker mb-2 mb-md-0" id="user_id" name="user_id" onchange="sort_products()">
|
||||
<option value="">{{ translate('All Sellers') }}</option>
|
||||
@foreach (\App\Models\Seller::all() as $key => $seller)
|
||||
@if ($seller->user != null && $seller->user->shop != null)
|
||||
<option value="{{ $seller->user->id }}" @if ($seller->user->id == $seller_id) selected @endif>{{ $seller->user->shop->name }} ({{ $seller->user->name }})</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-md-2 ml-auto">
|
||||
<select class="form-control form-control-sm aiz-selectpicker mb-2 mb-md-0" name="type" id="type" onchange="sort_products()">
|
||||
<option value="">{{ translate('Sort By') }}</option>
|
||||
<option value="rating,desc" @isset($col_name , $query) @if($col_name == 'rating' && $query == 'desc') selected @endif @endisset>{{translate('Rating (High > Low)')}}</option>
|
||||
<option value="rating,asc" @isset($col_name , $query) @if($col_name == 'rating' && $query == 'asc') selected @endif @endisset>{{translate('Rating (Low > High)')}}</option>
|
||||
<option value="num_of_sale,desc"@isset($col_name , $query) @if($col_name == 'num_of_sale' && $query == 'desc') selected @endif @endisset>{{translate('Num of Sale (High > Low)')}}</option>
|
||||
<option value="num_of_sale,asc"@isset($col_name , $query) @if($col_name == 'num_of_sale' && $query == 'asc') selected @endif @endisset>{{translate('Num of Sale (Low > High)')}}</option>
|
||||
<option value="unit_price,desc"@isset($col_name , $query) @if($col_name == 'unit_price' && $query == 'desc') selected @endif @endisset>{{translate('Base Price (High > Low)')}}</option>
|
||||
<option value="unit_price,asc"@isset($col_name , $query) @if($col_name == 'unit_price' && $query == 'asc') selected @endif @endisset>{{translate('Base Price (Low > High)')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group mb-0">
|
||||
<input type="text" class="form-control form-control-sm" id="search" name="search"@isset($sort_search) value="{{ $sort_search }}" @endisset placeholder="{{ translate('Type & Enter') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table aiz-table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="form-group">
|
||||
<div class="aiz-checkbox-inline">
|
||||
<label class="aiz-checkbox">
|
||||
<input type="checkbox" class="check-all">
|
||||
<span class="aiz-square-check"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<!--<th data-breakpoints="lg">#</th>-->
|
||||
<th>{{translate('Name')}}</th>
|
||||
@if($type != 'In House')
|
||||
<th data-breakpoints="lg">{{translate('Added By')}}</th>
|
||||
@endif
|
||||
<th data-breakpoints="sm">{{translate('Info')}}</th>
|
||||
<th data-breakpoints="md">{{translate('Total Stock')}}</th>
|
||||
<th data-breakpoints="lg">{{translate('Todays Deal')}}</th>
|
||||
<th data-breakpoints="lg">{{translate('Published')}}</th>
|
||||
@if(get_setting('product_approve_by_admin') == 1 && $type == 'Seller')
|
||||
<th data-breakpoints="lg">{{translate('Approved')}}</th>
|
||||
@endif
|
||||
<th data-breakpoints="lg">{{translate('Featured')}}</th>
|
||||
<th data-breakpoints="sm" class="text-right">{{translate('Options')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($products as $key => $product)
|
||||
<tr>
|
||||
<!--<td>{{ ($key+1) + ($products->currentPage() - 1)*$products->perPage() }}</td>-->
|
||||
<td>
|
||||
<div class="form-group d-inline-block">
|
||||
<label class="aiz-checkbox">
|
||||
<input type="checkbox" class="check-one" name="id[]" value="{{$product->id}}">
|
||||
<span class="aiz-square-check"></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="row gutters-5 w-200px w-md-300px mw-100">
|
||||
<div class="col-auto">
|
||||
<img src="{{ uploaded_asset($product->thumbnail_img)}}" alt="Image" class="size-50px img-fit">
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="text-muted text-truncate-2">{{ $product->getTranslation('name') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@if($type != 'In House')
|
||||
<td>{{ $product->user->name }}</td>
|
||||
@endif
|
||||
<td>
|
||||
<strong>{{translate('Num of Sale')}}:</strong> {{ $product->num_of_sale }} {{translate('times')}} </br>
|
||||
<strong>{{translate('Base Price')}}:</strong> {{ single_price($product->unit_price) }} </br>
|
||||
<strong>{{translate('Rating')}}:</strong> {{ $product->rating }} </br>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$qty = 0;
|
||||
if($product->variant_product) {
|
||||
foreach ($product->stocks as $key => $stock) {
|
||||
$qty += $stock->qty;
|
||||
echo $stock->variant.' - '.$stock->qty.'<br>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
//$qty = $product->current_stock;
|
||||
$qty = optional($product->stocks->first())->qty;
|
||||
echo $qty;
|
||||
}
|
||||
@endphp
|
||||
@if($qty <= $product->low_stock_quantity)
|
||||
<span class="badge badge-inline badge-danger">Low</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input onchange="update_todays_deal(this)" value="{{ $product->id }}" type="checkbox" <?php if ($product->todays_deal == 1) echo "checked"; ?> >
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input onchange="update_published(this)" value="{{ $product->id }}" type="checkbox" <?php if ($product->published == 1) echo "checked"; ?> >
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
@if(get_setting('product_approve_by_admin') == 1 && $type == 'Seller')
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input onchange="update_approved(this)" value="{{ $product->id }}" type="checkbox" <?php if ($product->approved == 1) echo "checked"; ?> >
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input onchange="update_featured(this)" value="{{ $product->id }}" type="checkbox" <?php if ($product->featured == 1) echo "checked"; ?> >
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-soft-success btn-icon btn-circle btn-sm" href="{{ route('product', $product->slug) }}" target="_blank" title="{{ translate('View') }}">
|
||||
<i class="las la-eye"></i>
|
||||
</a>
|
||||
@can('edit_wholesale_product')
|
||||
<a class="btn btn-soft-primary btn-icon btn-circle btn-sm" href="{{route('wholesale_product_edit.admin', ['id'=>$product->id, 'lang'=>env('DEFAULT_LANGUAGE')] )}}" title="{{ translate('Edit') }}">
|
||||
<i class="las la-edit"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('delete_wholesale_product')
|
||||
<a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="{{route('wholesale_product_destroy.admin', $product->id)}}" title="{{ translate('Delete') }}">
|
||||
<i class="las la-trash"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="aiz-pagination">
|
||||
{{ $products->appends(request()->input())->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('modal')
|
||||
@include('modals.delete_modal')
|
||||
@endsection
|
||||
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
$(document).on("change", ".check-all", function() {
|
||||
if(this.checked) {
|
||||
// Iterate each checkbox
|
||||
$('.check-one:checkbox').each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$('.check-one:checkbox').each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function update_todays_deal(el){
|
||||
if(el.checked){
|
||||
var status = 1;
|
||||
}
|
||||
else{
|
||||
var status = 0;
|
||||
}
|
||||
$.post('{{ route('products.todays_deal') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
|
||||
if(data == 1){
|
||||
AIZ.plugins.notify('success', '{{ translate('Todays Deal updated successfully') }}');
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update_published(el){
|
||||
if(el.checked){
|
||||
var status = 1;
|
||||
}
|
||||
else{
|
||||
var status = 0;
|
||||
}
|
||||
$.post('{{ route('products.published') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
|
||||
if(data == 1){
|
||||
AIZ.plugins.notify('success', '{{ translate('Published products updated successfully') }}');
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update_approved(el){
|
||||
if(el.checked){
|
||||
var approved = 1;
|
||||
}
|
||||
else{
|
||||
var approved = 0;
|
||||
}
|
||||
$.post('{{ route('products.approved') }}', {
|
||||
_token : '{{ csrf_token() }}',
|
||||
id : el.value,
|
||||
approved : approved
|
||||
}, function(data){
|
||||
if(data == 1){
|
||||
AIZ.plugins.notify('success', '{{ translate('Product approval update successfully') }}');
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update_featured(el){
|
||||
if(el.checked){
|
||||
var status = 1;
|
||||
}
|
||||
else{
|
||||
var status = 0;
|
||||
}
|
||||
$.post('{{ route('products.featured') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
|
||||
if(data == 1){
|
||||
AIZ.plugins.notify('success', '{{ translate('Featured products updated successfully') }}');
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sort_products(el){
|
||||
$('#sort_products').submit();
|
||||
}
|
||||
|
||||
function bulk_delete() {
|
||||
var data = new FormData($('#sort_products')[0]);
|
||||
$.ajax({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
url: "{{route('bulk-product-delete')}}",
|
||||
type: 'POST',
|
||||
data: data,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (response) {
|
||||
if(response == 1) {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user