# Programming (EN)

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

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

**Page:** 8

---

## [Events and there purpose](https://forum.shopware.com/t/events-and-there-purpose/70354)

<div class="topic-metadata">

**Author:** [@Fboensch](https://forum.shopware.com/u/Fboensch)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [21. Oktober 2020 um 12:52 UTC](https://forum.shopware.com/t/events-and-there-purpose/70354 "2020-10-21T12:52:05Z")

</div>

Hello there, I’m tring to use some Events and I don’t know, if i understand Events correctly. In my opinion a Subscriber for an Event should be a way to change something. Some Examples: DataMappingEvent with ‘Customer…

---

## [Add some data to Session](https://forum.shopware.com/t/add-some-data-to-session/70331)

<div class="topic-metadata">

**Author:** [@DINUZEW](https://forum.shopware.com/u/DINUZEW)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [20. Oktober 2020 um 21:20 UTC](https://forum.shopware.com/t/add-some-data-to-session/70331 "2020-10-20T21:20:02Z")

</div>

Hi, how can i add some data to my Shopware session? Thanks!

---

## [Import Media via API](https://forum.shopware.com/t/import-media-via-api/70202)

<div class="topic-metadata">

**Author:** [@DINUZEW](https://forum.shopware.com/u/DINUZEW)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [15. Oktober 2020 um 13:38 UTC](https://forum.shopware.com/t/import-media-via-api/70202 "2020-10-15T13:38:33Z")

</div>

Hi, i develop an Shopware website and I need to know how to import Media products via API. I want to import some media content and assign to my products. Any help? Please and have a good day!

---

## [Get MediaID  by Filename  from API Shopware 6](https://forum.shopware.com/t/get-mediaid-by-filename-from-api-shopware-6/70234)

<div class="topic-metadata">

**Author:** [@DINUZEW](https://forum.shopware.com/u/DINUZEW)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [15. Oktober 2020 um 13:24 UTC](https://forum.shopware.com/t/get-mediaid-by-filename-from-api-shopware-6/70234 "2020-10-15T13:24:00Z")

</div>

Hi, I want to get MediaId of a file with name knowed by me. I want to call a route from Shopware API to return me MediaID of a Media by FileName. Thanks!

---

## [How can I set the Sales Channel on a Product through the API](https://forum.shopware.com/t/how-can-i-set-the-sales-channel-on-a-product-through-the-api/64213)

<div class="topic-metadata">

**Author:** [@WBKNL](https://forum.shopware.com/u/WBKNL)\
**Antworten:** 3\
**Zuletzt aktualisiert:** [13. Oktober 2020 um 19:28 UTC](https://forum.shopware.com/t/how-can-i-set-the-sales-channel-on-a-product-through-the-api/64213 "2020-10-13T19:28:56Z")

</div>

I’ve added all my products through the API. I can set the categories and manufacturers just fine but I can’t seem to find out how to set the Sales Channel and without that, my products don’t show up. Neither the document…

---

## [How to subscribe to predispatch of registration in Shopware 6 just like shopware 5?](https://forum.shopware.com/t/how-to-subscribe-to-predispatch-of-registration-in-shopware-6-just-like-shopware-5/70101)

<div class="topic-metadata">

**Author:** [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [8. Oktober 2020 um 07:33 UTC](https://forum.shopware.com/t/how-to-subscribe-to-predispatch-of-registration-in-shopware-6-just-like-shopware-5/70101 "2020-10-08T07:33:57Z")

</div>

I want to call a function right before the registration process starts in order to check some values from the registration form. In Shopware 5 I would use a predispatch event for that. How to do that in Shopware 6?

---

## [How can we set Shopware 6 to work with RabbitMQ?](https://forum.shopware.com/t/how-can-we-set-shopware-6-to-work-with-rabbitmq/70051)

<div class="topic-metadata">

**Author:** [@SorinSologics2019](https://forum.shopware.com/u/SorinSologics2019)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [7. Oktober 2020 um 08:29 UTC](https://forum.shopware.com/t/how-can-we-set-shopware-6-to-work-with-rabbitmq/70051 "2020-10-07T08:29:38Z")

</div>

Hello all. Does anyone knows how to set RabbitMQ to work togheter with Shopware 6 instead of default transport messaging? As starting point I had a look on vendor/shopware/core/Framework/Resources/config/packages/enqueue…

---

## [How to add additional form-type to be able to create more than 2 different forms on a site](https://forum.shopware.com/t/how-to-add-additional-form-type-to-be-able-to-create-more-than-2-different-forms-on-a-site/69761)

<div class="topic-metadata">

**Author:** [@Anton\_Esin](https://forum.shopware.com/u/Anton_Esin)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [22. September 2020 um 10:14 UTC](https://forum.shopware.com/t/how-to-add-additional-form-type-to-be-able-to-create-more-than-2-different-forms-on-a-site/69761 "2020-09-22T10:14:33Z")

</div>

I know how to override existing template of the 2 form types (contact-form and newsletter-form) that are built into Shopware 6.3, unfortunately I need more than 2 different forms on the website. So I would like to regits…

---

## [Api version Changelog](https://forum.shopware.com/t/api-version-changelog/69669)

<div class="topic-metadata">

**Author:** [@Pjager](https://forum.shopware.com/u/Pjager)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [17. September 2020 um 10:50 UTC](https://forum.shopware.com/t/api-version-changelog/69669 "2020-09-17T10:50:59Z")

</div>

Hi all, I searched for a page about the api versions. We build our code based on the v1 version of the api, and noticed that it did not work for certain customer as v1 is deprecated. We were curious what the changes t…

---

## [How to call ALL Product\_Properties](https://forum.shopware.com/t/how-to-call-all-product-properties/69522)

<div class="topic-metadata">

**Author:** [@Chnuschperli](https://forum.shopware.com/u/Chnuschperli)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [11. September 2020 um 10:02 UTC](https://forum.shopware.com/t/how-to-call-all-product-properties/69522 "2020-09-11T10:02:20Z")

</div>

HI Shopware Community Does anybody know how to call ALL Product Properties in a REST-Call? \>\> and also how can you update them again? Thx for your help

---

## [Where are stored custom field values for products or any other entity?](https://forum.shopware.com/t/where-are-stored-custom-field-values-for-products-or-any-other-entity/66345)

<div class="topic-metadata">

**Author:** [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [10. September 2020 um 11:35 UTC](https://forum.shopware.com/t/where-are-stored-custom-field-values-for-products-or-any-other-entity/66345 "2020-09-10T11:35:57Z")

</div>

Tree tables are storing the custom fields and their relations with entities. custom\_field custom\_field\_set custom\_field\_set\_relation However Where are stored the actual values of those fields when you use them in an …

---

## [How to Access Config Parameters in Twig Template of the Admin Module](https://forum.shopware.com/t/how-to-access-config-parameters-in-twig-template-of-the-admin-module/69422)

<div class="topic-metadata">

**Author:** [@coffeeman](https://forum.shopware.com/u/coffeeman)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [7. September 2020 um 10:27 UTC](https://forum.shopware.com/t/how-to-access-config-parameters-in-twig-template-of-the-admin-module/69422 "2020-09-07T10:27:02Z")

</div>

Hey there, I’m looking for a way to access configuration parameters in twig template of the admin module. I tried to acces it by: {{ shopware.config.pluginName.config.fieldName }} The problem is that in the admin modu…

---

## [Accessing default context in version 6.1.0](https://forum.shopware.com/t/accessing-default-context-in-version-6-1-0/63510)

<div class="topic-metadata">

**Author:** [@risto\_kekovic](https://forum.shopware.com/u/risto_kekovic)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [30. August 2020 um 09:17 UTC](https://forum.shopware.com/t/accessing-default-context-in-version-6-1-0/63510 "2020-08-30T09:17:31Z")

</div>

Hello! I am trying to migrate a plugin that was compatible with Shopware 6.0.0 to the new version 6.1.0 RC2. However, I am having an issue with accessing context. The problem is that the method \\Shopware\\Core\\Framework\\…

---

## [Disable certain Toolbar functions in Backend of Shopware 6](https://forum.shopware.com/t/disable-certain-toolbar-functions-in-backend-of-shopware-6/68972)

<div class="topic-metadata">

**Author:** [@hillebrandlukas](https://forum.shopware.com/u/hillebrandlukas)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [15. August 2020 um 10:25 UTC](https://forum.shopware.com/t/disable-certain-toolbar-functions-in-backend-of-shopware-6/68972 "2020-08-15T10:25:00Z")

</div>

How can I disable certain toolbar functions (for example: bold, text color, …) in the backend for custom blocks / elements?

---

## [Using Services in Rules](https://forum.shopware.com/t/using-services-in-rules/67874)

<div class="topic-metadata">

**Author:** [@Hansibert](https://forum.shopware.com/u/Hansibert)\
**Antworten:** 2\
**Zuletzt aktualisiert:** [3. August 2020 um 09:33 UTC](https://forum.shopware.com/t/using-services-in-rules/67874 "2020-08-03T09:33:53Z")

</div>

Hello I have created a custom rule. It generally seems to work (admin part is working, I get the right config from admin, the rule is constructed and match is called). Nice! For the evaluation of my rule (the implement…

---

## [Form validation in Shopware 6 administration](https://forum.shopware.com/t/form-validation-in-shopware-6-administration/65658)

<div class="topic-metadata">

**Author:** [@Pieter](https://forum.shopware.com/u/Pieter)\
**Antworten:** 4\
**Zuletzt aktualisiert:** [31. Juli 2020 um 06:11 UTC](https://forum.shopware.com/t/form-validation-in-shopware-6-administration/65658 "2020-07-31T06:11:22Z")

</div>

Does anybody know of a good tutorial on how to implement form validation in a custom module in the Shopware 6 administration? The “how to’s” that I found go into the details of crud actions, but without any reference to …

---

## [Detect Shopware Version through API](https://forum.shopware.com/t/detect-shopware-version-through-api/64512)

<div class="topic-metadata">

**Author:** [@ronaksolanki10](https://forum.shopware.com/u/ronaksolanki10)\
**Antworten:** 12\
**Zuletzt aktualisiert:** [28. Juli 2020 um 14:15 UTC](https://forum.shopware.com/t/detect-shopware-version-through-api/64512 "2020-07-28T14:15:43Z")

</div>

Hello, Thank you in advance. Is there any way to check Shopware version through API. for example shop URL - https://example.shop.com is a running Shopware 5 or Shopware 6 without using any credentials.

---

## [Subfolder Redirect](https://forum.shopware.com/t/subfolder-redirect/68500)

<div class="topic-metadata">

**Author:** [@M4ketech](https://forum.shopware.com/u/M4ketech)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [21. Juli 2020 um 12:33 UTC](https://forum.shopware.com/t/subfolder-redirect/68500 "2020-07-21T12:33:33Z")

</div>

Hey, I like to have main website at root domain and point the shopware at domain.com/shop but it seems to be little harder. Right now it shows domain.com/shop/public/ and you cant have / when you try verify domain in ac…

---

## [Persisting data between checkout steps](https://forum.shopware.com/t/persisting-data-between-checkout-steps/68285)

<div class="topic-metadata">

**Author:** [@Major\_Kuprich](https://forum.shopware.com/u/Major_Kuprich)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [10. Juli 2020 um 15:44 UTC](https://forum.shopware.com/t/persisting-data-between-checkout-steps/68285 "2020-07-10T15:44:28Z")

</div>

Hello, How can we share additional data on checkout pages. I want to save data in /checkout/cart page and display it on /checkout/confirm page. I’ve tried with custom collector class which implements CartProcessorInte…

---

## [Pass additional data to order mail](https://forum.shopware.com/t/pass-additional-data-to-order-mail/68284)

<div class="topic-metadata">

**Author:** [@Major\_Kuprich](https://forum.shopware.com/u/Major_Kuprich)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [10. Juli 2020 um 15:33 UTC](https://forum.shopware.com/t/pass-additional-data-to-order-mail/68284 "2020-07-10T15:33:11Z")

</div>

Hello, Is it possible in shopware6 to pass new data to mail template? I’ve tried with MailBeforeValidateEvent but it only returns current data. There are no sth like setTemplateData. I’ve seen similiar question lon…

---

## [Override 2 CMS components in main plugin theme](https://forum.shopware.com/t/override-2-cms-components-in-main-plugin-theme/68091)

<div class="topic-metadata">

**Author:** [@Maniur](https://forum.shopware.com/u/Maniur)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [2. Juli 2020 um 14:18 UTC](https://forum.shopware.com/t/override-2-cms-components-in-main-plugin-theme/68091 "2020-07-02T14:18:22Z")

</div>

Hello All, I have problem with override more than 1 CMS component in my plugin theme. I would like to have something like this: import template1 from './extension/test1.html.twig'; Component.override('sw-cms-el-config-…

---

## [Dummy plugin which will just show some info to the Administration user?](https://forum.shopware.com/t/dummy-plugin-which-will-just-show-some-info-to-the-administration-user/68089)

<div class="topic-metadata">

**Author:** [@WEBCentric\_Marko](https://forum.shopware.com/u/WEBCentric_Marko)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [2. Juli 2020 um 13:41 UTC](https://forum.shopware.com/t/dummy-plugin-which-will-just-show-some-info-to-the-administration-user/68089 "2020-07-02T13:41:02Z")

</div>

Hello, i have a few questions and need help about creating a very simple dummy plugin for Shopware 6. It is just supposed to give some instructions (like a formated box of text) to the user in the Administration part.…

---

## [\`Shopware\\Core\\Framework\\Migration\\InheritanceUpdaterTrait\` and \`KEY\`/\`CONSTRAINT\`](https://forum.shopware.com/t/shopware-core-framework-migration-inheritanceupdatertrait-and-key-constraint/67827)

<div class="topic-metadata">

**Author:** [@Hansibert](https://forum.shopware.com/u/Hansibert)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [21. Juni 2020 um 12:57 UTC](https://forum.shopware.com/t/shopware-core-framework-migration-inheritanceupdatertrait-and-key-constraint/67827 "2020-06-21T12:57:37Z")

</div>

Looking at the InheritanceUpdaterTrait (https://github.com/shopware/platform/blob/42c8e52ea24366f3f19da913356b3356fc9dac0a/src/Core/Framework/Migration/InheritanceUpdaterTrait.php) I can see that it only creates a BINARY…

---

## [What does custom-cms-block.js file in custom cms block example plugin do?](https://forum.shopware.com/t/what-does-custom-cms-block-js-file-in-custom-cms-block-example-plugin-do/66660)

<div class="topic-metadata">

**Author:** [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [19. Juni 2020 um 19:10 UTC](https://forum.shopware.com/t/what-does-custom-cms-block-js-file-in-custom-cms-block-example-plugin-do/66660 "2020-06-19T19:10:56Z")

</div>

I was trying to create a new cms block plugin, and did everything according to the instructions described here https://docs.shopware.com/en/shopware-platform-dev-en/how-to/custom-cms-block However the element is never c…

---

## [CustomerAddressEntity::getCountry returns null](https://forum.shopware.com/t/customeraddressentity-getcountry-returns-null/67798)

<div class="topic-metadata">

**Author:** [@Hansibert](https://forum.shopware.com/u/Hansibert)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [19. Juni 2020 um 12:29 UTC](https://forum.shopware.com/t/customeraddressentity-getcountry-returns-null/67798 "2020-06-19T12:29:06Z")

</div>

In my subscriber I was trying to load some customer addresses. Somehow $address-\\\>getCountry() returns null: $addresses = $this-\>addressRepository-\>search(new Criteria(), Context::createDefaultContext()); foreach ($addr…

---

## [JSON Composer File nicht gefunden beim Upload in den Community Store](https://forum.shopware.com/t/json-composer-file-nicht-gefunden-beim-upload-in-den-community-store/67698)

<div class="topic-metadata">

**Author:** [@Lukas\_Chabiniak](https://forum.shopware.com/u/Lukas_Chabiniak)\
**Antworten:** 4\
**Zuletzt aktualisiert:** [19. Juni 2020 um 07:50 UTC](https://forum.shopware.com/t/json-composer-file-nicht-gefunden-beim-upload-in-den-community-store/67698 "2020-06-19T07:50:02Z")

</div>

Hi, beim Upload des Plugins für Shopware 6 in den Store bin ich auf Schwierigkeiten gestoßen. Ich habe ein Code-Review beantragt, leider ohne Erfolg. Es tritt ein Fehler auf, dass die JSON Composer File fehlt. Sie ist …

---

## [How can i filter out inactive products when i do a search over api in shopware 6](https://forum.shopware.com/t/how-can-i-filter-out-inactive-products-when-i-do-a-search-over-api-in-shopware-6/67722)

<div class="topic-metadata">

**Author:** [@kabengwa](https://forum.shopware.com/u/kabengwa)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [17. Juni 2020 um 06:39 UTC](https://forum.shopware.com/t/how-can-i-filter-out-inactive-products-when-i-do-a-search-over-api-in-shopware-6/67722 "2020-06-17T06:39:11Z")

</div>

i am doing a search over the api using (api/v1/search/product) and {“term”:“with”,“includes”:{“product”:\[“id”,“name”\]}} as the body. however i also get the products in the shop that are curently inactive. This has meant …

---

## [StorefrontRenderEvent::class event](https://forum.shopware.com/t/storefrontrenderevent-class-event/67583)

<div class="topic-metadata">

**Author:** [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [10. Juni 2020 um 13:56 UTC](https://forum.shopware.com/t/storefrontrenderevent-class-event/67583 "2020-06-10T13:56:55Z")

</div>

Hi I am using StorefrontRenderEvent::class event. this event is working only once. then it is not working. I think the event is cached by Shopware. What I can do? I want to get the customer id, sales channel context,…

---

## [How to make storefront search also search product number, ean, customfields, etc?](https://forum.shopware.com/t/how-to-make-storefront-search-also-search-product-number-ean-customfields-etc/67529)

<div class="topic-metadata">

**Author:** [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Antworten:** 0\
**Zuletzt aktualisiert:** [9. Juni 2020 um 08:15 UTC](https://forum.shopware.com/t/how-to-make-storefront-search-also-search-product-number-ean-customfields-etc/67529 "2020-06-09T08:15:21Z")

</div>

Is there any guide on how shopware 6 storefront search works? In a subscriber to ProductSuggestResultEvent how to make the search also find products according to any product field that you need?

---

## [How can i disable auth bearer token for specific API route?](https://forum.shopware.com/t/how-can-i-disable-auth-bearer-token-for-specific-api-route/67408)

<div class="topic-metadata">

**Author:** [@alphabetus](https://forum.shopware.com/u/alphabetus)\
**Antworten:** 1\
**Zuletzt aktualisiert:** [4. Juni 2020 um 08:59 UTC](https://forum.shopware.com/t/how-can-i-disable-auth-bearer-token-for-specific-api-route/67408 "2020-06-04T08:59:42Z")

</div>

I have the following API route: /\*\* \* @Route("/api/v{version}/whic/tastings/archive/init", name="api.action.whic.tastings.init", methods={"POST"}) \*/ public function get\_stats(Request $request, Conte…

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

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