# Programming (EN)

**URL:** https://forum.shopware.com/c/shopware-6-english/programming-en/43.md?page=4

[Aktuelle](https://forum.shopware.com/latest.md) · [Kategorien](https://forum.shopware.com/categories.md) · [Schlagwörter](https://forum.shopware.com/tags.md)

**Page:** 5

---

## [Importing the Shopware object](https://forum.shopware.com/t/importing-the-shopware-object/92305)

<div class="topic-metadata">

**Author:** [@prites.kum](https://forum.shopware.com/u/prites.kum)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [11. Januar 2022 um 02:44 UTC](https://forum.shopware.com/t/importing-the-shopware-object/92305 "2022-01-11T02:44:25Z")

</div>

To make our plugin compatible with 6.4.7.0, we changed the following as suggested in forums on this path - / src / Resources / app / administration / src / init import { Application } from ‚src/core/shopware‘ to const {…

---

## [Extending Shopware entity with foreign keys fails when merging version](https://forum.shopware.com/t/extending-shopware-entity-with-foreign-keys-fails-when-merging-version/92726)

<div class="topic-metadata">

**Author:** [@georgi.kolev](https://forum.shopware.com/u/georgi.kolev)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [3. Februar 2022 um 07:03 UTC](https://forum.shopware.com/t/extending-shopware-entity-with-foreign-keys-fails-when-merging-version/92726 "2022-02-03T07:03:54Z")

</div>

I’m developing my first Shopware 6 admin plugin, for which is required to extend one of the existing Shopware plugins - Custom products. I want to add a relation between already existing entities - TemplateExclusion and…

---

## [Admin API access](https://forum.shopware.com/t/admin-api-access/65882)

<div class="topic-metadata">

**Author:** [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Antworten:** 3\
**Zuletzt aktualisiert:** [21. Januar 2022 um 08:11 UTC](https://forum.shopware.com/t/admin-api-access/65882 "2022-01-21T08:11:45Z")

</div>

Admin Api access Create API key from Settings-\>system-\>integrations Get access token from http://localhost:8000/api/oauth/token POST request, body with following params { “client\_id”: “Access key …

---

## [Product visibility](https://forum.shopware.com/t/product-visibility/92398)

<div class="topic-metadata">

**Author:** [@beck1000](https://forum.shopware.com/u/beck1000)\
**Antworten:** 3\
**Zuletzt aktualisiert:** [20. Januar 2022 um 13:12 UTC](https://forum.shopware.com/t/product-visibility/92398 "2022-01-20T13:12:19Z")

</div>

Hello, I add a product by API. But it is not listed anywhere. Changing Visibility and adding Categories by hand and the product is accessible. How to add a sales channel to a product, not during creation, as an independ…

---

## [How to change default language in shopware6 from backend?](https://forum.shopware.com/t/how-to-change-default-language-in-shopware6-from-backend/64220)

<div class="topic-metadata">

**Author:** [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Antworten:** 11\
**Zuletzt aktualisiert:** [22. Dezember 2021 um 10:06 UTC](https://forum.shopware.com/t/how-to-change-default-language-in-shopware6-from-backend/64220 "2021-12-22T10:06:06Z")

</div>

How to change the default language in shopware6 from backend?

---

## [How to get internal path of media file in Twig](https://forum.shopware.com/t/how-to-get-internal-path-of-media-file-in-twig/88907)

<div class="topic-metadata">

**Author:** [@Arbinath](https://forum.shopware.com/u/Arbinath)\
**Antworten:** 2\
**Zuletzt aktualisiert:** [17. Dezember 2021 um 12:38 UTC](https://forum.shopware.com/t/how-to-get-internal-path-of-media-file-in-twig/88907 "2021-12-17T12:38:45Z")

</div>

Hello everyone, The goal I am trying to achieve is to change the colour of SVG category media files on mouse hover. Short introduction: All media files loaded with {% sw\_thumbnails ... %} are rendered in the twig temp…

---

## [How to redirect to home page from a subscriber file?](https://forum.shopware.com/t/how-to-redirect-to-home-page-from-a-subscriber-file/65104)

<div class="topic-metadata">

**Author:** [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Antworten:** 4\
**Zuletzt aktualisiert:** [17. Dezember 2021 um 11:13 UTC](https://forum.shopware.com/t/how-to-redirect-to-home-page-from-a-subscriber-file/65104 "2021-12-17T11:13:25Z")

</div>

Hi I am using the ProductEvents:: PRODUCT\_LOADED\_EVENT subscriber. I want to redirect to the home page in certain conditions. public static function getSubscribedEvents(): array { return \[ …

---

## [Where is the default services.xml located?](https://forum.shopware.com/t/where-is-the-default-services-xml-located/91904)

<div class="topic-metadata">

**Author:** [@FinnMac](https://forum.shopware.com/u/FinnMac)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [10. Dezember 2021 um 08:56 UTC](https://forum.shopware.com/t/where-is-the-default-services-xml-located/91904 "2021-12-10T08:56:31Z")

</div>

I have cloned the product-slider element, so that I can use a modified version for the homepage. The issue is the data resolver for the product-slider contains a constructor, with two arguments in it: ProductStreamBuil…

---

## [Logging in SW6 with APP\_ENV=production](https://forum.shopware.com/t/logging-in-sw6-with-app-env-production/91909)

<div class="topic-metadata">

**Author:** [@comwerft](https://forum.shopware.com/u/comwerft)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [10. Dezember 2021 um 08:53 UTC](https://forum.shopware.com/t/logging-in-sw6-with-app-env-production/91909 "2021-12-10T08:53:01Z")

</div>

I have question about logging in shopware/symfony. If I use APP\_ENV=production in .env, config-files from config/packages/production will be used like shopware.yaml, framework.yaml and so on. But with this scenario the…

---

## [config.xml how to use a sw-label component or other components](https://forum.shopware.com/t/config-xml-how-to-use-a-sw-label-component-or-other-components/67111)

<div class="topic-metadata">

**Author:** [@mvb](https://forum.shopware.com/u/mvb)\
**Antworten:** 2\
**Zuletzt aktualisiert:** [30. November 2021 um 07:58 UTC](https://forum.shopware.com/t/config-xml-how-to-use-a-sw-label-component-or-other-components/67111 "2021-11-30T07:58:42Z")

</div>

Hi, I want to use some components (https://component-library.shopware.com/components/sw-label/) in the backend. But I don’t know it this is possible if you don’t can’t set the value (or how to fill a slot). For exampl…

---

## [Thumbnail size changes after clicking on the image link](https://forum.shopware.com/t/thumbnail-size-changes-after-clicking-on-the-image-link/91597)

<div class="topic-metadata">

**Author:** [@FinnMac](https://forum.shopware.com/u/FinnMac)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [22. November 2021 um 15:38 UTC](https://forum.shopware.com/t/thumbnail-size-changes-after-clicking-on-the-image-link/91597 "2021-11-22T15:38:53Z")

</div>

So I am running into a strange issue In the cross-selling product sliders, all the thumbnails look fine. (Previously the thumbnails were spilling over onto the product information, and I corrected this by increasing the…

---

## [How to get plugin config variable inside custom-element twig file?](https://forum.shopware.com/t/how-to-get-plugin-config-variable-inside-custom-element-twig-file/91560)

<div class="topic-metadata">

**Author:** [@yurii.k](https://forum.shopware.com/u/yurii.k)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [19. November 2021 um 15:14 UTC](https://forum.shopware.com/t/how-to-get-plugin-config-variable-inside-custom-element-twig-file/91560 "2021-11-19T15:14:49Z")

</div>

Hi, guys! Have a question: When I set some config variable in my plugin I can get it in twig-template like this: {{ config('MY\_PLUGIN.config.MY\_VARIABLE') }} It works on storefront. But how can I get it on administr…

---

## [having single row per LineItem with quantity \> 1 in cart view](https://forum.shopware.com/t/having-single-row-per-lineitem-with-quantity-1-in-cart-view/68977)

<div class="topic-metadata">

**Author:** [@develissimo](https://forum.shopware.com/u/develissimo)\
**Antworten:** 6\
**Zuletzt aktualisiert:** [12. November 2021 um 08:34 UTC](https://forum.shopware.com/t/having-single-row-per-lineitem-with-quantity-1-in-cart-view/68977 "2021-11-12T08:34:44Z")

</div>

Hi folks, please advice best practice to achieve to have a single row per LineItem(s) in cart view if the quantity of LineItem is \> 1. Right now the cart is showing only one row per LineItem-\>id, which usually is good…

---

## [Sending Cart Information to the Header](https://forum.shopware.com/t/sending-cart-information-to-the-header/90584)

<div class="topic-metadata">

**Author:** [@FinnMac](https://forum.shopware.com/u/FinnMac)\
**Antworten:** 3\
**Zuletzt aktualisiert:** [26. Oktober 2021 um 08:55 UTC](https://forum.shopware.com/t/sending-cart-information-to-the-header/90584 "2021-10-26T08:55:26Z")

</div>

I am trying to implement a unit quantity notifier in the header, that displays the number of items currently in the cart. I have set up two successful services, one that sends data to the header when there is a HeaderPag…

---

## [Hey guys, Can you give me some ideas for Shopware 6 plugins?](https://forum.shopware.com/t/hey-guys-can-you-give-me-some-ideas-for-shopware-6-plugins/91037)

<div class="topic-metadata">

**Author:** [@vulturehmb99](https://forum.shopware.com/u/vulturehmb99)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [22. Oktober 2021 um 09:36 UTC](https://forum.shopware.com/t/hey-guys-can-you-give-me-some-ideas-for-shopware-6-plugins/91037 "2021-10-22T09:36:13Z")

</div>

Because i want to create some plugins in Shopware 6 but i don’t know which one so if you have any ideas then tell me .

---

## [How to create and save a new field in admin module in shopware 6?](https://forum.shopware.com/t/how-to-create-and-save-a-new-field-in-admin-module-in-shopware-6/72110)

<div class="topic-metadata">

**Author:** [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Antworten:** 6\
**Zuletzt aktualisiert:** [20. Oktober 2021 um 08:13 UTC](https://forum.shopware.com/t/how-to-create-and-save-a-new-field-in-admin-module-in-shopware-6/72110 "2021-10-20T08:13:23Z")

</div>

Hi I want to create and save a new field in product detail page in Shopware 6. I don’t want to use the custom fields. I want to create a new field in the products table and save the value from the admin product edit p…

---

## [Cannot inject "Client" in the Function signature of my Controller](https://forum.shopware.com/t/cannot-inject-client-in-the-function-signature-of-my-controller/90953)

<div class="topic-metadata">

**Author:** [@DannyDan](https://forum.shopware.com/u/DannyDan)\
**Antworten:** 10\
**Zuletzt aktualisiert:** [19. Oktober 2021 um 10:00 UTC](https://forum.shopware.com/t/cannot-inject-client-in-the-function-signature-of-my-controller/90953 "2021-10-19T10:00:31Z")

</div>

Good morning everybody. I am trying to get a module inside my app up and running, but when I inject „Client“ in the controller function signature, I get the error: Cannot autowire argument $client. An action button is …

---

## [Adding a custom CMS block](https://forum.shopware.com/t/adding-a-custom-cms-block/62193)

<div class="topic-metadata">

**Author:** [@Yafar\_iSi](https://forum.shopware.com/u/Yafar_iSi)\
**Antworten:** 7\
**Zuletzt aktualisiert:** [19. Oktober 2021 um 03:16 UTC](https://forum.shopware.com/t/adding-a-custom-cms-block/62193 "2021-10-19T03:16:18Z")

</div>

Hi I am trying to make my own CMS block to be able to add dynamic content from the backend with the Shopping Experiences editor I have followed all the instructions and I can’t make the editor show my block https://d…

---

## [Uncaught TypeError: Cannot read property 'classList' of null in shopware 6](https://forum.shopware.com/t/uncaught-typeerror-cannot-read-property-classlist-of-null-in-shopware-6/90429)

<div class="topic-metadata">

**Author:** [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Antworten:** 2\
**Zuletzt aktualisiert:** [21. September 2021 um 07:18 UTC](https://forum.shopware.com/t/uncaught-typeerror-cannot-read-property-classlist-of-null-in-shopware-6/90429 "2021-09-21T07:18:56Z")

</div>

Hi I have a Shopware 6 shop https://test.implify.de/I have created another sales channel https://ch.implify.de/My problem is the submenus are not showing on hover the main menu in the new sales channel https://ch.implif…

---

## [Shopware6 - How to attach extra info to order line item?](https://forum.shopware.com/t/shopware6-how-to-attach-extra-info-to-order-line-item/64770)

<div class="topic-metadata">

**Author:** [@michal\_bnet](https://forum.shopware.com/u/michal_bnet)\
**Antworten:** 4\
**Zuletzt aktualisiert:** [26. August 2021 um 13:30 UTC](https://forum.shopware.com/t/shopware6-how-to-attach-extra-info-to-order-line-item/64770 "2021-08-26T13:30:12Z")

</div>

Hi In Shopware6 i want to attach or display some extra info to order line item in admin. i am already storing this information in payload in database, but not sure how to display it. i tried to override sw-order-line-…

---

## [How can i make changes in the Admin Core functions (deactivate net price)?](https://forum.shopware.com/t/how-can-i-make-changes-in-the-admin-core-functions-deactivate-net-price/90105)

<div class="topic-metadata">

**Author:** [@tarkanbasar](https://forum.shopware.com/u/tarkanbasar)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [8. September 2021 um 07:30 UTC](https://forum.shopware.com/t/how-can-i-make-changes-in-the-admin-core-functions-deactivate-net-price/90105 "2021-09-08T07:30:41Z")

</div>

I’m searching for a solution to the deactivate the net price , which is a backend core function, through a module/plugin, to ensure the system is updateable in the future. I’ve tried following solutions with no success: …

---

## [Add Product images through Admin API](https://forum.shopware.com/t/add-product-images-through-admin-api/64359)

<div class="topic-metadata">

**Author:** [@WBKNL](https://forum.shopware.com/u/WBKNL)\
**Antworten:** 7\
**Zuletzt aktualisiert:** [2. September 2021 um 16:57 UTC](https://forum.shopware.com/t/add-product-images-through-admin-api/64359 "2021-09-02T16:57:37Z")

</div>

I’m adding products through the Admin API but I can’t find anything on how to add product images. Can anybody explain to me how I can add product images through the api?

---

## [Using voucher codes](https://forum.shopware.com/t/using-voucher-codes/90051)

<div class="topic-metadata">

**Author:** [@Holemans\_Kurt](https://forum.shopware.com/u/Holemans_Kurt)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [31. August 2021 um 13:15 UTC](https://forum.shopware.com/t/using-voucher-codes/90051 "2021-08-31T13:15:48Z")

</div>

Hello, i created 24 individual voucher codes for 50€ when buying for 100€ we will give those to 12 people. but i can get two codes working in one order is i buy for 200€. does anybody know how i can make this happen

---

## [DemoDataController - "DemoDataController does not exist in"](https://forum.shopware.com/t/demodatacontroller-demodatacontroller-does-not-exist-in/67042)

<div class="topic-metadata">

**Author:** [@alphabetus](https://forum.shopware.com/u/alphabetus)\
**Antworten:** 4\
**Zuletzt aktualisiert:** [11. August 2021 um 07:56 UTC](https://forum.shopware.com/t/demodatacontroller-demodatacontroller-does-not-exist-in/67042 "2021-08-11T07:56:44Z")

</div>

Hello. I was following the video: https://academy.shopware.com/courses/take/shopware-6-developer-training-english/lessons/9225170-data-storefront When I try to access the website the following error appears: " {„err…

---

## [Can't add administration module](https://forum.shopware.com/t/cant-add-administration-module/89564)

<div class="topic-metadata">

**Author:** [@diarcoda](https://forum.shopware.com/u/diarcoda)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [5. August 2021 um 19:17 UTC](https://forum.shopware.com/t/cant-add-administration-module/89564 "2021-08-05T19:17:55Z")

</div>

I’m using Shopware 6.4.3.0, and I’m trying to add a new custom module on navigation menu, I had read the documentation and had added the code like on documentation but still it doesn’t appear on sidebar of administration…

---

## [Shopware 6 and counting of VAT](https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720)

<div class="topic-metadata">

**Author:** [@DouglasMurrel](https://forum.shopware.com/u/DouglasMurrel)\
**Antworten:** 3\
**Zuletzt aktualisiert:** [12. Februar 2021 um 10:00 UTC](https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720 "2021-02-12T10:00:52Z")

</div>

Hello, Can anyone explain how Shopware counts VAT in total price for Cart? I have a cart with one product that costs 1.309 euro. Tax rate is 19%, so tax value is 0.24871. This I can understand: 1.309/100\*19=0,24871. B…

---

## [Override OrderLineItem label after a customer ordered](https://forum.shopware.com/t/override-orderlineitem-label-after-a-customer-ordered/89146)

<div class="topic-metadata">

**Author:** [@rafu](https://forum.shopware.com/u/rafu)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [14. Juli 2021 um 12:09 UTC](https://forum.shopware.com/t/override-orderlineitem-label-after-a-customer-ordered/89146 "2021-07-14T12:09:14Z")

</div>

Hi there, I’m trying to override the label or description of an order line item, after a customer placed an order. To do so, I tried to listen to the order.written-event. The event handling looks like this (simplified)…

---

## [How can we show in admin line items with parentId somehow in relation with parent products?](https://forum.shopware.com/t/how-can-we-show-in-admin-line-items-with-parentid-somehow-in-relation-with-parent-products/66677)

<div class="topic-metadata">

**Author:** [@SorinSologics2019](https://forum.shopware.com/u/SorinSologics2019)\
**Antworten:** 4\
**Zuletzt aktualisiert:** [6. Juli 2021 um 04:33 UTC](https://forum.shopware.com/t/how-can-we-show-in-admin-line-items-with-parentid-somehow-in-relation-with-parent-products/66677 "2021-07-06T04:33:16Z")

</div>

Hello everybody! We’ve implemented a plugin that allows you to add same product to basket and add children(as individual products) to those ‚main‘ products. Everything looks ok in storefront, in order\_line\_item children…

---

## [Custom plugin configuration field](https://forum.shopware.com/t/custom-plugin-configuration-field/88617)

<div class="topic-metadata">

**Author:** [@rimvydas](https://forum.shopware.com/u/rimvydas)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [25. Juni 2021 um 13:45 UTC](https://forum.shopware.com/t/custom-plugin-configuration-field/88617 "2021-06-25T13:45:22Z")

</div>

Hello, How exactly do you create custom fields? What Im trying to do is get all the shopware payment methods, loop them and for every payment method id a text field would be able to map some value to the payment method …

---

## [Images not displaying in storefront](https://forum.shopware.com/t/images-not-displaying-in-storefront/88554)

<div class="topic-metadata">

**Author:** [@hasan.h](https://forum.shopware.com/u/hasan.h)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [23. Juni 2021 um 12:11 UTC](https://forum.shopware.com/t/images-not-displaying-in-storefront/88554 "2021-06-23T12:11:27Z")

</div>

I have created a plugin that displays images from a folder in the storefront in the footer. I used the following tutorial for guidance: However, my storefront is not showing those images. In my task, I created a rando…

[Vorherige Seite](https://forum.shopware.com/c/shopware-6-english/programming-en/43.md?page=3)

[Nächste Seite](https://forum.shopware.com/c/shopware-6-english/programming-en/43.md?page=5)
