Skip to content

Commit 0f03fd1

Browse files
committed
Release 1.2.0
1 parent 01af43e commit 0f03fd1

File tree

9 files changed

+73
-8
lines changed

9 files changed

+73
-8
lines changed

CHANGELOG_en-GB.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.2.0
2+
- [Issue-20] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/20) Fixes cross-sellings compare does not work with product variants
3+
- [Issue-19] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/19) Added a new plugin's config to hide attributes (description/price/rating/manufacturer or the whole section)
4+
15
# 1.1.0
26
- Shopware 6.4 compatibility
37
- [Issue-14] (https://github.com/FriendsOfShopware/FroshProductCompare/issues/14) Fixes cross-sellings compare does not work with product variants

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ http://shopware.thuong.lv/
2121

2222
| Version | Requirements |
2323
|--------- |---------------------------- |
24-
| 1.0.6 | Shopware 6.4 >= |
24+
| 1.2.0 | Shopware 6.4 >= |
2525

2626
## License
2727

composer.json

Lines changed: 1 addition & 1 deletion
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.1.0",
4+
"version": "1.2.0",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
77
"authors": [

src/Resources/app/storefront/dist/storefront/js/frosh-product-compare.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Resources/config/config.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,45 @@
2020
<defaultValue>false</defaultValue>
2121
</component>
2222

23+
<input-field type="multi-select">
24+
<name>hideAttributes</name>
25+
<label>Hide attributes</label>
26+
<label lang="de-DE">Attribute ausblenden</label>
27+
<options>
28+
<option>
29+
<id>description</id>
30+
<name>Description</name>
31+
<name lang="de-DE">Beschreibung</name>
32+
</option>
33+
<option>
34+
<id>manufacturer</id>
35+
<name>Manufacturer</name>
36+
<name lang="de-DE">Hersteller</name>
37+
</option>
38+
<option>
39+
<id>price</id>
40+
<name>Price</name>
41+
<name lang="de-DE">Preis</name>
42+
</option>
43+
<option>
44+
<id>rating</id>
45+
<name>Rating</name>
46+
<name lang="de-DE">Bewertung</name>
47+
</option>
48+
<option>
49+
<id>overview</id>
50+
<name>Overview (Hide Overview section)</name>
51+
<name lang="de-DE">Übersicht (Abschnitt Übersicht ausblenden)</name>
52+
</option>
53+
<option>
54+
<id>specs</id>
55+
<name>Specifications (Hide Specifications section)</name>
56+
<name lang="de-DE">Spezifikationen (Abschnitt Spezifikationen ausblenden)</name>
57+
</option>
58+
59+
</options>
60+
</input-field>
61+
2362
<component name="sw-property-multi-select">
2463
<name>selectedProperties</name>
2564
<label>Only show these properties</label>

src/Resources/public/administration/js/frosh-product-compare.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Resources/views/storefront/component/compare/content.html.twig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{% block frosh_product_compare_table_container %}
22
<div class="comparison-table">
33
{% set products = page.products %}
4+
{% set hideAttributes = config('FroshProductCompare.config.hideAttributes') %}
5+
6+
{% set hideOverview = 'overview' in hideAttributes %}
7+
{% set hideDescription = 'description' in hideAttributes %}
8+
{% set hidePrice = 'price' in hideAttributes %}
9+
{% set hideRating = 'rating' in hideAttributes %}
10+
{% set hideManufacturer = 'manufacturer' in hideAttributes %}
11+
{% set hideSpecs = 'specs' in hideAttributes %}
12+
413
{% set productsCount = products.count %}
514
{% set isAjaxContent = app.request.attributes.get('_route') == 'frontend.compare.content' %}
615
{% if productsCount is same as(0) %}
@@ -109,8 +118,12 @@
109118
</tr>
110119
</thead>
111120
{% endblock %}
112-
{% sw_include '@Storefront/storefront/component/compare/section/overview.html.twig' %}
113-
{% sw_include '@Storefront/storefront/component/compare/section/specification.html.twig' %}
121+
{% if not hideOverview %}
122+
{% sw_include '@Storefront/storefront/component/compare/section/overview.html.twig' %}
123+
{% endif %}
124+
{% if not hideSpecs %}
125+
{% sw_include '@Storefront/storefront/component/compare/section/specification.html.twig' %}
126+
{% endif %}
114127
{% if isAjaxContent %}
115128
<tbody class="hide-on-print">
116129
<tr>

src/Resources/views/storefront/component/compare/section/overview.html.twig

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,30 @@
33
<tr>
44
<th class="text-uppercase" colspan="{{ productsCount + 1 }}">{{ "froshProductCompare.section.overview.title"|trans|sw_sanitize }}</th>
55
</tr>
6+
{% if not hideManufacturer %}
67
<tr>
78
<th>{{ "froshProductCompare.section.overview.manufacturer"|trans|sw_sanitize }}</th>
89
{% sw_include '@Storefront/storefront/component/compare/partial/translated-nested-attribute-cells.html.twig' with {
910
attribute: 'manufacturer'
1011
} %}
1112
</tr>
13+
{% endif %}
14+
15+
{% if not hidePrice %}
1216
<tr>
1317
<th>{{ "froshProductCompare.section.overview.price"|trans|sw_sanitize }}</th>
1418
{% sw_include '@Storefront/storefront/component/compare/partial/price-cells.html.twig' %}
1519
</tr>
20+
{% endif %}
21+
22+
{% if not hideDescription %}
1623
<tr>
1724
<th>{{ "froshProductCompare.section.overview.description"|trans|sw_sanitize }}</th>
1825
{% sw_include '@Storefront/storefront/component/compare/partial/description-cells.html.twig' %}
1926
</tr>
20-
{% if shopware.config.detail.showReviews %}
27+
{% endif %}
28+
29+
{% if not hideRating %}
2130
<tr>
2231
<th>{{ "froshProductCompare.section.overview.rating"|trans|sw_sanitize }}</th>
2332
{% sw_include '@Storefront/storefront/component/compare/partial/rating-cells.html.twig' %}

src/Subscriber/FroshCrossSellingProductListingSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function handleCrossSellingLoadedEvent(ProductCrossSellingsLoadedEvent $e
116116

117117
$products = ProductListingResult::createFrom($products);
118118

119-
$productWithComparableData = $this->compareProductPageLoader->loadProductCompareData($products, $context);
119+
$productWithComparableData = $this->compareProductPageLoader->loadProductCompareData($products, $salesChannelContext);
120120

121121
$crossSellingElement->setProducts(new ProductCollection($productWithComparableData));
122122
}

0 commit comments

Comments
 (0)