shopware | Shopware 5 Repository - For Shopware 6 visit https | Ecommerce library
kandi X-RAY | shopware Summary
kandi X-RAY | shopware Summary
Shopware 5 is the next generation of open source e-commerce software made in Germany. Based on bleeding edge technologies like Symfony 4, Doctrine 2 & Zend Framework Shopware comes as the perfect platform for your next e-commerce project. Furthermore Shopware 5 provides an event-driven plugin system and an advanced hook system, giving you the ability to customize every part of the platform. Visit the forum at
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Update email templates
- Calculates the date
- Test if smarty is installed .
- Get requirements matrix
- Extract information from user - agent
- Saves order data
- Adds a voucher to the basket
- Returns a formatted date .
- Parse a date string
- Dump container .
shopware Key Features
shopware Examples and Code Snippets
Community Discussions
Trending Discussions on shopware
QUESTION
I'm new to shopware and currently learning plugin development. I'm creating a plugin that needs to load a JavaScript library to be loaded only in PDP and it needs API credentials from the database. The docs cover how to load JavaScript via JavaScript plugins but I need to fetch data from the BE, are there any docs covering this topic or how do I start implementing this feature?
...ANSWER
Answered 2022-Apr-11 at 05:56To make (mostly static) data - like a API configuration - from the database available in the Frontend Javascript code, you can print out that data in the Twig template. The Shopware core assigns such data to the window
object. You can do the same in your plugin.
To do this, you also have to "transport" the data first to the the Twig file, like described in another doc page.
QUESTION
I created a plugin in which I would like to send a Mail to a customer.
It would be really convenient to use the email templates, since they are editable in the admin panel. The problem here is that the email templates need a type and I could not find a generic type, but only specific ones.
Should I create my own email template type? Or is there another way to use a template? Do I have to do it without Templates?
...ANSWER
Answered 2022-Mar-10 at 17:04To add a new type of email template which you can then select in the admin panel, you have to use a migration. See here for an example.
Then you can use the description in the section "An advanced email service for Shopware 6" in the tutorial to trigger the mail.
QUESTION
We have read https://developer.shopware.com/docs/guides/plugins/plugins/plugin-fundamentals/add-scheduled-task which described how to define a scheduled tasks which runs every x minutes.
Is it also possible to specific the execution time, for example each midnight or every day a 2 am, like in a crontab?
...ANSWER
Answered 2022-Mar-10 at 15:22I'm not aware of such a feature in Shopware core.
The probably most straightforward way would be to add a "real" cronjob like you mentioned, which triggers a CLI-command.
You can encapsulate the logic of the task in it's own service, so that the scheduled task and cli-command both can just use the service (if you want to keep both).
QUESTION
We are launching a Shopware 6 website and want to acomplish the following URL strucutre:
https://example.com/de -> German Language https://example.com/en -> English Language
We currently have tree entries in the the Storefront's domain configuration:
The problem here is, that the language switcher always defaults to the shortest (?) URL when switching stores, i.e. when switching from EN to DE, it picks https://example.com instead of https://example.com/de.
We have the entry (1) in the domain configuration, because without it, plugins break (they cannot properly generate their API URLs anymore).
Is this a problem in the plugins and should it be possible to just delete (1) or are we supposed to make the configuration differently?
...ANSWER
Answered 2022-Feb-17 at 07:08Based on the comments of @j_elfering and @mnaczenski I reported to the plugin vendor who released a fix very quickly.
I believe this is the important change in the module. It's not really accessing the store API but a normal controller:
diff:
QUESTION
I have overwritten the controller in the application by overwritten route and it works, but also installed another plugin that overwritten the same route as I overwritten (this plugin cannot be changed) and now this route is supported by the shopware, not mine.
this is my controller I want to display
...ANSWER
Answered 2022-Jan-03 at 15:31as a hack, i would try to use a Listen and ignore the Route from Shopware.
QUESTION
I am trying to get information about a customer using the REST API of Shopware 6 (using this API). Therefor I need a ContextToken for that user. The only way to get a context token for a user is to log him in, but for that I need the password of a user which I do not have. Is there any way to get the ContextToken of a user with only his email address or hist customer id?
...ANSWER
Answered 2022-Feb-01 at 08:24Shopware comes with 2 different APIs, the Store-API and the Admin-API. Refer to the docs.
The Store-API is there to build a storefront and thus you need to authenticate as the user using that API.
When you build custom integrations you should use the Admin-API, as that API can be used for CRUD-like operations on all entities of the system. For the admin API you can generate an API-Token and use it to query data of all customers.
QUESTION
We want to display customer (actually customer-group) specific information on product detail pages in Shopware 6.
There seems to be the HTTP cache and we are afraid that the page would be cached if a specific customer group displays the page and the information would be leaked to non-customers.
Is this assumption correct?
The documentation does not reveal much information about this.
Is there a way to set specific cache tags, so that the information is only displayed to the correct customer group?
Or do we need to fetch the data dynamically via AJAX?
Bonus question: Can the HTTP cache be simulated in automatic tests to ensure the functionality works?
What I found out so far:
The is annotation
@httpCache
for controller, which seems to control whether a page is cached or notThe cache key is generated in
\Shopware\Storefront\Framework\Cache\HttpCacheKeyGenerator::generate
. It take the full request URI into account, and somecacheHash
which is injected. I believe it would not take the customer group into accountMaybe this
generate()
method could be decorated, but I am not sure if that is the right way.There is a cookie being set
sw-cache-hash
which influences the caching. It takes the customer into account.
...sw-cache-hash
is created here:
ANSWER
Answered 2022-Jan-28 at 10:51As you can see in the last code snippet, it takes into account the active Rule ids. This means that if you create a rule (through Settings > Rule Builder) that is active on a certain group, but not on another or no group, it will be taken into account & create a different cache hash for the different customer groups.
QUESTION
I want to use CSRF in ajax mode - Use CSRF protection
Currently I edited the storefront.yaml in vendor/shopware folder, but that shouldn't be right? For config changes, I should create a new .yaml file, but where do I put it?
Thanks
...ANSWER
Answered 2022-Jan-25 at 16:34I think it should go to config/packages/storefront.yaml
QUESTION
How can I prevent the registration email from being send if a customer is registered using the REST API (storeurl/store-api/account/register)? I already did try to set the flag "acceptedDataProtection" to true.
I am trying to register our customers from another database to shopware, therefor they already have accepted the data protection and should not be receiving an email telling them that they have to opt-in again.
...ANSWER
Answered 2022-Jan-24 at 12:19Just add a tag to that customer like "migrated" and then check via rule for tag != migrated
in the flow builder. There should be an entry for the registration event. This would be the easiest way and also the one without any additional individualization needed. You can also check for the sales channel, when using the headless sales channel for the registrations and exclude it.
QUESTION
I was wondering how can i change the default styles of Mollie Plugin in Shopware 6?
what i tried so far:
- using css to change credit-card components styles
- using jQuery and Javascript to overwriting CSS in JS files
- tried to change Plugin JS files directly but I need to
build:storefront
(and with next update it all will lost)
all things that I already tried didn't work. please if you have any idea i really appreciated.
I need to change this red color:
...ANSWER
Answered 2022-Jan-19 at 19:11The code is in an iframe, you cannot change it directly.
But if you look at the src of the iframe, the Moolie server accepts parameters for the background color. This can theoretically be changed from Shopware 6 side by adapting the module. (see https://docs.mollie.com/components/styling)
Anyways, the Mollie module does not seem to use the standard error color from the Theme. I would consider this a shortcoming / bug in the module and recommend you try to report it to the module vendor.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shopware
Copy .env.dist to .env and modify variables if needed
make init
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page