diff --git a/src/new/config/bundles.php b/src/new/config/bundles.php index a5b931e1a..71fcf58db 100755 --- a/src/new/config/bundles.php +++ b/src/new/config/bundles.php @@ -62,4 +62,5 @@ return [ Symfony\UX\Chartjs\ChartjsBundle::class => ['all' => true], Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::class => ['all' => true], Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true], + Dunglas\DoctrineJsonOdm\Bundle\DunglasDoctrineJsonOdmBundle::class => ['all' => true] ]; diff --git a/src/new/src/PSC/Shop/NewsBundle/Entity/News.php b/src/new/src/PSC/Shop/NewsBundle/Entity/News.php index a72888e7b..59bc2650b 100755 --- a/src/new/src/PSC/Shop/NewsBundle/Entity/News.php +++ b/src/new/src/PSC/Shop/NewsBundle/Entity/News.php @@ -87,7 +87,7 @@ class News #[ORM\Column(name: 'to_date', type: 'datetime')] protected ?\DateTime $toDate; - #[ORM\Column(name: 'media', type: 'json')] + #[ORM\Column(name: 'media', type: 'json_document', options: ['jsonb' => true])] public $media = []; /** * enable diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php index 2adddb756..c75fbfb8a 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php @@ -42,7 +42,7 @@ class Base { $baseUrl = $this->baseUrlLive; - if($this->test) { + if ($this->test) { $baseUrl = $this->baseUrlTest; } @@ -63,7 +63,7 @@ class Base { $baseUrl = $this->baseUrlLive; - if($this->test) { + if ($this->test) { $baseUrl = $this->baseUrlTest; } @@ -82,7 +82,7 @@ class Base { $baseUrl = $this->baseUrlLive; - if($this->test) { + if ($this->test) { $baseUrl = $this->baseUrlTest; } @@ -100,7 +100,7 @@ class Base $apiSecret = $this->apiKey; $baseUrl = $this->baseUrlUploadLive; - if($this->test) { + if ($this->test) { $baseUrl = $this->baseUrlUploadTest; } $formData = new FormDataPart($data); @@ -117,7 +117,7 @@ class Base public function postUploadLinks($url, $data) { $baseUrl = $this->baseUrlUploadLive; - if($this->test) { + if ($this->test) { $baseUrl = $this->baseUrlUploadTest; } $response = $this->client->request('POST', $baseUrl . $url, [ @@ -131,7 +131,7 @@ class Base public function postUploadConfirm($url, $data) { $baseUrl = $this->baseUrlUploadLive; - if($this->test) { + if ($this->test) { $baseUrl = $this->baseUrlUploadTest; } $response = $this->client->request('POST', $baseUrl . $url, [ @@ -145,7 +145,7 @@ class Base public function get($url) { $baseUrl = $this->baseUrlLive; - if($this->test) { + if ($this->test) { $baseUrl = $this->baseUrlTest; } @@ -173,7 +173,6 @@ class Base $this->buildHeaders() , ]); - var_dump($response->getContent(true)); $content = $response->toArray(); return $content; @@ -192,7 +191,7 @@ class Base */ public function setShop(\PSC\Shop\EntityBundle\Document\Shop $shop): void { - if($shop->getPluginSettingModule('saxoprint', 'sriAPIKey')) { + if ($shop->getPluginSettingModule('saxoprint', 'sriAPIKey')) { $this->apiKey = $shop->getPluginSettingModule('saxoprint', 'sriAPIKey'); $this->customerNumber = $shop->getPluginSettingModule('saxoprint', 'customerNumber'); $this->test = $shop->getPluginSettingModule('saxoprint', 'useTestSystem'); diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PutConfig.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PutConfig.php index 36915f3ef..ff8a34e99 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PutConfig.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PutConfig.php @@ -10,22 +10,24 @@ class PutConfig extends Base private int $productId; private array $config; - + public function call() { - if(!$this->apiKey&& !$this->customerNumber) { + if (!$this->apiKey && !$this->customerNumber) { return []; } $resultLangPropertyValues = $this->getCache()->get( - 'saxoprint_result_lang_property_values', function (ItemInterface $item) { + 'saxoprint_result_lang_property_values', + function (ItemInterface $item) { // $item->expiresAfter(3600); return $this->get('config/' . $this->customerNumber .'/texts/propertyvalue/de-DE'); } ); $resultLangProperty = $this->getCache()->get( - 'saxoprint_result_lang_property', function (ItemInterface $item) { + 'saxoprint_result_lang_property', + function (ItemInterface $item) { // $item->expiresAfter(3600); return $this->get('config/' . $this->customerNumber . '/texts/property/de-DE'); } @@ -33,22 +35,21 @@ class PutConfig extends Base $result = $this->put(sprintf("config/%s/%s/configurations", $this->customerNumber, $this->getProductId()), $this->buildData()); - var_dump($result); $tmp = ['property' => [], 'custom' => []]; - foreach($result['ValidOptions'] as $key => $value) { + foreach ($result['ValidOptions'] as $key => $value) { $item = [ - 'defaultValue' => $result['ValidConfiguration'][$key]??null, + 'defaultValue' => $result['ValidConfiguration'][$key] ?? null, 'type' => 'select', 'values' => [], 'label' => $resultLangProperty[$key], 'id' => $key ]; - foreach($value as $arrValue) { - if($arrValue == 0) { + foreach ($value as $arrValue) { + if ($arrValue == 0) { $item['values'][] = ['id' => 0]; - }else{ + } else { $item['values'][] = ['id' => $arrValue, 'label' => $resultLangPropertyValues[$arrValue]]; } } @@ -56,9 +57,9 @@ class PutConfig extends Base $tmp['property'][] = $item; } - foreach($result['ValidCustomOptions'] as $key => $value) { + foreach ($result['ValidCustomOptions'] as $key => $value) { $item = [ - 'defaultValue' => $result['ValidCustomConfiguration'][$key]??null, + 'defaultValue' => $result['ValidCustomConfiguration'][$key] ?? null, 'type' => 'input', 'label' => $resultLangProperty[$key], 'id' => $key @@ -74,19 +75,17 @@ class PutConfig extends Base { $temp = []; $tempCustom = []; - foreach($this->config['property'] as $key => $value) - { - if($key == '102' || $key == 'auflage') { + foreach ($this->config['property'] as $key => $value) { + if ($key == '102' || $key == 'auflage') { continue; } - if($value != 0) { + if ($value != 0) { $temp[$key] = intval($value); } } - if(isset($this->config['custom'])) { - foreach($this->config['custom'] as $key => $value) - { - if($value != 0) { + if (isset($this->config['custom'])) { + foreach ($this->config['custom'] as $key => $value) { + if ($value != 0) { $tempCustom[$key] = intval($value); } } diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php index 17f416ad9..06595b9ff 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php @@ -126,8 +126,6 @@ class SaxoprintController extends AbstractController $putConfig->setConfig($reqConfig); $config = $putConfig->call(); } -var_dump($config); - die(); $getPrices->setShop($shop->getMongoShopByUid($product->getShop()->getUid())); $getPrices->setProductId((int)$request->get('saxoprintProductId')); diff --git a/src/old/e39559ce49d31cf5a10989253eb4cead.jpeg b/src/old/e39559ce49d31cf5a10989253eb4cead.jpeg deleted file mode 100644 index 67f59c101..000000000 Binary files a/src/old/e39559ce49d31cf5a10989253eb4cead.jpeg and /dev/null differ