Updates to Product Model, product updates, enable pricing update, improved formating of product services

This commit is contained in:
2023-05-04 22:17:42 +10:00
parent 95bb55aad8
commit 0f91ce4940
21 changed files with 491 additions and 138 deletions

View File

@@ -97,6 +97,18 @@ class ProductController extends Controller
$o->active = (bool)$request->active;
// Trim down the pricing array, remove null values
$o->pricing = $o->pricing->map(function($item) {
foreach ($item as $k=>$v) {
if (is_array($v)) {
$v = array_filter($v);
$item[$k] = $v;
}
}
return $item;
});
try {
$o->save();
} catch (\Exception $e) {