Logo BrocksiNet

BrocksiNet

Try to clean the web

Shopware 6

18.09.2024
shopware-6
Does and Don'ts for Shopware API aware
This is a collection of insights and things we've seen during plugin reviews, app reviews and projects for Shopware 6. We hope this is helpful for anyone who wants to make their app, plugin or project headless-ready and API aware. Many thanks to the awesome Maciek Kucmus who did all the hard work to put this together. I only revised and extended some parts. Also feel free to comment or ping me if we forgot something or you want to add more important points to this checklist. Content Why should y
18.04.2024
shopware-6
javascript
Shopware Variant Selection (headless)
It feels wrong if you know ecommerce systems and then use Shopware's variants for the first time. You click on a variant, and the entire storefront page is reloaded. This is very helpful (and good for SEO) if your variants differ in text and images. But it isn't delightful if the server is not very fast. Also, if you have many similar options in text and pictures. There is also the use case where you want to show all possible options on the product listing page (category). So you may ask yoursel
24.01.2024
shopware-6
javascript
A space ship blueprint representing the Open API Schema
Why? With Composable Frontends, you can create your own JavaScript/Typescript based API Client from your local or online running Shopware 6 Instance. This brings you the advantage that all Custom Endpoints are also included in the API Client if they have a proper OpenAPI Schema definition. In this post, I describe how and what steps are needed to do so. There will also be another blog post about how to extend the paths and operations manually. Requirements A running Shopware 6 Instance (local or
15.01.2024
shopware-6
php
Futuristic computer represent a local devenv set up in Shopware 6
This blog post is mainly a reference for myself. So that I don't always have to search for commands and places where I need to change something. Basically it shows the steps to set up a new instance with devenv and Shopware 6. It also shows how to enable xdebug if needed. And how to use an SSL certificate and what needs to be changed. I assume that devenv, direnv and cachix are already set up (if not, take a look at this devenv guide). Steps for set up a new Shopware 6 instance Tested with deven
24.11.2023
Scaling Commerce with Shopware Composable Frontends?
Yesterday I attended the Kellerkinder BarCamp 2023 in Mannheim. There was a discussion about a project with 15 sales channels, 150,000 products, even more variants, and many different domains/languages. A pick-up functionality was also involved. The main question, in that discussion, was always It's never a good id
26.07.2023
javascriptphp
shopware-6
Shopware 6 OpenAPI UserInterface
How would we work without an API? If you were debugging something right now, you would surely say "much better" 😉 But let's face it, without an API, the modern e-commerce world wouldn't work at all. And what do we do to make sure our API works the way we expect it to? How do we test our API? How do we validate our schema? When you first start out as a developer, you might not think about this, you might just be happy that your API works. Later, when other people want to use your API, you ne
03.05.2023
javascript
shopware-6
Using server routes in nuxt with nitro for data fetching, manipulation, aggregation and reducing json. Possibility to add caching. Simple composables.
The question is always where to fix a problem. For example, if data is missing from an API, you could fix that with a second request or change the response of the first request. So in a headless setup, you always want to have the minimum amount of data you need, but things will always change and you need more data or data in a different structured form. So you might find yourself talking to backend developers to optimize the API, or moving logic to the frontend that doesn't actually have anythin
16.03.2023
shopware-6
javascript
Weather Component Example inside Shopware Frontends
You already heard about the new Shopware Frontends? It uses the headless approach known from 😇 the administration area of Shopware. In general Shopware provides an admin API, the sync API and the store API. So basically the store API is for every action that a website visitor can do in your store. But to be honest Shopware Frontends is not a out-of-the-box solution. You need developers that can put every headless thing together for you. In this blog post I want to show how easy you can ad
23.11.2022
php
shopware-6
Sometimes it is maybe useful to get the defaultTaxRate that is defined via Admin in Shopware 6. For this we have this small php function below to get the UUID from the SystemConfig and then search with the tax.repository to get the curent value. The system path to get the default UUID is core.tax.defaultTaxRate. Here is the PHP-Snippet for you ?float { $defaultTaxRateUuid = $this->systemConfig->get('core.tax.defaultTaxRate');
07.11.2022
shopware-6
Cover Image: CustomFields, Properties and Entity Extensions for Shopware 6
When you start working with Shopware 6 it can be hard to know what to use for what. So this guide will explain you the different aspects of CustomFields, Properties and Entity Extensions in Shopware 6. Disclaimer: This definition is maybe not correct in all parts, it is more less a guide to give you a feeling what to use when. Because you can solve same tasks in very different ways and maybe both will work. So feel free to comment when you think something should be changed or written in another
06.10.2022
shopware-6
PHPStan and Shopware 6 with CaptainHook as pre-commit hook
You working on a customer project and you want to make sure that you write code like a Shopware 6 core developer? Then you need all the shiny linters that the core developers are using. This guide will explain how to setup PHPStan and easy-coding-standard as a pre-commit hook with CaptainHook in a docker container setup. That's it, enjoy. 🤯 Requirement: Shopware 6 project running with docker containers. Warning: This are just local checks, you should also setup for example github
05.08.2022
shopware-6
Symfony Profiler formatted and runnable SQL-Query
There are always situations where you need to get the raw SQL query. Maybe to understand what is going on, to debug a problem on a production system or just for playing around in your favorit MySQL client to adjust the query. So let's see what kind of options you have to get the SQL query in Shopware 6. What should I use to debug the SQL in Shopware 6? Using the Symfony Profiler to debug SQL Using the FrosthDevelopmentHelper to debug SQL Using the Dbal/EntitySearcher to debug SQL Using the Symfo
30.06.2022
shopware-6
Custom field to select CMS layout on product level
The Content Management System in Shopware 6 is called Shopping Experiences. But in this post I will always talk from Content Management when I mean the Shopping Experiences, just to clarify. I will explain how you can use the Content Management to build custom product pages with Shopware 6. The idea is to connect your product (or other entities) with any CMS page and render the content from you CMS page into the DOM. At many page types and places you can add content via the administration (layou
22.03.2022
shopware-6
Screen with a lot of process.env's from vendor/shopware/administration/Resources/app/administration/webpack.config.js
With environement variabeles you can do a lot in Shopware 6. Especially when you use some build process to deploy your projects or test your plugins. So in this little post I will collect some of the important environment variables I found in Shopware 6. Maybe this will help you to find solutions for common problems. If I miss some variable that might be helpful pls leave a comment so I will update this post. Content - Environment variables in Shopware 6 Project Root App URL Mode Shopware Admin
25.01.2022
shopware-6
Shopware 6 config to disable options without results in filter navigation (category page)
In a default shopware 6 you will have filters for properties and you will have filters for manufacturer, rating, price and free shipping. But you will not have a filter for is in stock. But shopware has a nice documentation about how to add easily a listing filter. In this post I will tell you about the learnings and the troubles I had during adding this filter to the category listing. How filters work? And Troubles I had. You can scroll down to the implementation when you think you will not hav
10.01.2022
shopware-6
Required field for Shopware 6 Customer Profile Import/Export CSV
At some point in every project you need some customer data. And often it is the case that you need to import the customer data from some old source for example from WooCommerce. In this case you can use the csv import/export feature from Shopware 6 core. So this post is a small how to import/export customer data and create a profile for your needs in Shopware 6 admin. What we will do? Create a customer via administration Create a customer profile with data mapping Export existing customers via a
16.11.2021
shopware-6
Looks easy? 😉 But did you checked in detail the differences or you just use always the product.repository? Let's deep dive into the core files to fully understand the differences so you can decide what to use when. 💙 First of all there is a file called: EntityRepositoryInterface.php where you can see what kind of methodes you can use like search, update, merge and many more. You need to know that Shopware 6 uses Data Abstraction Layer (DAL) and generates for every entity the corr
08.11.2021
shopware-6
With the fresh new shopware 6 version 6.4.6.0 there is a new much awaited (!) feature the flow builder. In this blog post we will check the shopware 6 core how easy or hard it is to create own actions for the flow builder. To have an general idea what the flow builder can do for you, you should at least read the flow builder documention on shopware 6 docs. In short words: You can create custom (business) processes without coding. You can create this custom process via admin by defining triggers