Skip to content

Commit 6e91007

Browse files
authored
Release 2.0.0 (#45)
1 parent dd5c565 commit 6e91007

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+528
-396
lines changed

CHANGELOG_de-DE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 2.0.0
2+
- [Issue-43] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/43) Kompatibilität mit Shopware 6.5
3+
- [Issue-33] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/33) Hinzufügen eines neuen Umschalters auf der Vergleichsseite, um nur die Eigenschaften anzuzeigen, die sich zwischen den Produkten unterscheiden
4+
- [Issue-41] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/41) Unterstützung für benutzerdefinierte Felder (außer Typ json, media, entity), die benutzerdefinierten Felder des Produkts werden in der Vergleichstabelle angezeigt, wenn sie in der Konfiguration des Plugins vorkonfiguriert sind
5+
- Behebung verschiedener UI-Bugs und Kompatibilität mit 6.5 Styles: Anpassung von Klassennamen, Blöcken und Styling
6+
- Bessere Druckausgabe - Entfernen von überflüssigen Zeilen, Leerzeichen und Cookie-Balken beim Drucken
7+
- Die Abschnitte Übersicht und Spezifikation sind jetzt zusammenklappbar
8+
19
# 1.2.2
210
- Add spaces between Tags
311

CHANGELOG_en-GB.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 2.0.0
2+
- [Issue-43] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/43) Shopware 6.5 compatibility
3+
- [Issue-33] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/33) Add a new toggle in the Comparison page to show only properties have differences between products
4+
- [Issue-41] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/41) Support for custom fields (except type json, media, entity), the product's custom fields will be shown in the comparison table if they're pre-configured in Plugin's configuration
5+
- Fix various UI bugs and compatible with 6.5 styles: adjust classes name, blocks, styling
6+
- Nicer print output - Remove redundant lines, spaces, and cookie bar on printing
7+
- Overview and Specification sections are now collapsible
8+
19
# 1.2.2
210
- Leerzeichen zwischen Tags hinzufügen
311

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
## Requirements
1919

20-
| Version | Requirements |
21-
|------------|---------------------------- |
22-
| 1.2.1 | Shopware 6.4 >= |
20+
| Version | Requirements |
21+
|------------|------------------------------|
22+
| 2.0.0 | Shopware 6.5 >= |
23+
| 1.2.1 | Shopware 6.4 >= 6.4.20.1 |
2324

2425
## License
2526

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "frosh/product-compare",
33
"description": "A Simple Product Compare plugin for Shopware 6",
4-
"version": "1.2.2",
4+
"version": "2.0.0",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
77
"authors": [
@@ -15,8 +15,8 @@
1515
}
1616
],
1717
"require": {
18-
"shopware/core": "^6.4",
19-
"shopware/storefront": "^6.4"
18+
"shopware/core": "^6.5",
19+
"shopware/storefront": "^6.5"
2020
},
2121
"extra": {
2222
"shopware-plugin-class": "Frosh\\FroshProductCompare\\FroshProductCompare",

src/Controller/CompareProductController.php

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,44 @@
33
namespace Frosh\FroshProductCompare\Controller;
44

55
use Frosh\FroshProductCompare\Page\CompareProductPageLoader;
6-
use Shopware\Core\Framework\Routing\Annotation\RouteScope;
76
use Shopware\Core\System\SalesChannel\SalesChannelContext;
87
use Shopware\Storefront\Controller\StorefrontController;
98
use Shopware\Storefront\Page\GenericPageLoaderInterface;
109
use Symfony\Component\HttpFoundation\Request;
1110
use Symfony\Component\HttpFoundation\Response;
1211
use Symfony\Component\Routing\Annotation\Route;
1312

14-
/**
15-
* @RouteScope(scopes={"storefront"})
16-
*/
13+
#[Route(defaults: ['_routeScope' => ['storefront']])]
1714
class CompareProductController extends StorefrontController
1815
{
19-
private CompareProductPageLoader $compareProductPageLoader;
20-
21-
private GenericPageLoaderInterface $genericPageLoader;
22-
2316
public function __construct(
24-
CompareProductPageLoader $compareProductPageLoader,
25-
GenericPageLoaderInterface $genericPageLoader
17+
private readonly CompareProductPageLoader $compareProductPageLoader,
18+
private readonly GenericPageLoaderInterface $genericPageLoader
2619
) {
27-
$this->compareProductPageLoader = $compareProductPageLoader;
28-
$this->genericPageLoader = $genericPageLoader;
2920
}
3021

31-
/**
32-
* @Route("/compare", name="frontend.compare.page", options={"seo"="false"}, methods={"GET"})
33-
*/
22+
#[Route(path: '/compare', name: 'frontend.compare.page', options: ['seo' => false], defaults: ['_httpCache' => false], methods: ['GET'])]
3423
public function comparePage(Request $request, SalesChannelContext $context): Response
3524
{
3625
$page = $this->genericPageLoader->load($request, $context);
26+
3727
return $this->renderStorefront('@FroshProductCompare/storefront/page/compare.html.twig', compact('page'));
3828
}
3929

40-
/**
41-
* @Route("/compare/content", name="frontend.compare.content", options={"seo"="false"}, methods={"POST"}, defaults={"XmlHttpRequest"=true}))
42-
*/
30+
#[Route(path: '/compare/content', name: 'frontend.compare.content', options: ['seo' => false], defaults: ['_httpCache' => false, 'XmlHttpRequest' => true], methods: ['POST'])]
4331
public function comparePageContent(Request $request, SalesChannelContext $context): Response
4432
{
45-
$productIds = $request->request->get('productIds', []);
33+
$productIds = $request->get('productIds', []);
4634

4735
$page = $this->compareProductPageLoader->load($productIds, $request, $context);
4836

4937
return $this->renderStorefront('@FroshProductCompare/storefront/component/compare/content.html.twig', ['page' => $page]);
5038
}
5139

52-
/**
53-
* @Route("/compare/offcanvas", name="frontend.compare.offcanvas", options={"seo"="false"}, methods={"POST"}, defaults={"XmlHttpRequest"=true})
54-
*/
40+
#[Route(path: '/compare/offcanvas', name: 'frontend.compare.offcanvas', options: ['seo' => false], defaults: ['_httpCache' => false, 'XmlHttpRequest' => true], methods: ['POST'])]
5541
public function offcanvas(Request $request, SalesChannelContext $context): Response
5642
{
57-
$productIds = $request->request->get('productIds', []);
43+
$productIds = $request->get('productIds', []);
5844

5945
$page = $this->compareProductPageLoader->loadPreview($productIds, $request, $context);
6046

src/CrossSellingComparable/CrossSellingComparableCollection.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
66

77
/**
8-
* @method void add(CrossSellingComparableEntity $entity)
9-
* @method void set(string $key, CrossSellingComparableEntity $entity)
10-
* @method CrossSellingComparableEntity[] getIterator()
11-
* @method CrossSellingComparableEntity[] getElements()
12-
* @method CrossSellingComparableEntity|null get(string $key)
13-
* @method CrossSellingComparableEntity|null first()
14-
* @method CrossSellingComparableEntity|null last()
8+
* @extends EntityCollection<CrossSellingComparableEntity>
159
*/
1610
class CrossSellingComparableCollection extends EntityCollection
1711
{

src/CrossSellingComparable/CrossSellingComparableEntity.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,65 +25,41 @@ class CrossSellingComparableEntity extends Entity
2525
*/
2626
protected $isComparable;
2727

28-
/**
29-
* @return string
30-
*/
3128
public function getProductCrossSellingId(): string
3229
{
3330
return $this->productCrossSellingId;
3431
}
3532

36-
/**
37-
* @param string $productCrossSellingId
38-
*/
3933
public function setProductCrossSellingId(string $productCrossSellingId): void
4034
{
4135
$this->productCrossSellingId = $productCrossSellingId;
4236
}
4337

44-
/**
45-
* @return ProductCrossSellingEntity
46-
*/
4738
public function getProductCrossSelling(): ProductCrossSellingEntity
4839
{
4940
return $this->productCrossSelling;
5041
}
5142

52-
/**
53-
* @param ProductCrossSellingEntity $productCrossSelling
54-
*/
5543
public function setProductCrossSelling(ProductCrossSellingEntity $productCrossSelling): void
5644
{
5745
$this->productCrossSelling = $productCrossSelling;
5846
}
5947

60-
/**
61-
* @return bool|null
62-
*/
6348
public function isComparable(): ?bool
6449
{
6550
return $this->isComparable;
6651
}
6752

68-
/**
69-
* @return bool|null
70-
*/
7153
public function getIsComparable(): ?bool
7254
{
7355
return $this->isComparable;
7456
}
7557

76-
/**
77-
* @param bool|null $isComparable
78-
*/
7958
public function setIsComparable(?bool $isComparable): void
8059
{
8160
$this->isComparable = $isComparable;
8261
}
8362

84-
/**
85-
* @param bool|null $isComparable
86-
*/
8763
public function setComparable(?bool $isComparable): void
8864
{
8965
$this->isComparable = $isComparable;

src/DependencyInjection/services.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<service id="Frosh\FroshProductCompare\Page\CompareProductPageLoader">
1919
<argument type="service" id="Shopware\Core\Content\Product\Cart\ProductGateway"/>
2020
<argument type="service" id="Shopware\Storefront\Page\GenericPageLoader"/>
21-
<argument type="service" id="Symfony\Component\EventDispatcher\EventDispatcherInterface" />
2221
<argument type="service" id="product_review.repository" />
22+
<argument type="service" id="custom_field.repository" />
2323
<argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService" />
2424
</service>
2525

@@ -29,6 +29,9 @@
2929
<call method="setContainer">
3030
<argument type="service" id="service_container"/>
3131
</call>
32+
<call method="setTwig">
33+
<argument type="service" id="twig"/>
34+
</call>
3235
</service>
3336

3437
<!-- Subscriber -->

src/Page/CompareProductPage.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace Frosh\FroshProductCompare\Page;
44

55
use Shopware\Core\Content\Product\SalesChannel\Listing\ProductListingResult;
66
use Shopware\Core\Content\Property\PropertyGroupCollection;
7+
use Shopware\Core\System\CustomField\CustomFieldCollection;
78
use Shopware\Storefront\Page\Page;
89

910
class CompareProductPage extends Page
1011
{
1112
protected ProductListingResult $products;
13+
1214
protected PropertyGroupCollection $properties;
1315

16+
protected CustomFieldCollection $customFields;
17+
1418
public function getProducts(): ProductListingResult
1519
{
1620
return $this->products;
@@ -30,4 +34,14 @@ public function setProperties(PropertyGroupCollection $properties): void
3034
{
3135
$this->properties = $properties;
3236
}
37+
38+
public function getCustomFields(): CustomFieldCollection
39+
{
40+
return $this->customFieldCollection;
41+
}
42+
43+
public function setCustomFields(CustomFieldCollection $customFieldCollection): void
44+
{
45+
$this->customFieldCollection = $customFieldCollection;
46+
}
3347
}

0 commit comments

Comments
 (0)