Inventory check implemented for table booking

This commit is contained in:
Jitendra Singh 2020-02-27 19:55:34 +05:30
parent 05be7a070a
commit dbb5f25594
10 changed files with 652 additions and 136 deletions

View File

@ -12,89 +12,615 @@ class AttributeTableSeeder extends Seeder
public function run()
{
DB::table('attributes')->delete();
DB::table('attribute_translations')->delete();
$now = Carbon::now();
DB::table('attributes')->insert([
['id' => '1','code' => 'sku','admin_name' => 'SKU','type' => 'text','validation' => NULL,'position' => '1','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '2','code' => 'name','admin_name' => 'Name','type' => 'text','validation' => NULL,'position' => '2','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '3','code' => 'url_key','admin_name' => 'URL Key','type' => 'text','validation' => NULL,'position' => '3','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '4','code' => 'tax_category_id','admin_name' => 'Tax Category','type' => 'select','validation' => NULL,'position' => '4','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '5','code' => 'new','admin_name' => 'New','type' => 'boolean','validation' => NULL,'position' => '5','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '6','code' => 'featured','admin_name' => 'Featured','type' => 'boolean','validation' => NULL,'position' => '6','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '7','code' => 'visible_individually','admin_name' => 'Visible Individually','type' => 'boolean','validation' => NULL,'position' => '7','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,
'use_in_flat' => '1','updated_at' => $now],
['id' => '8','code' => 'status','admin_name' => 'Status','type' => 'boolean','validation' => NULL,'position' => '8','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '9','code' => 'short_description','admin_name' => 'Short Description','type' => 'textarea','validation' => NULL,'position' => '9','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0',
'is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '10','code' => 'description','admin_name' => 'Description','type' => 'textarea','validation' => NULL,'position' => '10','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '11','code' => 'price','admin_name' => 'Price','type' => 'price','validation' => 'decimal','position' => '11','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '12','code' => 'cost','admin_name' => 'Cost','type' => 'price','validation' => 'decimal','position' => '12','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '13','code' => 'special_price','admin_name' => 'Special Price','type' => 'price','validation' => 'decimal','position' => '13','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '14','code' => 'special_price_from','admin_name' => 'Special Price From','type' => 'date','validation' => NULL,'position' => '14','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '15','code' => 'special_price_to','admin_name' => 'Special Price To','type' => 'date','validation' => NULL,'position' => '15','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0',
'use_in_flat' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
['id' => '16','code' => 'meta_title','admin_name' => 'Meta Title','type' => 'textarea','validation' => NULL,'position' => '16','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '17','code' => 'meta_keywords','admin_name' => 'Meta Keywords','type' => 'textarea','validation' => NULL,'position' => '17','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '18','code' => 'meta_description','admin_name' => 'Meta Description','type' => 'textarea','validation' => NULL,'position' => '18','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '19','code' => 'width','admin_name' => 'Width','type' => 'text','validation' => 'decimal','position' => '19','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '20','code' => 'height','admin_name' => 'Height','type' => 'text','validation' => 'decimal','position' => '20','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '21','code' => 'depth','admin_name' => 'Depth','type' => 'text','validation' => 'decimal','position' => '21','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '22','code' => 'weight','admin_name' => 'Weight','type' => 'text','validation' => 'decimal','position' => '22','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '23','code' => 'color','admin_name' => 'Color','type' => 'select','validation' => NULL,'position' => '23','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '24','code' => 'size','admin_name' => 'Size','type' => 'select','validation' => NULL,'position' => '24','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '25','code' => 'brand','admin_name' => 'Brand','type' => 'select','validation' => NULL,'position' => '25','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '1',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
['id' => '26','code' => 'guest_checkout','admin_name' => 'Guest Checkout','type' => 'boolean','validation' => NULL,'position' => '8','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
[
'id' => '1',
'code' => 'sku',
'admin_name' => 'SKU',
'type' => 'text',
'validation' => NULL,
'position' => '1',
'is_required' => '1',
'is_unique' => '1',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '2',
'code' => 'name',
'admin_name' => 'Name',
'type' => 'text',
'validation' => NULL,
'position' => '2',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '1',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '3',
'code' => 'url_key',
'admin_name' => 'URL Key',
'type' => 'text',
'validation' => NULL,
'position' => '3',
'is_required' => '1',
'is_unique' => '1',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '4',
'code' => 'tax_category_id',
'admin_name' => 'Tax Category',
'type' => 'select',
'validation' => NULL,
'position' => '4',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '5',
'code' => 'new',
'admin_name' => 'New',
'type' => 'boolean',
'validation' => NULL,
'position' => '5',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '6',
'code' => 'featured',
'admin_name' => 'Featured',
'type' => 'boolean',
'validation' => NULL,
'position' => '6',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '7',
'code' => 'visible_individually',
'admin_name' => 'Visible Individually',
'type' => 'boolean',
'validation' => NULL,
'position' => '7',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'created_at' => $now,
'use_in_flat' => '1',
'updated_at' => $now,
], [
'id' => '8',
'code' => 'status',
'admin_name' => 'Status',
'type' => 'boolean',
'validation' => NULL,
'position' => '8',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '9',
'code' => 'short_description',
'admin_name' => 'Short Description',
'type' => 'textarea',
'validation' => NULL,
'position' => '9',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '1',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '10',
'code' => 'description',
'admin_name' => 'Description',
'type' => 'textarea',
'validation' => NULL,
'position' => '10',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '1',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '11',
'code' => 'price',
'admin_name' => 'Price',
'type' => 'price',
'validation' => 'decimal',
'position' => '11',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '1',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '12',
'code' => 'cost',
'admin_name' => 'Cost',
'type' => 'price',
'validation' => 'decimal',
'position' => '12',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '1',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '13',
'code' => 'special_price',
'admin_name' => 'Special Price',
'type' => 'price',
'validation' => 'decimal',
'position' => '13',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '14',
'code' => 'special_price_from',
'admin_name' => 'Special Price From',
'type' => 'date',
'validation' => NULL,
'position' => '14',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '15',
'code' => 'special_price_to',
'admin_name' => 'Special Price To',
'type' => 'date',
'validation' => NULL,
'position' => '15',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'use_in_flat' => '1',
'is_visible_on_front' => '0',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '16',
'code' => 'meta_title',
'admin_name' => 'Meta Title',
'type' => 'textarea',
'validation' => NULL,
'position' => '16',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '1',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '17',
'code' => 'meta_keywords',
'admin_name' => 'Meta Keywords',
'type' => 'textarea',
'validation' => NULL,
'position' => '17',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '1',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '18',
'code' => 'meta_description',
'admin_name' => 'Meta Description',
'type' => 'textarea',
'validation' => NULL,
'position' => '18',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '1',
'value_per_channel' => '1',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '1',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '19',
'code' => 'width',
'admin_name' => 'Width',
'type' => 'text',
'validation' => 'decimal',
'position' => '19',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '1',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '20',
'code' => 'height',
'admin_name' => 'Height',
'type' => 'text',
'validation' => 'decimal',
'position' => '20',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '1',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '21',
'code' => 'depth',
'admin_name' => 'Depth',
'type' => 'text',
'validation' => 'decimal',
'position' => '21',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '1',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '22',
'code' => 'weight',
'admin_name' => 'Weight',
'type' => 'text',
'validation' => 'decimal',
'position' => '22',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '23',
'code' => 'color',
'admin_name' => 'Color',
'type' => 'select',
'validation' => NULL,
'position' => '23',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '1',
'is_configurable' => '1',
'is_user_defined' => '1',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '24',
'code' => 'size',
'admin_name' => 'Size',
'type' => 'select',
'validation' => NULL,
'position' => '24',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '1',
'is_configurable' => '1',
'is_user_defined' => '1',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '25',
'code' => 'brand',
'admin_name' => 'Brand',
'type' => 'select',
'validation' => NULL,
'position' => '25',
'is_required' => '0',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '1',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '1',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
], [
'id' => '26',
'code' => 'guest_checkout',
'admin_name' => 'Guest Checkout',
'type' => 'boolean',
'validation' => NULL,
'position' => '8',
'is_required' => '1',
'is_unique' => '0',
'value_per_locale' => '0',
'value_per_channel' => '0',
'is_filterable' => '0',
'is_configurable' => '0',
'is_user_defined' => '0',
'is_visible_on_front' => '0',
'use_in_flat' => '1',
'created_at' => $now,
'updated_at' => $now,
]
]);
DB::table('attribute_translations')->insert([
['id' => '1','locale' => 'en','name' => 'SKU','attribute_id' => '1'],
['id' => '2','locale' => 'en','name' => 'Name','attribute_id' => '2'],
['id' => '3','locale' => 'en','name' => 'URL Key','attribute_id' => '3'],
['id' => '4','locale' => 'en','name' => 'Tax Category','attribute_id' => '4'],
['id' => '5','locale' => 'en','name' => 'New','attribute_id' => '5'],
['id' => '6','locale' => 'en','name' => 'Featured','attribute_id' => '6'],
['id' => '7','locale' => 'en','name' => 'Visible Individually','attribute_id' => '7'],
['id' => '8','locale' => 'en','name' => 'Status','attribute_id' => '8'],
['id' => '9','locale' => 'en','name' => 'Short Description','attribute_id' => '9'],
['id' => '10','locale' => 'en','name' => 'Description','attribute_id' => '10'],
['id' => '11','locale' => 'en','name' => 'Price','attribute_id' => '11'],
['id' => '12','locale' => 'en','name' => 'Cost','attribute_id' => '12'],
['id' => '13','locale' => 'en','name' => 'Special Price','attribute_id' => '13'],
['id' => '14','locale' => 'en','name' => 'Special Price From','attribute_id' => '14'],
['id' => '15','locale' => 'en','name' => 'Special Price To','attribute_id' => '15'],
['id' => '16','locale' => 'en','name' => 'Meta Description','attribute_id' => '16'],
['id' => '17','locale' => 'en','name' => 'Meta Keywords','attribute_id' => '17'],
['id' => '18','locale' => 'en','name' => 'Meta Description','attribute_id' => '18'],
['id' => '19','locale' => 'en','name' => 'Width','attribute_id' => '19'],
['id' => '20','locale' => 'en','name' => 'Height','attribute_id' => '20'],
['id' => '21','locale' => 'en','name' => 'Depth','attribute_id' => '21'],
['id' => '22','locale' => 'en','name' => 'Weight','attribute_id' => '22'],
['id' => '23','locale' => 'en','name' => 'Color','attribute_id' => '23'],
['id' => '24','locale' => 'en','name' => 'Size','attribute_id' => '24'],
['id' => '25','locale' => 'en','name' => 'Brand','attribute_id' => '25'],
['id' => '26','locale' => 'en','name' => 'Allow Guest Checkout','attribute_id' => '26']
[
'id' => '1',
'locale' => 'en',
'name' => 'SKU',
'attribute_id' => '1',
], [
'id' => '2',
'locale' => 'en',
'name' => 'Name',
'attribute_id' => '2',
], [
'id' => '3',
'locale' => 'en',
'name' => 'URL Key',
'attribute_id' => '3',
], [
'id' => '4',
'locale' => 'en',
'name' => 'Tax Category',
'attribute_id' => '4',
], [
'id' => '5',
'locale' => 'en',
'name' => 'New',
'attribute_id' => '5',
], [
'id' => '6',
'locale' => 'en',
'name' => 'Featured',
'attribute_id' => '6',
], [
'id' => '7',
'locale' => 'en',
'name' => 'Visible Individually',
'attribute_id' => '7',
], [
'id' => '8',
'locale' => 'en',
'name' => 'Status',
'attribute_id' => '8',
], [
'id' => '9',
'locale' => 'en',
'name' => 'Short Description',
'attribute_id' => '9',
], [
'id' => '10',
'locale' => 'en',
'name' => 'Description',
'attribute_id' => '10',
], [
'id' => '11',
'locale' => 'en',
'name' => 'Price',
'attribute_id' => '11',
], [
'id' => '12',
'locale' => 'en',
'name' => 'Cost',
'attribute_id' => '12',
], [
'id' => '13',
'locale' => 'en',
'name' => 'Special Price',
'attribute_id' => '13',
], [
'id' => '14',
'locale' => 'en',
'name' => 'Special Price From',
'attribute_id' => '14',
], [
'id' => '15',
'locale' => 'en',
'name' => 'Special Price To',
'attribute_id' => '15',
], [
'id' => '16',
'locale' => 'en',
'name' => 'Meta Description',
'attribute_id' => '16',
], [
'id' => '17',
'locale' => 'en',
'name' => 'Meta Keywords',
'attribute_id' => '17',
], [
'id' => '18',
'locale' => 'en',
'name' => 'Meta Description',
'attribute_id' => '18',
], [
'id' => '19',
'locale' => 'en',
'name' => 'Width',
'attribute_id' => '19',
], [
'id' => '20',
'locale' => 'en',
'name' => 'Height',
'attribute_id' => '20',
], [
'id' => '21',
'locale' => 'en',
'name' => 'Depth',
'attribute_id' => '21',
], [
'id' => '22',
'locale' => 'en',
'name' => 'Weight',
'attribute_id' => '22',
], [
'id' => '23',
'locale' => 'en',
'name' => 'Color',
'attribute_id' => '23',
], [
'id' => '24',
'locale' => 'en',
'name' => 'Size',
'attribute_id' => '24',
], [
'id' => '25',
'locale' => 'en',
'name' => 'Brand',
'attribute_id' => '25',
], [
'id' => '26',
'locale' => 'en',
'name' => 'Allow Guest Checkout',
'attribute_id' => '26',
]
]);
}
}

View File

@ -17,7 +17,6 @@ class CreateBookingProductTableSlotsTable extends Migration
$table->increments('id');
$table->string('price_type');
$table->integer('guest_limit')->default(0);
$table->integer('guest_capacity')->default(0);
$table->integer('duration');
$table->integer('break_time');
$table->integer('prevent_scheduling_before');

View File

@ -331,14 +331,14 @@ class Booking
}
/**
* @param CartItem $cartItem
* @param CartItem|array $cartItem
* @return bool
*/
public function isItemHaveQuantity($cartItem)
{
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartItem->product_id);
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartItem['product_id']);
if ($bookingProduct->qty - $this->getBookedQuantity($cartItem) < $cartItem->quantity) {
if ($bookingProduct->qty - $this->getBookedQuantity($cartItem) < $cartItem['quantity']) {
return false;
}
@ -352,9 +352,7 @@ class Booking
public function isSlotAvailable($cartProducts)
{
foreach ($cartProducts as $cartProduct) {
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartProduct['product_id']);
if ($bookingProduct->qty - $this->getBookedQuantity($cartProduct) < $cartProduct['quantity']) {
if (! $this->isItemHaveQuantity($cartProduct)) {
return false;
}
}

View File

@ -62,16 +62,16 @@ class EventTicket extends Booking
}
/**
* @param CartItem $cartItem
* @param CartItem|array $cartItem
* @return bool
*/
public function isItemHaveQuantity($cartItem)
{
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartItem->product_id);
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartItem['product_id']);
$ticket = $bookingProduct->event_tickets()->find($cartItem['additional']['booking']['ticket_id']);
if ($ticket->qty - $this->getBookedQuantity($cartItem) < $cartItem->quantity) {
if ($ticket->qty - $this->getBookedQuantity($cartItem) < $cartItem['quantity']) {
return false;
}
@ -85,11 +85,7 @@ class EventTicket extends Booking
public function isSlotAvailable($cartProducts)
{
foreach ($cartProducts as $cartProduct) {
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartProduct['product_id']);
$ticket = $bookingProduct->event_tickets()->find($cartProduct['additional']['booking']['ticket_id']);
if ($ticket->qty - $this->getBookedQuantity($cartProduct) < $cartProduct['quantity']) {
if (! $this->isItemHaveQuantity($cartProduct)) {
return false;
}
}

View File

@ -95,38 +95,6 @@ class RentalSlot extends Booking
return $slots;
}
/**
* @param CartItem $cartItem
* @return bool
*/
public function isItemHaveQuantity($cartItem)
{
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartItem->product_id);
if ($bookingProduct->qty - $this->getBookedQuantity($cartItem) < $cartItem->quantity) {
return false;
}
return true;
}
/**
* @param array $cartProducts
* @return bool
*/
public function isSlotAvailable($cartProducts)
{
foreach ($cartProducts as $cartProduct) {
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartProduct['product_id']);
if ($bookingProduct->qty - $this->getBookedQuantity($cartProduct) < $cartProduct['quantity']) {
return false;
}
}
return true;
}
/**
* @param array $data
* @return integer

View File

@ -10,4 +10,43 @@ namespace Webkul\BookingProduct\Helpers;
*/
class TableSlot extends Booking
{
/**
* @param CartItem|array $cartItem
* @return bool
*/
public function isItemHaveQuantity($cartItem)
{
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartItem['product_id']);
$bookedQty = $this->getBookedQuantity($cartItem);
$requestedQty = $cartItem['quantity'];
if ($bookingProduct->table_slot->price_type == 'table') {
$requestedQty *= $bookingProduct->table_slot->guest_limit;
$bookedQty *= $bookingProduct->table_slot->guest_limit;
}
if ($bookingProduct->qty - $bookedQty < $requestedQty) {
return false;
}
return true;
}
/**
* @param array $cartProducts
* @return bool
*/
public function isSlotAvailable($cartProducts)
{
foreach ($cartProducts as $cartProduct) {
if (! $this->isItemHaveQuantity($cartProduct)) {
return false;
}
}
return true;
}
}

View File

@ -14,7 +14,6 @@ class BookingProductTableSlot extends Model implements BookingProductTableSlotCo
protected $fillable = [
'price_type',
'guest_limit',
'guest_capacity',
'duration',
'break_time',
'prevent_scheduling_before',

View File

@ -52,7 +52,7 @@ return [
'guest' => 'Guest',
'table' => 'Table',
'prevent-scheduling-before' => 'Prevent Scheduling Before',
'guest-limit' => 'Guest Limit',
'guest-limit' => 'Guest Limit Per Table',
'guest-capacity' => 'Guest Capacity',
'type' => 'Type',
'many-bookings-for-one-day' => 'Many Bookings for One Day',
@ -95,7 +95,6 @@ return [
'from' => 'From',
'to' => 'To',
'book-a-table' => 'Book a Table',
'number-of-tables' => 'Number of Tables',
'special-notes' => 'Special Request/Notes',
'event-on' => 'Event On',
'book-your-ticket' => 'Book Your Ticket',

View File

@ -28,12 +28,12 @@
<span class="control-error" v-if="errors.has('booking[guest_limit]')">@{{ errors.first('booking[guest_limit]') }}</span>
</div>
<div class="control-group" :class="[errors.has('booking[guest_capacity]') ? 'has-error' : '']">
<div class="control-group" :class="[errors.has('booking[qty]') ? 'has-error' : '']">
<label class="required">{{ __('bookingproduct::app.admin.catalog.products.guest-capacity') }}</label>
<input type="text" v-validate="'required|min_value:1'" name="booking[guest_capacity]" v-model="table_booking.guest_capacity" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.guest-limit') }}&quot;"/>
<input type="text" v-validate="'required|min_value:1'" name="booking[qty]" value="{{ $bookingProduct->qty }}" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.guest-limit') }}&quot;"/>
<span class="control-error" v-if="errors.has('booking[guest_capacity]')">@{{ errors.first('booking[guest_capacity]') }}</span>
<span class="control-error" v-if="errors.has('booking[qty]')">@{{ errors.first('booking[qty]') }}</span>
</div>
<div class="control-group" :class="[errors.has('booking[duration]') ? 'has-error' : '']">
@ -102,8 +102,6 @@
guest_limit: 2,
guest_capacity: 100,
duration: 45,
break_time: 15,

View File

@ -57,12 +57,6 @@
'title' => __('bookingproduct::app.shop.products.book-a-table')
])
<div class="control-group" :class="[errors.has('booking[qty]') ? 'has-error' : '']">
<label>{{ __('bookingproduct::app.shop.products.number-of-tables') }}</label>
<input type="text" v-validate="'required'" name="booking[qty]" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.shop.products.number-of-tables') }}&quot;" style="width: 100%"/>
<span class="control-error" v-if="errors.has('booking[qty]')">@{{ errors.first('booking[qty]') }}</span>
</div>
<div class="control-group">
<label>{{ __('bookingproduct::app.shop.products.special-notes') }}</label>
<textarea name="booking[note]" class="control" style="width: 100%"/>