abinjohnedamanaabinjohnedamana MemberComments: 36 Received thanks: 9 Member since: February 2019 edited March 12

Hi

I am creating a plugin. I am using NavigationPageLoadedEvent in my plugin.

But the problem is Shopware cache the events so the events are not working in the dev server.

I have installed the user version of Shopware (6.1.3). and SHOPWARE_HTTP_CACHE_ENABLED is 1.

if I change the SHOPWARE_HTTP_CACHE_ENABLED to 0 it will work.

is there any way to do some functions NavigationPageLoadedEvent even if the Http cache enabled.?

There are no issues with the local installation running on the docker. the events are working even if the  SHOPWARE_HTTP_CACHE_ENABLED is 1. 

Why is the production server caching the events?

Answers

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9039 Received thanks: 2697 Member since: September 2013

    The http cache caches the complete html response, when the http-cache is active you can only use ESI-tags or javascript to change the html output. This is not a shopware issue, but the functionality of the caching itself.

    https://symfony.com/doc/current/http_cache/esi.html

  • abinjohnedamanaabinjohnedamana MemberComments: 36 Received thanks: 9 Member since: February 2019

    The http cache caches the complete html response, when the http-cache is active you can only use ESI-tags or javascript to change the html output. This is not a shopware issue, but the functionality of the caching itself.

    https://symfony.com/doc/current/http_cache/esi.html

     

    I am using ProductEvents::PRODUCT_SEARCH_CRITERIA event

    I want to add some conditions to product search and load only the condition satisfied products.

    how to do this with ESI-tags?

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9039 Received thanks: 2697 Member since: September 2013

    Do you have any criterias that are based on the logged in customer and so on? Something that will change between requests?
    Because it should work with general criterias (e.g. "only products with stock > 500"), because the output will always be the same. 

  • abinjohnedamanaabinjohnedamana MemberComments: 36 Received thanks: 9 Member since: February 2019

    Do you have any criterias that are based on the logged in customer and so on? Something that will change between requests?
    Because it should work with general criterias (e.g. "only products with stock > 500"), because the output will always be the same. I

     

    I have added two custom fields for products, published from date and published to date. so i want to show the products only if the current date is in between these 2 dates.

    This checking must be done in category wise product listing,product search result.

Sign In or Register to comment.