Skip to content

Commit 16aa859

Browse files
Cleanup
1 parent ce75c3b commit 16aa859

File tree

8 files changed

+31
-20
lines changed

8 files changed

+31
-20
lines changed

components/product/servicemodal.htm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h3>{{ 'offline.mall::frontend.services.modal_title'|trans }}</h3>
1111
<h4 class="mall-product-service__name">{{ service.name }}</h4>
1212
{% if service.description %}
1313
<div class="mall-product-service__description">
14-
{{ html_clean(service.description|raw) }}
14+
{{ service.description|content }}
1515
</div>
1616
{% endif %}
1717
{% if service.pivot.required %}
@@ -39,11 +39,11 @@ <h4 class="mall-product-service__name">{{ service.name }}</h4>
3939
{{ option.name }}
4040
</span>
4141
<span class="mall-product-service-option__price">
42-
{{ html_clean(option.price().string|raw) }}
42+
{{ option.price().string|content }}
4343
</span>
4444
{% if option.description %}
4545
<span class="mall-product-service-option__description">
46-
{{ html_clean(option.description|raw) }}
46+
{{ option.description|content }}
4747
</span>
4848
{% endif %}
4949
</label>

controllers/Brands.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
class Brands extends Controller
1111
{
12+
public $turboVisitControl = 'disabled';
13+
1214
/**
1315
* Implement behaviors for this controller.
1416
* @var array

controllers/Categories.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
class Categories extends Controller
1414
{
15+
public $turboVisitControl = 'disabled';
16+
1517
/**
1618
* Implement behaviors for this controller.
1719
* @var array

controllers/Products.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030

3131
class Products extends Controller
3232
{
33-
use ProductPriceTable;
33+
use ProductPriceTable;
34+
35+
public $turboVisitControl = 'reload';
3436

3537
/**
3638
* Implement behaviors for this controller.
@@ -111,12 +113,12 @@ public function __construct()
111113
public function update($id)
112114
{
113115
parent::update($id);
114-
116+
115117
// Something went wrong if no formModel is available. Proceed with default behavior.
116118
if (!isset($this->vars['formModel'])) {
117119
return;
118120
}
119-
121+
120122
// If the product has no category something is wrong and needs fixing!
121123
if (!$this->vars['formModel']->categories) {
122124
Flash::error(trans('offline.mall::lang.common.action_required'));
@@ -131,7 +133,7 @@ public function update($id)
131133
if (!$latestFile || !$record instanceof ProductFile) {
132134
return '';
133135
}
134-
136+
135137
if (empty(trim($latestFile->version))) {
136138
return '';
137139
}
@@ -185,7 +187,7 @@ public function change_category_onSave()
185187
}
186188

187189
/**
188-
* Save the initial price into the prices table and create an initial image set if images have
190+
* Save the initial price into the prices table and create an initial image set if images have
189191
* been uploaded.
190192
* @param Product $model
191193
* @return void
@@ -404,14 +406,14 @@ public function onRelationManageCreate()
404406
if ($this->relationName === 'files') {
405407
$parent['#Form-field-Product-missing_file_hint-group'] = '';
406408
}
407-
409+
408410
if ($this->relationName === 'variants') {
409411
$this->updateProductPrices($this->vars['formModel'], $this->relationModel);
410412
$this->createImageSetFromTempImages($this->relationModel);
411413
$this->handlePropertyValueUpdates($this->relationModel);
412414

413415
(new ProductObserver(app(Index::class)))->updated($this->vars['formModel']);
414-
}
416+
}
415417

416418
return $this->asExtension(RelationController::class)->relationRefresh();
417419
}
@@ -533,12 +535,12 @@ protected function createImageSetFromTempImages(Variant $variant)
533535
$set->name = $variant->name;
534536
$set->product_id = $variant->product_id;
535537
$set->save();
536-
538+
537539
$variant->image_set_id = $set->id;
538540
$variant->save();
539-
541+
540542
$variant->commitDeferred(post('_session_key'));
541-
543+
542544
return DB::table('system_files')
543545
->where('attachment_type', Variant::MORPH_KEY)
544546
->where('attachment_id', $variant->id)
@@ -579,7 +581,7 @@ protected function updatePrices($model, $key = 'prices')
579581
}
580582
});
581583
}
582-
584+
583585
/**
584586
* Update product prices.
585587
* @param mixed $product

controllers/Services.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
class Services extends Controller
1717
{
18+
public $turboVisitControl = 'disabled';
19+
1820
/**
1921
* Implement behaviors for this controller.
2022
* @var array

controllers/services/config_relation.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ options:
77
manage:
88
form: $/offline/mall/models/serviceoption/fields.yaml
99
recordsPerPage: 10
10+
structure:
11+
showTree: false
12+
showReorder: true
13+
showSorting: true
14+
dragRow: true
1015

1116
products:
1217
label: 'offline.mall::lang.common.products'

models/PropertyValue.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ private function jsonDecodeValue($value = null)
163163
return null;
164164
}
165165

166+
if (is_array($value)) {
167+
return $value;
168+
}
169+
166170
return json_decode($value, true);
167171
}
168172

models/serviceoption/columns.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
columns:
2-
sort_order_handle:
3-
label: " "
4-
type: partial
5-
path: $/offline/mall/models/serviceoption/_reorder_handle.htm
6-
sortable: false
7-
width: 20px
82
name:
93
label: 'offline.mall::lang.common.name'
104
type: text

0 commit comments

Comments
 (0)