Skip to content

Commit

Permalink
Merge pull request #2634 from BlackbitDevs/bugfix/store-without-currency
Browse files Browse the repository at this point in the history
Prevent PHP error for store without currency
  • Loading branch information
dpfaffenbauer committed May 24, 2024
2 parents 3a415c3 + 2548e09 commit 1b28308
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/CoreShop/Bundle/CoreBundle/CoreExtension/StoreValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,12 @@ public function getDataForEditmode(mixed $data, Concrete $object = null, array $
$context->setGroups($params['groups'] ?? ['Default', 'Detailed']);
$values = $this->getSerializer()->toArray($storeValuesEntity, $context);

$store = $storeValuesEntity->getStore();
$currency = $store->getCurrency();

$storeData[$storeValuesEntity->getStore()->getId()] = [
'name' => $storeValuesEntity->getStore()->getName(),
'currencySymbol' => $storeValuesEntity->getStore()->getCurrency()->getSymbol(),
'name' => $store->getName(),
'currencySymbol' => $currency?->getSymbol(),
'values' => $values,
'inherited' => false,
'inheritable' => $inheritable,
Expand Down

0 comments on commit 1b28308

Please sign in to comment.