Skip to content

Commit 2b1ee05

Browse files
authored
Merge pull request #78 from avored/dev
merge dev to master
2 parents b6e81dc + 475a4c0 commit 2b1ee05

32 files changed

+841
-907
lines changed

.circleci/config.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
jobs:
3+
build:
4+
branches:
5+
only:
6+
- dev
7+
- master
8+
docker:
9+
- image: circleci/php:7-fpm-browsers-legacy
10+
steps:
11+
- checkout
12+
- run:
13+
name: "install composer dependency"
14+
command: composer install
15+
- run:
16+
name: "Run tests"
17+
command: phpdbg -d memory_limit=512M -qrr vendor/bin/phpunit --coverage-html build/coverage-report
18+
- store_artifacts:
19+
path: build/coverage-report

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# AvoRed a modular Shopping cart framework for a laravel php framework
1+
# Core package for avored shopping cart
22
AvoRed Framework contains the core features for the AvoRed E commerce for Laravel. It is the base behind the AvoRed an Laravel Ecommerce.
33

4+
[![Coverage Status](https://coveralls.io/repos/github/avored/framework/badge.svg?branch=master)](https://coveralls.io/github/avored/framework?branch=master)
5+
46
#### Installation
57
AvoRed E commerce framework provided as a composer package so it make installation of the avored is much easier as
68

database/migrations/2017_03_29_000000_avored_framework_schema.php

+12
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public function up()
174174
['TEXT', 'TEXTAREA', 'CKEDITOR', 'SELECT', 'FILE', 'DATETIME', 'RADIO', 'SWITCH']
175175
);
176176
$table->tinyInteger('use_for_all_products')->default(0);
177+
$table->tinyInteger('use_for_category_filter')->default(0);
177178
$table->tinyInteger('is_visible_frontend')->nullable()->default(1);
178179
$table->integer('sort_order')->nullable()->default(0);
179180
$table->timestamps();
@@ -417,6 +418,16 @@ public function up()
417418
$table->foreign('product_id')->references('id')->on('products');
418419
});
419420

421+
Schema::create('category_filters', function (Blueprint $table) {
422+
$table->bigIncrements('id');
423+
$table->unsignedBigInteger('category_id');
424+
$table->unsignedBigInteger('filter_id');
425+
$table->enum('type', ['ATTRIBUTE', 'PROPERTY']);
426+
427+
$table->foreign('category_id')->references('id')->on('categories');
428+
$table->timestamps();
429+
});
430+
420431
$path = __DIR__ . '/../../assets/countries.json';
421432
$json = json_decode(file_get_contents($path), true);
422433
foreach ($json as $country) {
@@ -440,6 +451,7 @@ public function down()
440451
{
441452
Schema::disableForeignKeyConstraints();
442453

454+
Schema::dropIfExists('category_filters');
443455
Schema::dropIfExists('addresses');
444456
Schema::dropIfExists('order_product');
445457
Schema::dropIfExists('orders');

resources/components/catalog/product/ProductSave.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default {
9292
this.type = this.product.type
9393
this.description = this.product.description
9494
this.productProperties.forEach(record => {
95-
this.property[record.id] = record.property_value
95+
this.property[record.id] = record.product_value.value
9696
});
9797
this.product.images.forEach(record => {
9898
this.productImages.push(record)

resources/components/catalog/property/PropertySave.vue

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default {
88
return {
99
propertyForm: this.$form.createForm(this),
1010
use_for_all_products: 0,
11+
use_for_category_filter: 0,
1112
is_visible_frontend: 0,
1213
data_type: '',
1314
field_type: '',
@@ -40,6 +41,13 @@ export default {
4041
this.use_for_all_products = 0;
4142
}
4243
},
44+
useForCategoryFilterSwitchChange(val) {
45+
if (val) {
46+
this.use_for_category_filter = 1;
47+
} else {
48+
this.use_for_category_filter = 0;
49+
}
50+
},
4351
isVisibleInFrontendSwitchChange(val) {
4452
if (val) {
4553
this.is_visible_frontend = 1;

resources/lang/en/catalog.php

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
'description' => 'Description',
5353
'meta_title' => 'Meta Title',
5454
'meta_description' => 'Meta Description',
55+
'image_title' => 'Product Images',
56+
'upload_btn' => 'Upload',
5557
'index' => [
5658
'title' => 'Product List'
5759
],
@@ -69,6 +71,7 @@
6971
'data_type' => 'Data Type',
7072
'field_type' => 'Field Type',
7173
'use_for_all_products' => 'Use for all products',
74+
'use_for_category_filter' => 'Use for category filter',
7275
'is_visible_frontend' => 'Is visible in Frontend',
7376
'sort_order' => 'Sort Order',
7477
'dropdown_options' => 'Dropdown Options',

resources/less/app.less

+9-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
.header-avtar .anticon {
1313
margin-right: 0px;
1414
}
15-
15+
.z-1 {
16+
z-index: 1;
17+
}
18+
.z-0 {
19+
z-index: 0;
20+
}
1621
.bg-primary {
1722
background-color: @primary-color;
1823
}
@@ -59,11 +64,12 @@
5964
background-image: url(/avored-admin/images/logo.svg);
6065
height: 64px;
6166
background-repeat: no-repeat;
62-
background-size: 50px;
63-
background-position: 15px;
67+
background-size: 40px;
68+
background-position: 20px;
6469
line-height: 64px;
6570
padding-left: 80px;
6671
font-size: 1.2rem;
72+
z-index: 0;
6773
}
6874
.header-trigger {
6975
line-height: 64px;

resources/views/catalog/product/_fields.blade.php

-130
Original file line numberDiff line numberDiff line change
@@ -469,133 +469,3 @@
469469
></a-input>
470470
</a-form-item>
471471
</a-card>
472-
473-
<a-card class="mt-1 mb-1" title="{{ __('avored::catalog.product.property_card_title') }}">
474-
@foreach ($properties as $property)
475-
@switch($property->field_type)
476-
@case('SELECT')
477-
<a-form-item label="{{ $property->name }}">
478-
<a-select
479-
v-on:change="handlePropertyChange({{ $property->id }}, $event)"
480-
v-decorator="[
481-
'property[{{ $property->id }}]',
482-
{rules:
483-
[
484-
{ required: true,
485-
message: '{{ __('avored::validation.required', ['attribute' => $property->name]) }}'
486-
}
487-
]
488-
}
489-
]">
490-
@foreach ($property->dropdownOptions as $dropdownOption)
491-
<a-select-option value="{{ $dropdownOption->id }}">
492-
{{ $dropdownOption->display_text }}
493-
</a-select-option>
494-
@endforeach
495-
</a-select>
496-
</a-form-item>
497-
<input type="hidden" name="property[{{ $property->id }}]" v-model="property[{{ $property->id }}]" />
498-
@break
499-
500-
@case('TEXT')
501-
<a-form-item label="{{ $property->name }}">
502-
<a-input
503-
name="property[{{ $property->id }}]"
504-
v-decorator="[
505-
'property[{{ $property->id }}]',
506-
{rules:
507-
[
508-
{ required: true,
509-
message: '{{ __('avored::validation.required', ['attribute' => $property->name]) }}'
510-
}
511-
]
512-
}
513-
]">
514-
515-
</a-select>
516-
</a-form-item>
517-
@break
518-
519-
@case('TEXTAREA')
520-
<a-form-item label="{{ $property->name }}">
521-
<a-textarea
522-
:rows="4"
523-
name="property[{{ $property->id }}]"
524-
v-decorator="[
525-
'property[{{ $property->id }}]',
526-
{rules:
527-
[
528-
{ required: true,
529-
message: '{{ __('avored::validation.required', ['attribute' => $property->name]) }}'
530-
}
531-
]
532-
}
533-
]">
534-
535-
</a-select>
536-
</a-form-item>
537-
@break
538-
539-
@case('DATETIME')
540-
<a-form-item label="{{ $property->name }}">
541-
<a-date-picker
542-
:show-time="true"
543-
format="DD-MM-YYYY HH:mm:ss"
544-
v-on:change="handlePropertyChange({{ $property->id }}, $event)"
545-
v-decorator="[
546-
'property[{{ $property->id }}]',
547-
{rules:
548-
[
549-
{ required: true,
550-
message: '{{ __('avored::validation.required', ['attribute' => $property->name]) }}'
551-
}
552-
]
553-
}
554-
]">
555-
</a-date-picker>
556-
<v /a-form-item>
557-
<input type="hidden" name="property[{{ $property->id }}]" v-model="property[{{ $property->id }}]" />
558-
@break
559-
560-
@case('SWITCH')
561-
<a-form-item label="{{ $property->name }}">
562-
<a-switch
563-
v-on:change="handlePropertyChange({{ $property->id }}, $event)"
564-
v-decorator="[
565-
'property[{{ $property->id }}]',
566-
{rules:
567-
[
568-
{ required: true,
569-
message: '{{ __('avored::validation.required', ['attribute' => $property->name]) }}'
570-
}
571-
]
572-
}
573-
]">
574-
</a-switch>
575-
</a-form-item>
576-
<input type="hidden" name="property[{{ $property->id }}]" v-model="property[{{ $property->id }}]" />
577-
@break
578-
579-
@case('RADIO')
580-
<a-form-item label="{{ $property->name }}">
581-
<a-radio-group
582-
v-on:change="handlePropertyChange({{ $property->id }}, $event)"
583-
:options="{{ $property->getDropdownOptions() }}"
584-
v-decorator="[
585-
'property[{{ $property->id }}]',
586-
{'initialValue': {{ $property->property_value}}},
587-
{rules:
588-
[
589-
{ required: true,
590-
message: '{{ __('avored::validation.required', ['attribute' => $property->name]) }}'
591-
}
592-
]
593-
}
594-
]">
595-
</a-switch>
596-
</a-form-item>
597-
<input type="hidden" name="property[{{ $property->id }}]" v-model="property[{{ $property->id }}]" />
598-
@break
599-
@endswitch
600-
@endforeach
601-
</a-card>

resources/views/catalog/product/cards/images.blade.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1>Images</h1>
1+
<h1>{{ __('avored::catalog.product.image_title') }}</h1>
22

33
<a-upload
44
action="{{ route('admin.product.image.upload', $product->id) }}"
@@ -7,7 +7,7 @@
77
@change="uploadFileChange"
88
>
99
<a-button>
10-
<a-icon type="upload"></a-icon> upload
10+
<a-icon type="upload"></a-icon> {{ __('avored::catalog.product.upload_btn') }}
1111
</a-button>
1212
</a-upload>
1313

@@ -20,8 +20,7 @@
2020
<a-input
2121
placeholder="Image alt text"
2222
:default-value="item.alt_text"
23-
:name="'images[' + item.id +'][alt_text]'"
24-
/>
23+
:name="'images[' + item.id +'][alt_text]'"/>
2524
</a-col>
2625
<a-col :span="6">
2726
<input type="radio"

0 commit comments

Comments
 (0)