The fixture plugin is really helpful if you want to create some static demo data for your shopware instance.

Overview

Fixture Plugin

The fixture plugin is really helpful if you want to create some static demo data for your shopware instance.

Installation

Just add it to your project via composer: "composer require basecom/sw6-fixtures-plugin" (or add entry in psh dependency).

Create Fixtures

  1. Create a new file in the specific folder of your project for the fixtures.
  2. Extend this file from abstract class "Fixture" in the library.
  3. Implement the "load()" method with fixture logic
  4. Optional: Add a priority or dependency of other Fixture classes via the corresponding "dependsOn()" or "priority()" method.
  5. If you want to run specific fixtures as a group later, implement the "groups()" method from the abstact class and return an array of strings as group names.

Run the fixtures

  • To run a single fixture, use the command "**bin/console fixture:load:single " with Fixture name as parameter.
    • E.g. fixture class is named "DummyFixture.php", run **bin/console fixture:load:single dummyFixture (it´s case-insensitive).
  • To run a group of fixture, run "bin/console fixture:load:group " with group name as parameter (specified via groups() method). It´s also case-insensitive.
  • To run all fixtures, run "bin/console fixture:load".

Start developing

This template uses a full-featured Dockware docker image. It already comes with a pre-installed Shopware 6 instance and everything you need to start developing.

Please see the Dockware documentation.

To start developing, simply start the container:

> docker compose up -d

Access the container:

> make shell

Install the dependencies and make everything ready (defined in composer.json and package.json). This command needs to be executed from the host-system (not in shell)

> make install

Linting

Before committing, please run the linting and static analysis tools. This command also needs to be executed from the host machine (not in shell):

> make lint

GitLab pipeline

The GitLab pipeline is already pre-configured. It contains multiple jobs for all linting, static analysis and testing tools.

The pipeline runs all tests for the latest stable Shopware 6 version. But you have several options for the PHPUnit tests:

Comments
  • NTR: Add Media Upload Helper

    NTR: Add Media Upload Helper

    proposal pull request, please check if you like it

    building a media upload helper to automatically insert local assets from the fixture folder as cover images or other media

    $this->helper->Media()->upload(
        self::MEDIA_ID,
        $this->helper->getMediaDefaultFolderId('product'),
         __DIR__ . '/Assets/voucher-product.png',
        'png',
        'image/png',
    );
    
    Screen Shot 2022-07-27 at 23 48 02
    opened by boxblinkracer 3
  • NTR: Add getCategoryIdByName in Helper class

    NTR: Add getCategoryIdByName in Helper class

    With the Shopware Demo data I wasn't able to easily display a product in the storefront, because the provided helper functions lead to root-level categories that where somehow not displayed.

    I've created a getCategoryByName which turned out to work and is easy to use. Would be cool if that could be added.

    $id = $this->helper->getCategoryIdByName('Clothing');

    opened by boxblinkracer 2
  • SUGGESTION – Swap license to MIT

    SUGGESTION – Swap license to MIT

    I personally like the MIT license for open source packages less restricting and often times used (Dockware for example is also MIT licensed).

    What do you guys think? I'm fine with keeping the Apache license, but I thought I will make the suggestion, because I would like MIT better 😅

    @jdambacher If you don't want to change the license, feel free to close this MR.

    Thanks

    opened by jkniest 0
  • NTR: improve README with instructions and best practices

    NTR: improve README with instructions and best practices

    review notes

    I've added some visual concepts to the readme, like code snippets and paragraphs

    also, i figured out some kind of best practice for plugin development. used it in a plugin of mine. could you verify it? the benefit is to avoid fixtures from being accidentally loaded when the plugin only has production dependencies :)

    opened by boxblinkracer 0
  • Run Fixtures from Admin

    Run Fixtures from Admin

    I'm currently playing around with an option to reset my QA server while testing. So I'm building a plugin to prepare my environment, based on the fixtures plugin.

    With that process, I thought it's actually quite interesting to login to the administration and just run the fixtures to reset my data to the expected one.

    might be nice for testers :)

    opened by boxblinkracer 0
Releases(2.1.0)
  • 2.1.0(Nov 8, 2022)

    Added

    • Added the option --with-dependencies / -w to the fixture:run:single command
      • This command recursively runs all fixtures that are required by the given fixture
    • Added new method to the fixture trait: runSingleFixtureWithDependencies()
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Aug 4, 2022)

    Added

    • Added new helper method Category()->getByName()
    • Added new helper method Media()->upload()
    • Added examples in the repository. See the _examples folder

    Changed

    • The helper methods in the FixtureHelper service are now split into multiple smaller units
      • Media now holds all media-related helpers
      • Category now holds all category-related helpers
      • SalesChannel now holds all sales-channel-related helpers
      • Customer now holds all customer-related helpers
      • Cms now holds all CMS-page-related helpers
      • PaymentMethod now holds all payment-method-related helpers
      • ShippingMethod now holds all shipping-method-related helpers
    • This is the first licensed version. See LICENSE file

    Full Changelog: https://github.com/basecom/FixturesPlugin/compare/1.8.0...2.0.0

    Source code(tar.gz)
    Source code(zip)
Owner
basecom
basecom is an IT service provider with focus on planning, implementing and supporting complex software solutions based on open source technology.
basecom
🌏 Webnux 🌏 , a videos streaming website where you can watch what you want when you want.

?? WEBNUX ?? Welcome to ?? Webnux ?? , a videos streaming website where you can watch what you want when you want. ☀️ ☀️ OBJECTIFS ☀️ ☀️ - A sessi

FrancisNtahimpera 1 Dec 3, 2021
Just the stats I want, maybe you want them too

SKCDEV Easy Digital Downloads Stats This plugin adds a new "SKCDEV EDD Stats" report tab to the EDD Reports tabs. Just the stats I want, maybe you wan

Scott Kingsley Clark 3 Sep 8, 2022
Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance

Silverstripe Sendy Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance. Introduction

Syntro Opensource 4 Apr 20, 2022
Do you want CronJob to follow the solar date?You need this package to solve this problem.

Shamsic Maybe it happened to you that you wanted to use CronJob in your project and you realized that you cannot manage the exact dates that are in th

Amin Ghaninia 5 Jul 19, 2022
A helpful Laravel package to help me get started in Laravel projects quicker.

Launchpad A helpful Laravel package to help me get started in Laravel projects quicker. This is still a work in progress, so use at your own risk! CLI

Steve McDougall 13 Jun 15, 2023
A webshell plugin and interactive shell for pentesting a Moodle instance.

Moodle webshell plugin for RCE A webshell plugin and interactive shell for pentesting a Moodle instance. Features Webshell plugin for Moodle. Execute

Podalirius 11 Oct 10, 2022
Greyhole uses Samba to create a storage pool of all your available hard drives, and allows you to create redundant copies of the files you store.

Greyhole Greyhole is an application that uses Samba to create a storage pool of all your available hard drives (whatever their size, however they're c

Guillaume Boudreau 245 Dec 18, 2022
Composer registry manager that help to easily switch to the composer repository you want

CRM - Composer Registry Manager Composer Registry Manager can help you easily and quickly switch between different composer repositories. 简体中文 Install

Tao 500 Dec 29, 2022
PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.

?? Yell PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects. Requirement

Zeeshan Ahmad 20 Dec 8, 2018
Nextcloud AIO stands for Nextcloud All In One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Nextcloud All In One Beta This is beta software and not production ready. But feel free to use it at your own risk! We expect there to be rough edges

Nextcloud 1.1k Jan 4, 2023
Spin up a working Statamic instance quickly & easily with Docker

Spin Up Statamic Allows you to create your own self-contained Statamic project complete site config, Antlers/Blade/Twig template files, assets, and de

nystudio107 11 Jun 2, 2023
Create eye-catching Open Graph images for each (or some) site pages

Open Graph Image Generator for Laravel Create Open Graph images (og:image, twitter:image, vk:image) for each (or some) site pages. Use page title to c

Pavel Bychko 4 Nov 11, 2022
Melek Berita Backend is a service for crawling data from various websites and processing the data to be used for news data needs.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Chacha Nurholis 2 Oct 9, 2022
Cheatsheet for some Php knowledge you will frequently encounter in modern projects.

Cheatsheet for some Php knowledge you will frequently encounter in modern projects.

Arnaud Becher 1.1k Jan 2, 2023
This demo app shows you how to run a simple PHP application on AWS Elastic Beanstalk.

Elastic Beanstalk + PHP Demo App - "Share Your Thoughts" This demo app shows you how to run a simple PHP application on AWS Elastic Beanstalk. Run the

AWS Samples 143 Nov 26, 2022
Ratio plugin is a luck plugin. The more lucky you are, the more you win!

Ratio Ratio plugin is a luck plugin. The more lucky you are, the more you win Features When you break a block (Cobblestone), it gives/puts you somethi

Ali Tura Çetin 2 Apr 25, 2022