Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sschreier committed May 20, 2024
0 parents commit 36dbe8b
Show file tree
Hide file tree
Showing 16 changed files with 657 additions and 0 deletions.
132 changes: 132 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# An extension to implement a shop without a buy function and therefore as a pure showcase for Shopware 6

An extension to _implement a shop without a buy function_ and therefore as a pure showcase. To do this, you can _hide_ the _search field_, the _wish list button_, the _customer account button_ and the _cart button_ and _the prices_. _If_ the _functions are hidden_, the _pages are redirected to a self-defined target_. The _redirection can be to_ the _homepage_, a _category_ or a _landing page_.

## how to use it

### product settings

- assigning a custom **product page layout** for the product in the tab "**Layout**"

### product page layout settings

- create a **product page layout** under "**Content**" and "**Shopping Experiences**"
- replace the cms element **Buy box** with a cms element **Text** via the **replace element icon** if the cart should not be shown
- remove the cms block **Cross Selling** if you don't want to display assigned products

### shop settings

- deactivate the switch **Activate wishlist** under **Settings**, **Shop** and **Cart settings** in the area "**Wishlist**" if the wish list should not be shown
- deactivate the switch **Display buy buttons in listings** under **Settings**, **Shop** and **Products** in the area "**Product**" if the cart should not be shown

## Possible Configurations
- select, if the search field should be shown (*1)
- select, if the wish list button should be shown (*1)
- select, if the customer account button should be shown (*1)
- select, if the cart button should be shown (*1)
- select, if the prices should be shown
- select, if the search field should be right-aligned

## Possible Configurations for the redirection
- activate the redirection (*1)
- select the redirect target (*1)
- select the category to redirect to (*1)
- select the landingpage to redirect to (*1)

### (*1): some changes in the settings within the configuration are not immediately visible in the frontend of the shop
After changing settings specifically for the redirections, you should over and over again "**browse privately**" in a **new window** (in **Google Chrome** you can find the **Incognito mode** at the top right over the button **...** and **New Incognito Window**)

## How to install the extension
### via console (recommended)
1. Download the latest _SschreierShowcase-master.zip_.
2. Unzip the zip file and rename the folder to _SschreierShowcase_.
3. Move the folder to the project folder _custom/plugins/_ .
4. Connect to the console via ssh:

```
bin/console plugin:refresh
bin/console plugin:install --activate SschreierShowcase
```

### via composer
1. Add the repository URL to the composer.json of the project
```
"repositories": [
...,
{
"type": "vcs",
"url": "https://github.com/sschreier/SschreierShowcase"
}
],
```

2. Connect to the console via ssh and install the plugin source code via the command
```
composer require sschreier/sschreiershowcase
bin/console plugin:refresh
bin/console plugin:install --activate SschreierShowcase
```

### via zip upload
1. Download the latest _SschreierShowcase-master.zip_.
2. Unzip the zip file and rename the folder to _SschreierShowcase_.
3. Zip the folder to _SschreierShowcase.zip_.
4. Upload the zip in the Shopware Administration.
5. Install & Activate the extension.

#### extension update (zip)
1. Download the latest _SschreierShowcase-master.zip_.
2. Unzip the zip file and rename the folder to _SschreierShowcase_.
3. Zip the folder to _SschreierShowcase.zip_.
4. Upload the zip in the Shopware Administration.
5. Update the extension.

## Images

### home page as pure showcase without search field, wish list button, customer account button and cart button and prices

![home page as pure showcase without search field, wish list button, customer account button and cart button and prices](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image1.jpg)

### product category as pure showcase without search field, wish list button, customer account button and cart button and prices

![product category as pure showcase without search field, wish list button, customer account button and cart button and prices](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image2.jpg)

### product detail page as pure showcase without search field, wish list button, customer account button, cart button, prices and buy box

![product detail page as pure showcase without search field, wish list button, customer account button, cart button, prices and buy box](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image3.jpg)

### home page as pure showcase without wish list button, customer account button, cart button and prices but with search field

![home page as pure showcase without wish list button, customer account button, cart button and prices but with search field](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image4.jpg)

### home page as pure showcase without wish list button, customer account button, cart button and prices but with opened search field with no prices

![home page as pure showcase without wish list button, customer account button, cart button and prices but with opened search field with no prices](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image5.jpg)

### product category as pure showcase without wish list button, customer account button, cart button and prices but with search field

![product category as pure showcase without wish list button, customer account button, cart button and prices but with search field](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image6.jpg)

### product detail page as pure showcase without wish list button, customer account button, cart button, prices and buy box but with search field

![product detail page as pure showcase without wish list button, customer account button, cart button, prices and buy box but with search field](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image7.jpg)

### extension configuration for case 1 part 1

![extension configuration for case 1 part 1](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image8.jpg)

### extension configuration for case 1 part 2

![extension configuration for case 1 part 2](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image9.jpg)

### extension configuration for case 2 part 1

![extension configuration for case 2 part 1](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image10.jpg)

### extension configuration for case 2 part 2

![extension configuration for case 2 part 2](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image11.jpg)

### product page layout without the cms element Buy box

![product page layout without the cms element Buy box](https://www.sebastianschreier.de/plugins/SschreierShowcase/SschreierShowcase-Image12.jpg)
43 changes: 43 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "sschreier/sschreiershowcase",
"description": "shop without buy function as a pure showcase",
"version": "1.0.0",
"type": "shopware-platform-plugin",
"license": "proprietary",
"authors": [
{
"name": "Sebastian Schreier",
"role": "Manufacturer"
}
],
"require": {
"shopware/core": "~6.6.0",
"shopware/storefront": "~6.6.0"
},
"extra": {
"shopware-plugin-class": "Sschreier\\Showcase\\SschreierShowcase",
"plugin-icon": "src/Resources/config/plugin.png",
"copyright": "Sebastian Schreier",
"label": {
"de-DE": "Shop ohne Kauf-Funktion als reines Schaufenster",
"en-GB": "shop without buy function as a pure showcase"
},
"description": {
"de-DE": "Mit der Erweiterung kann ein Shop ohne Kauf-Funktion und somit als reines Schaufenster umgesetzt werden. Dazu kann man das Suchfeld, die Merkzettel-, Kundenkonto- und Warenkorb-Schaltfläche und die Preise ausblenden. Insofern die Funktionen ausgeblendet sind, werden die Seiten auf ein selbst festgelegtes Ziel weitergeleitet. Die Weiterleitung kann auf die Startseite, eine Kategorie oder eine Landingpage erfolgen.",
"en-GB": "With the extension, a shop can be implemented without a buy function and therefore as a pure showcase. To do this, you can hide the search field, the wish list button, the customer account button and the cart button and the prices. If the functions are hidden, the pages are redirected to a self-defined target. The redirection can be to the homepage, a category or a landing page."
},
"manufacturerLink": {
"de-DE": "https://www.sebastianschreier.de",
"en-GB": "https://www.sebastianschreier.de"
},
"supportLink": {
"de-DE": "https://www.sebastianschreier.de",
"en-GB": "https://www.sebastianschreier.de"
}
},
"autoload": {
"psr-4": {
"Sschreier\\Showcase\\": "src/"
}
}
}
1 change: 1 addition & 0 deletions src/Resources/app/storefront/src/scss/base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'showcase.scss';
17 changes: 17 additions & 0 deletions src/Resources/app/storefront/src/scss/showcase.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.header-row-container {
&.hide-header-search-col {
.header-search-col {
.header-search-container {
display: none;
}
}
}

.header-search-container {
&.align-to-right {
.header-search {
margin-right: 0;
}
}
}
}
100 changes: 100 additions & 0 deletions src/Resources/config/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/master/src/Core/System/SystemConfig/Schema/config.xsd">

<card>
<title>general settings</title>
<title lang="de-DE">Allgemeine Einstellungen</title>

<input-field type="bool">
<name>showSearchField</name>
<label>show search field and leave search reachable</label>
<label lang="de-DE">Suchfeld anzeigen und Suche erreichbar lassen</label>
<defaultValue>false</defaultValue>
</input-field>

<input-field type="bool">
<name>showWishListButton</name>
<label>show wish list button and leave wish list reachable</label>
<label lang="de-DE">Merkzettel-Schaltfläche anzeigen und Merkzettel erreichbar lassen</label>
<defaultValue>false</defaultValue>
</input-field>

<input-field type="bool">
<name>showCustomerAccountButton</name>
<label>show customer account button and leave account reachable</label>
<label lang="de-DE">Kundenkonto-Schaltfläche anzeigen und Kundenkonto erreichbar lassen</label>
<defaultValue>false</defaultValue>
</input-field>

<input-field type="bool">
<name>showCartButton</name>
<label>show cart button and leave checkout reachable</label>
<label lang="de-DE">Warenkorb-Schaltfläche anzeigen und Checkout erreichbar lassen</label>
<defaultValue>false</defaultValue>
</input-field>

<input-field type="bool">
<name>showPrices</name>
<label>show prices</label>
<label lang="de-DE">Preise anzeigen</label>
<defaultValue>false</defaultValue>
</input-field>

<input-field type="bool">
<name>alignSearchFieldToRight</name>
<label>align the search field to the right</label>
<label lang="de-DE">Suchfeld rechtsbündig ausrichten</label>
<defaultValue>false</defaultValue>
</input-field>
</card>
<card>
<title>settings for the redirection</title>
<title lang="de-DE">Einstellungen für die Weiterleitung</title>

<input-field type="bool">
<name>redirectionIsActive</name>
<label>active</label>
<label lang="de-DE">aktiv</label>
<defaultValue>true</defaultValue>
</input-field>

<input-field type="single-select">
<name>redirectTarget</name>
<options>
<option>
<id>homepage</id>
<name>to home page</name>
<name lang="de-DE">zur Startseite</name>
</option>
<option>
<id>category</id>
<name>to a category</name>
<name lang="de-DE">zu einer Kategorie</name>
</option>
<option>
<id>landing_page</id>
<name>to a landingpage</name>
<name lang="de-DE">zu einer Landingpage</name>
</option>
</options>
<label>redirect</label>
<label lang="de-DE">Umleitung</label>
<defaultValue>homepage</defaultValue>
</input-field>

<component name="sw-entity-single-select">
<name>redirectToCategory</name>
<entity>category</entity>
<label>category to redirect to</label>
<label lang="de-DE">Kategorie, auf die umgeleitet werden soll</label>
</component>

<component name="sw-entity-single-select">
<name>redirectToLandingpage</name>
<entity>landing_page</entity>
<label>landingpage to redirect to</label>
<label lang="de-DE">Landingpage, auf die umgeleitet werden soll</label>
</component>
</card>
</config>
Binary file added src/Resources/config/plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="Sschreier\Showcase\Storefront\Subscriber\FrontendSubscriber">
<argument type="service" id="router"/>
<argument type="service" id="Shopware\Storefront\Framework\Routing\Router"/>
<argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
<tag name="kernel.event_subscriber"/>
</service>
</services>
</container>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% sw_extends '@Storefront/storefront/component/listing/filter-panel.html.twig' %}

{% block component_filter_panel_item_price %}
{% block component_filter_panel_item_price_showcase_before %}{% endblock %}

{% if not(config('SschreierShowcase.config.showPrices')) %}
{% block component_filter_panel_item_price_showcase_custom %}{% endblock %}
{% else %}
{% block component_filter_panel_item_price_showcase_default_before %}{% endblock %}

{{ parent() }}

{% block component_filter_panel_item_price_showcase_default_after %}{% endblock %}
{% endif %}

{% block component_filter_panel_item_price_showcase_after %}{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}

{% block component_product_box_price_info %}
{% block component_product_box_price_info_showcase_before %}{% endblock %}

{% if not(config('SschreierShowcase.config.showPrices')) %}
{% block component_product_box_price_info_showcase_custom %}{% endblock %}
{% else %}
{% block component_product_box_price_info_showcase_default_before %}{% endblock %}

{{ parent() }}

{% block component_product_box_price_info_showcase_default_after %}{% endblock %}
{% endif %}

{% block component_product_box_price_info_showcase_after %}{% endblock %}
{% endblock %}
17 changes: 17 additions & 0 deletions src/Resources/views/storefront/layout/footer/footer.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% sw_extends '@Storefront/storefront/layout/footer/footer.html.twig' %}

{% block layout_footer_vat %}
{% block layout_footer_vat_showcase_before %}{% endblock %}

{% if not(config('SschreierShowcase.config.showPrices')) %}
{% block layout_footer_vat_showcase_custom %}{% endblock %}
{% else %}
{% block layout_footer_vat_showcase_default_before %}{% endblock %}

{{ parent() }}

{% block layout_footer_vat_showcase_default_after %}{% endblock %}
{% endif %}

{% block layout_footer_vat_showcase_after %}{% endblock %}
{% endblock %}
Loading

0 comments on commit 36dbe8b

Please sign in to comment.