findologic/plugin-shopware-6

Findologic plugin for Shopware 6

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 6

Forks: 2

Open Issues: 6

Type:shopware-platform-plugin

6.0.2 2024-11-05 15:29 UTC

README

Build Status

Official Findologic plugin for Shopware 6.

Installation

Production

Please see our Shopware 6 documentation.

Development

  1. Install the shopware-cli

  2. Set up the test shop

  3. Install dependencies for tests

    1. composer require --dev symfony/test-pack
  4. Configure test database within the .env.test file (Create file if not present)

    • If you want to use a docker database, run docker-compose up -d
  5. Navigate to the plugins folder

    cd custom/plugins
  6. Clone this repository

    git clone git@github.com:findologic/plugin-shopware-6.git
  7. Install dependencies

    cd plugin-shopware-6 && composer install
  8. Navigate back to the shop root

    cd ../../..
  9. Refresh plugin list

    bin/console plugin:refresh --env="test"
  10. Install and activate the plugin

bin/console plugin:install FinSearch --activate --clearCache --env="test"

Run linting

CLI linting

The Makefile includes commands for all relevant tasks:

  • make storefront-lint
  • make administration-lint
  • make storefront-fix
  • make administration-fix

PHPStorm linting

There are different configurations for administration and storefront. Depending on the current project, use the corresponding configuration.

Storefront

PHPStorm configuration storefront

Administration

PHPStorm configuration administration

Run PHPUnit tests

Prerequisites

  • MySQL >= 8.0
  • PHP >= 8.1

Setup

  1. Create a database user app with the password app, which should have permissions to create, update and delete all databases.
  2. In the development templates root, initialize the test setup (run locally, outside the app container)
    ./psh.phar init
  3. Navigate to the plugin and run tests
    cd custom/plugins/plugin-shopware-6 && composer test

Tests can also be run separately within the IDE. Simply ensure to set phpunit.xml.dist as configuration file.

PHPUnit configuration

Run Storefront Jest tests

Prerequisites

Setup

  1. Navigate to the storefront folder
    cd src/Resources/app/storefront
  2. Install dependencies
    npm install
  3. Run unit-tests using jest
    npm run test

After dependency installation all tests can also be run via the IDE without any additional configuration.

Running Jest test in IDE

Developing custom JavaScript plugins

  • Check out the offical guide on how to extend js storefront plugin.
  • Create your plugin files inside src/Resources/app/storefront/src/js/[your-plugin-name].plugin.js
  • Register your extended plugin
  • For a development build: ./psh.phar storefront:dev
  • For a production build: ./psh.phar storefront:build

Please note:

  • The build commands will create a minified JS file in src/Resources/app/storefront/dist/storefront/js/[plugin-name].js.
  • Before committing ensure that all files were built and added to your commit.
  • Make sure to also commit the minified JavaScript files.

Libraries

We are using some of our libraries that are especially relevant for this and other plugins. Note that these libraries already come with the plugin itself, so you do not need to install them yourself.

  • findologic/libflexport Helps generating the shop's data feed aka. export. We use it to generate an XML based on the product data of the shop.
  • findologic/shopware6-common Includes the basic logic for the export.
  • findologic/findologic-api Handles requests to FINDOLOGIC. This includes everything from sending query parameters like selected filters, output attributes, to parsing the response with response objects.

Export customization

In some cases you may want to export additional, custom export data. To still provide you plugin updates, we have an extension plugin. It overrides logic of the base plugin to reflect your own logic.

Use the FINDOLOGIC Shopware 6 extension plugin to customize your export. There are already pre-defined examples, that guide you on how you can customize certain entities, like attributes or properties.

Deployment and Release

  1. Update the changelogs CHANGELOG_en-GB.md and CHANGELOG_de-DE.md.
  2. Ensure that all changes, including the changelog changes have been merged into the develop branch.
  3. Switch to the develop branch locally and pull the most recent changes.
    git checkout develop
    git pull
  4. Start the release process and follow the instructions.
    composer release
  5. Ensure that the GitHub Actions release is successful.
  6. Upload it to Google Drive, by downloading the built zip file from the Releases page. Upload it to the folder Development/Plugins/Shopware/Shopware 6 DI & API Plugin and move the old version to alte Versionen.
  7. Notify everyone in the #releases Slack channel.