From 7068b6a4e040230a3c04f4722b3991f549afd915 Mon Sep 17 00:00:00 2001 From: Mateusz Deszert-Klosowski Date: Tue, 1 Oct 2024 08:14:46 +0200 Subject: [PATCH] Upgrade to sylius 2.0 --- composer.json | 23 +- src/Resources/config/Product.xml | 251 ++++++++++++++++++ .../config/api_resources/Product.xml | 251 ------------------ .../config/services/event_listener.xml | 84 +++--- .../views/Shop/Menu/_searchForm.html.twig | 3 +- .../ContextProvider/SearchFormProvider.php | 5 +- 6 files changed, 308 insertions(+), 309 deletions(-) create mode 100644 src/Resources/config/Product.xml delete mode 100644 src/Resources/config/api_resources/Product.xml diff --git a/composer.json b/composer.json index 71642b00..7a8deff2 100644 --- a/composer.json +++ b/composer.json @@ -7,10 +7,8 @@ "php": "^8.1", "ext-json": "*", "friendsofsymfony/elastica-bundle": "^6.0", - "sylius/sylius": "~1.13.0", - "symfony/property-access": "^5.4 || ^6.0", - "symfony/webpack-encore-bundle": "^1.15", - "symfony/proxy-manager-bridge": "^5.4 || ^6.0" + "sylius/sylius": "~2.0.0", + "symfony/webpack-encore-bundle": "^2.0" }, "require-dev": { "behat/behat": "^3.6.1", @@ -40,16 +38,15 @@ "robertfausk/behat-panther-extension": "^1.1", "sylius-labs/coding-standard": "^4.2", "sylius-labs/suite-tags-extension": "^0.2", - "symfony/browser-kit": "^5.4 || ^6.0", - "symfony/debug-bundle": "^5.4 || ^6.0", - "symfony/dotenv": "^5.4 || ^6.0", - "symfony/intl": "^5.4 || ^6.0", - "symfony/web-profiler-bundle": "^5.4 || ^6.0" + "symfony/browser-kit": "^6.4 || ^7.1", + "symfony/debug-bundle": "^6.4 || ^7.1", + "symfony/http-client": "^6.4 || ^7.1", + "symfony/intl": "^6.4 || ^7.1", + "symfony/web-profiler-bundle": "^6.4 || ^7.1" }, "conflict": { "api-platform/core": "v2.7.17", - "symfony/framework-bundle": "6.2.8", - "behat/mink-selenium2-driver": ">=1.7.0" + "symfony/framework-bundle": "6.2.8" }, "config": { "sort-packages": true, @@ -62,10 +59,10 @@ }, "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "2.0-dev" }, "symfony": { - "require": "^5.4 || ^6.0" + "require": "^6.0 || ^7.0" } }, "autoload": { diff --git a/src/Resources/config/Product.xml b/src/Resources/config/Product.xml new file mode 100644 index 00000000..c86c99df --- /dev/null +++ b/src/Resources/config/Product.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/api_resources/Product.xml b/src/Resources/config/api_resources/Product.xml deleted file mode 100644 index 30f76346..00000000 --- a/src/Resources/config/api_resources/Product.xml +++ /dev/null @@ -1,251 +0,0 @@ - - - - - sylius - - - ASC - - - - - GET - /shop/products/search - false - - - shop:product:index - sylius:shop:product:index - - - - - - query - query - false - - string - - Search query - - - limit - query - false - - integer - 10 - - Number of items to return per page - - - page - query - false - - integer - 1 - - Page number - - - order_by - query - false - - string - - sold_units - product_created_at - price - - - Field to order by (sold_units, product_created_at, price) - - - sort - query - false - - string - - asc - desc - - - Order direction (asc, desc) - - - facets - query - false - deepObject - true - Filter facets with dynamic keys. Example: facets[t_shirt_material][]=100%25_cotton&facets[t_shirt_brand][]=modern_wear - - - - - Successful response - - - - object - - - array - - object - - - array - - string - - - - string - - - integer - - - array - - object - - - integer - - - string - - - string - - - - - - integer - - - string - - - array - - string - - - - array - - string - - - - array - - string - - - - string - date-time - - - string - date-time - - - string - - - array - - array - - - - string - - - string - - - string - - - - - - object - - object - - - integer - - - integer - - - array - - object - - - string - - - integer - - - - - - - - - object - - - integer - - - boolean - - - boolean - - - integer - - - integer - - - integer - - - - - - - - - - - - - - - - - diff --git a/src/Resources/config/services/event_listener.xml b/src/Resources/config/services/event_listener.xml index 875a0a33..d9174c49 100644 --- a/src/Resources/config/services/event_listener.xml +++ b/src/Resources/config/services/event_listener.xml @@ -2,47 +2,47 @@ - - - - - %sylius.model.product_attribute.class% - - - - %sylius.model.product_option.class% - - - - getProduct - %sylius.model.product.class% - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/views/Shop/Menu/_searchForm.html.twig b/src/Resources/views/Shop/Menu/_searchForm.html.twig index bf5cb90f..d8e32e2b 100644 --- a/src/Resources/views/Shop/Menu/_searchForm.html.twig +++ b/src/Resources/views/Shop/Menu/_searchForm.html.twig @@ -1,4 +1,5 @@ -
+{#
#} +