Skip to content

Commit

Permalink
Merge pull request #2 from openmindculture/release/1.0.0
Browse files Browse the repository at this point in the history
Release candidate 1.0.0
  • Loading branch information
openmindculture authored Apr 3, 2024
2 parents e36fadf + 6d8115d commit 57c7336
Show file tree
Hide file tree
Showing 18 changed files with 1,144 additions and 92 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# IngoSCostTransparency for Shopware 6

## 1.0.0 - tbd
- initial release
85 changes: 73 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Ingo's Cost Transparency for Shopware 6
# Cost Transparency for Shopware 6

Inspired by potential customers' requirements and based on [Ingo Steinke](https://www.ingo-steinke.com/)'s [Shopware 6 Theme/Plugin Development Template](https://github.com/openmindculture/IngoSDev6CertPrep), [IngoSCostTransparency (`sw-IngoSCostTransparency`)](https://github.com/openmindculture/sw-IngoSCostTransparency) is a free and open-source extension for Shopware 6 that adds optional additional product details
as custom fields with responsive and accessible graphic percentage display on the product details.

TODO: add a more specific purpose / use case!
The extension adds a new tab on the product details page for data visualization of a product's cost factors, so we can show our customers where exactly their money goes to build trust and add facts to sustain our sustainability claims.

Colors default to theme colors but can be modified by overwriting custom CSS properties. Label captions can be configured in the extension configuration.
Colors default to theme colors but can be modified by overwriting custom CSS properties.
Label captions can be configured in the extension configuration.

There is a short [German description](./LIESMICH.md).
Short and long descriptions in German and English, and descriptive screenshots for the extension marketplace can be
previewed in [marketplace-descriptions-and-screenshots.html](./marketplace-descriptions-and-screenshots.html)

The content of the images/screenshots must be in English.

## Cost Transparency Display in the Storefront

The layout is responsive and accessible. Mobile content will be displayed off canvas like the built-in description and reviews tabs. Tablet and mobile views show column rows, while wide desktop screens show columns. Captions of small columns will be shortened. The full caption is available in a title tag. Simple HTML markup is possible in captions, like using bold tags or list items.

![screenshot collage](./product-cost-percentage-transparency.png)

## Configuration

Expand All @@ -21,12 +31,6 @@ Custom fields can be found an edited in the "Specifications" tab of each product

![screenshot](./product-fields-editor.png)

## Storefront Display

The layout is responsive and accessible. Mobile content will be displayed off canvas like the built-in description and reviews tabs. Tablet and mobile views show column rows, while wide desktop screens show columns. Captions of small columns will be shortened. The full caption is available in a title tag. Simple HTML markup is possible in captions, like using bold tags or list items.

![screenshot collage](./product-cost-percentage-transparency.png)

## Usage, Notes, and Caveats

In the basic plugin version, up to five different cost factors can be defined per product, using the labels defined in the extension settings. If any values are set, an additional data visualization tab will be shown on the product details page using a bar chart with percentage sizes. Please note: using multiple values below 10% might compromise readability. It is possible to use HTML in the description blocks for each cost factor.
Expand Down Expand Up @@ -56,9 +60,27 @@ The basic plugin version uses the following five percentage values per product:
- value: integer `product.customFields.ingos_cost_transparency_percentage_04`
- value: integer `product.customFields.ingos_cost_transparency_percentage_05`

## Customizing the extension in another extension/theme

Technically, the data is stored in custom product fields and global text snippets, so you can backup and modify this data in your own custom code.

You can also use custom CSS to override the default bar chart colors, shadows, and layout defined in `product-detail.scss`, e.g.

```css
:root {
--ingos-cost-transparency-color-01: #f5e04d;
--ingos-cost-transparency-color-02: #3b9df9;
--ingos-cost-transparency-color-03: #45b571;
--ingos-cost-transparency-color-04: #e44a74;
--ingos-cost-transparency-color-05: #eebd57;
}
```

![screenshot](./css-custom-properties.png)

## Compatibility and Contribution

### Initial Release 1.0, March 2024
### Initial Release 1.0, April 2024

The storefront has been tested with the lastest major browsers, including Chrome, Firefox, Edge, and Safari, on desktop and mobile devices. Chromium, Vivaldi and Opera have also been tested successfully. The basic functionality should, but is not guaranteed, to work in other browsers like Internet Explorer and older Safari versions. The plugin has been tested with and released for Shopware 6.6, and it is probably backwards compatible with Shopware 6.5 for which it had initially been developed.

Expand Down Expand Up @@ -171,4 +193,43 @@ Pragmatically, we could delete the `vendor` directory before creating the zip di

Now we created the file `custom/plugins/dist_tmp/IngoSCostTransparency.zip` which is visible as
`src/dist_tmp/IngoSCostTransparency.zip` outside the container and could be moved to `dist`:
- `sudo mv src/dist_tmp/* dist` to commit it in this development repository.
- `sudo mv src/dist_tmp/* dist` to commit it in this development repository.

### Official Testing Environment and Checklist

Specific validation rules are listed in the official plugin quality guidelines checklist:

https://developer.shopware.com/docs/resources/guidelines/testing/store/quality-guidelines-plugins/

To do after every update:
- validate the plugin against the checklist (manually)
- run all available validations, checks and audits (e.g. using `shopware-cli` which obsoletes the `FroshPluginUploader`)
- build an updated release file inside the development container (see above)
- stop the development container
- run the testing container (see below)
- upload and install the release file in the testing container
- repeat all manual test steps and ensure that the documentation matches the actual behavior
- uninstall, reinstall and re-test the plugin (twice, with or without "delete all data")

There is an official testing environment built with Docker, used by Shopware
for validating plugins. Their setup includes some of the typical gotchas like subdirectory paths and a nonstandard
storefront language (Dutch). It always uses the latest 6.x Shopware release.

- `docker run --rm -p 80:80 -e VIRTUAL_HOST=localhost ghcr.io/shopwarelabs/testenv:6.6.0`
- replace '6.6.0' with the latest tag found at https://github.com/shopwareLabs/testenv-platform/pkgs/container/testenv
- Access shop at http://localhost/shop/public
- Admin ("Beheer" in Dutch) at http://localhost/shop/public/admin#/login/
- Admin credentials:
- User: demo
- Password: demodemo

If we want to retain and claim backward compatibility, we must repeat the test with alternative versions,
e.g. by using Dockware Docker tags to rebuild our development environment.

#### Cross-Device / Mobile Testing

We can use a service like BrowserStack to verify functionality in different devices.

We can add an alternative host name, like `bs-local.com` in the storefront configuration.

![settings screenshot](storefront-testing-dutch-bs-local.png)
34 changes: 34 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "shopwarelabs/phpstan-shopware",
"type": "phpstan-extension",
"description": "Shopware extensions and rules for PHPStan",
"license": [
"MIT"
],
"authors": [
{
"name": "Soner Sayakci",
"email": "[email protected]",
"homepage": "https://shyim.de"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
}
},
"require": {
"php": "^7.2",
"ext-simplexml": "*",
"phpstan/phpstan": "^0.11"
},
"autoload": {
"psr-4": {
"Shopware\\PhpStan\\": "src/"
}
}
}
Binary file added css-custom-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/IngoSCostTransparency.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ingo's Kostentransparenz für Shopware 6
# Kostentransparenz für Shopware 6

Inspiriert durch Anforderungen potentieller Kund:innen und basierend auf [Ingo Steinkes](https://www.ingo-steinke.com/) [Shopware 6 Theme/Plugin Development Template](https://github.com/openmindculture/IngoSDev6CertPrep) ist [IngoSCostTransparency (`sw-IngoSCostTransparency`)](https://github.com/openmindculture/sw-IngoSCostTransparency) eine freie und quelloffene Erweiterung für Shopware 6, die zusätzliche optionale Produktdetail-Reiter ergänzt, in denen responsiv und barrierefrei eine grafische Datenvisualisation in Form eines prozentualen Balkendiagramms angezeigt wird.

Expand Down
26 changes: 26 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
parameters:
level: 0

bootstrapFiles:
- %currentWorkingDirectory%/vendor/autoload.php
paths:
- %currentWorkingDirectory%
excludePaths:
- %currentWorkingDirectory%/Components/Smarty
- %currentWorkingDirectory%/vendor
- %currentWorkingDirectory%/tests/
- %currentWorkingDirectory%/Test/
- %currentWorkingDirectory%/Resources/smarty
- %currentWorkingDirectory%/platform
- %currentWorkingDirectory%/autoload-dist/vendor/

ignoreErrors:
- '#apcu_#'
- '#ioncube_#'
- '#opcache_#'
- '#imagettftext#'
- '#class Redis#'
- '#Constant STARTTIME#'

reportUnmatchedIgnoredErrors: false
tipsOfTheDay: false
Loading

0 comments on commit 57c7336

Please sign in to comment.