Skip to content

Commit 20b6f99

Browse files
committed
initial version
0 parents  commit 20b6f99

File tree

14 files changed

+328
-0
lines changed

14 files changed

+328
-0
lines changed

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2024 Kiwee Software sp. z o.o.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Kiwee Demo Shop Plugin
2+
3+
The plugin renders a bar on the top of the page with the text `This is a demo shop`.
4+
The message can be changed via the administration panel at `Extensions > My Extensions > Kiwee Demo Plugin > (Configure)`.
5+
6+
## Installation
7+
8+
```shell
9+
composer require kiwee/shopware-demo-plugin && \
10+
bin/console plugin:install KiweeDemo --activate
11+
```
12+
13+
## Running integration tests
14+
```shell
15+
composer exec phpunit -- -c vendor/kiwee/shopware-demo-plugin/phpunit.xml
16+
```
17+
18+
## License
19+
This project is licensed under the MIT License.
20+
Copyright 2024 [Kiwee](https://kiwee.eu) sp. z o.o.

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "kiwee/shopware-demo-plugin",
3+
"description": "KiweeDemo",
4+
"authors": [
5+
{
6+
"name": "Kiwee Software sp. z o.o.",
7+
"email": "hi@kiwee.eu",
8+
"homepage": "https://kiwee.eu"
9+
}
10+
],
11+
"type": "shopware-platform-plugin",
12+
"license": "MIT",
13+
"version": "0.0.2",
14+
"require": {
15+
"shopware/core": "~6.6.0"
16+
},
17+
"autoload": {
18+
"psr-4": {
19+
"Kiwee\\KiweeDemo\\": "src/"
20+
}
21+
},
22+
"extra": {
23+
"shopware-plugin-class": "Kiwee\\KiweeDemo\\KiweeDemo",
24+
"label": {
25+
"de-DE": "Kiwee Demo Plugin",
26+
"en-GB": "Kiwee Demo plugin"
27+
}
28+
}
29+
}

phpunit.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" bootstrap="tests/TestBootstrap.php" executionOrder="random">
3+
<php>
4+
<ini name="error_reporting" value="-1"/>
5+
<env name="APP_ENV" value="test" />
6+
<server name="KERNEL_CLASS" value="Shopware\Core\Kernel"/>
7+
<server name="APP_ENV" value="test"/>
8+
<env name="APP_DEBUG" value="1"/>
9+
<env name="APP_SECRET" value="s$cretf0rt3st"/>
10+
<env name="SHELL_VERBOSITY" value="-1"/>
11+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
12+
</php>
13+
<testsuites>
14+
<testsuite name="all">
15+
<directory>./tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<coverage>
19+
<include>
20+
<directory suffix=".php">./src/</directory>
21+
</include>
22+
</coverage>
23+
</phpunit>

src/KiweeDemo.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Kiwee\KiweeDemo;
4+
5+
use Shopware\Core\Framework\Plugin;
6+
7+
class KiweeDemo extends Plugin
8+
{
9+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.topbar {
2+
background-color: goldenrod;
3+
width: 100%;
4+
}

src/Resources/config/config.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/master/src/Core/System/SystemConfig/Schema/config.xsd">
4+
5+
<card>
6+
<title>Kiwee Demo Configuration</title>
7+
<input-field>
8+
<name>topbar</name>
9+
<label>Topbar Text</label>
10+
<defaultValue>This is a demo shop.</defaultValue>
11+
</input-field>
12+
</card>
13+
</config>

src/Resources/config/services.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<services>
8+
<service id="Kiwee\KiweeDemo\Storefront\Pagelet\Header\HeaderPageletEventSubscriber">
9+
<argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
10+
<tag name="kernel.event_subscriber"/>
11+
</service>
12+
</services>
13+
</container>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<services>
8+
<service id="Kiwee\KiweeDemo\Storefront\Pagelet\Header\HeaderPageletEventSubscriber">
9+
<argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
10+
<tag name="kernel.event_subscriber"/>
11+
</service>
12+
</services>
13+
</container>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% sw_extends '@Storefront/storefront/base.html.twig' %}
2+
3+
{% block base_header_inner %}
4+
<div class="topbar">&nbsp;{{ page.header.extensions.topbar.topbarText }}</div>
5+
{{ parent() }}
6+
{% endblock %}

0 commit comments

Comments
 (0)