1

I have an extension which saves some data into session when user makes any of the following action:

-adds/remove product to cart or change qty
-apply coupon code
-login

For this I created different observers, this is just one of them:

 <checkout_cart_product_add_after>
 <observers>
 <save_data_into_session>
 <type>singleton</type>
 <class>company_modulname/observer</class>
 <method>saveData</method>
 </save_data_into_session> 
 </observers>
 </checkout_cart_product_add_after> 

I don't need anything else, I just need to store value to session or cookie.

Problem:

The problem is about cache. I created observer for each action (checkout_cart_product_add_after,checkout_cart_save_after, ...). Some cache extensions caches also logged in user. It will cache everything except block that is required to display user cart. But this means Magento still needs to go through some models I guess.

My question is: Let's say I define observer inside config.xml and cache module caches my block, but it goes through Magento core models required to display cart inside header. Will Magento go through my observer model or not?

asked Sep 7, 2015 at 16:20

1 Answer 1

2

Since storing data in the session can't be done it will. Customer (user) specific data and page calls will never be cached so you should be good

answered Sep 7, 2015 at 16:33
2
  • Why storing data in the session can't be done? I am not sure if I understand what you mean. Commented Sep 7, 2015 at 16:46
  • Ah, no it can be done. But it'll never be cached :) so your observer should just work fine Commented Sep 7, 2015 at 16:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.