Skip to content

Commit

Permalink
php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
PrestaSafe committed Aug 7, 2023
1 parent bf0d32e commit 632bd66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion classes/PrettyBlocksMigrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public static function migrateSettings()
$model->theme_name = $theme_name;
$model->settings = json_encode($res, true);
$model->id_shop = $id_shop;
$model->profile = 'Theme '.$theme_name;
$model->profile = 'Theme ' . $theme_name;
if ($model->save()) {
$can_delete_settings = true;
}
Expand Down
17 changes: 7 additions & 10 deletions classes/PrettyBlocksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -811,21 +811,18 @@ public static function getThemeSettings($with_tabs = true, $context = 'front')
$res = [];
$no_tabs = [];
foreach ($theme_settings as $key => $settings) {
$tab = $settings['tab'] ?? 'general';
$fieldCore = (new FieldCore($settings));
if(isset($settingsDB[$key]['value'])){
$fieldCore->setAttribute('value', $settingsDB[$key]['value']);
}
$res[$tab][$key] = $fieldCore->compile();
$no_tabs[$key] = $fieldCore->getValue() ?? false;

$tab = $settings['tab'] ?? 'general';
$fieldCore = (new FieldCore($settings));
if (isset($settingsDB[$key]['value'])) {
$fieldCore->setAttribute('value', $settingsDB[$key]['value']);
}
$res[$tab][$key] = $fieldCore->compile();
$no_tabs[$key] = $fieldCore->getValue() ?? false;
}
if (!$with_tabs) {
return $no_tabs;
}

return $res;
}


}
3 changes: 2 additions & 1 deletion classes/PrettyBlocksSettingsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ public static function getProfileByTheme($theme_name, $id_shop)
$collection = new PrestaShopCollection('PrettyBlocksSettingsModel');
$collection->where('theme_name', '=', $theme_name);
$collection->where('id_shop', '=', $id_shop);

return $collection->getFirst();
}

// public static function generateFirstProfile()
// {
// $theme_name = Context::getContext()->shop->theme_name;
// $id_shop = Context::getContext()->shop->id;

// }
}

0 comments on commit 632bd66

Please sign in to comment.