Show Trusted Shops reviews in Shopware 6
Weaknesses of the standard solution for Trusted Shops integration
Trusted Shops offers online stores and their customers services in the form of a seal of approval, a buyer protection procedure and a system for customer reviews. This article is specifically about the reviews from Trusted Shops. Store and product reviews help other customers make better purchasing decisions. Trusted Shops promises that only real reviews are used for certified stores.
In one of our Shopware projects we installed the official Trusted Shops extension. In the process, we noticed that this extension does not offer the option to output Trusted Shops reviews in the frontend instead of the reviews from Shopware, which are output by default. To achieve this, we have therefore developed our own extension.
Our solution: new Shopware 6 Trusted Shops-extension
We use the official interface provided by Trusted Shops for this purpose. After creating a login token, it is possible to access the ratings belonging to the store via the API. Via the event "Product_Loaded_Event" and with the help of a subscriber that hooks in here, we fetch the product ratings from the Trusted Shops database.
The process goes through all the product records that are relevant at that time and for that particular page and stores the reviews as an array in the database. In the last step, we updated the corresponding placeholders in the templates so that the reviews from Trusted Shops are now output in all relevant places.
What challenges have we encountered?
We won't hide a few of the challenges we encountered during implementation.
Performance
On overview pages with a lot of products, the load time is severely affected by the "on-the-fly" querying of reviews. However, we were able to solve this problem by caching the reviews so that a query via API is not required for every page load. We also outsourced the generation of tokens required for communication via API to a separate process. These measures have led to a massive improvement in performance.
Token TTL
During the test phase, we stumbled across another problem that could not be overlooked, as it happened that suddenly no ratings were displayed at all. The cause in this case was the Time to Live (TTL) of the login token. After a defined time, the token becomes invalid and must be renewed. However, this process clashed with the desire to keep this token in the cache for a certain time. The problem could be solved quickly by aligning the TTL values for token and buffer.
After these initial troubles could be ironed out, the extension has now been running stably in productive operation for several months.
Learn more
On our landing page for the Shopware 6 Trusted Shops extension, you will find a compact summary of all relevant features and benefits: Why are real product reviews so important for a purchase decision and how can product recommendations be played out performantly? We have summarized everything you need to know in our article on the Shopware 6 Trsuted Shops extension.
If you would like to learn more about this Shopware extension or about our services around the Shopware software, please contact us.
Please feel free to share this article.
Comments
No comments yet.