Observer doesn't workCan't set an observer on customer_loginRewrite Credit Memo API in Magento CE 1.9Collection items don't trigger product load event observers or backend models, but can they?Override Adminhtml importexport dataflow Profile Controllerhow to override a Core Customer Model in a local module in magento 1.9.2Magento 1: use of observers and missing native core setter?Simple Observer not firing on eventMy observer not workMagento1 createBlock method returns “bool(false)” in livehostClass observer in config.xml doesn't work
Can compressed videos be decoded back to their uncompresed original format?
Avoiding the "not like other girls" trope?
Why do I get negative height?
Was the Stack Exchange "Happy April Fools" page fitting with the '90's code?
Could the museum Saturn V's be refitted for one more flight?
Forgetting the musical notes while performing in concert
files created then deleted at every second in tmp directory
What do you call someone who asks many questions?
Am I breaking OOP practice with this architecture?
My ex-girlfriend uses my Apple ID to log in to her iPad. Do I have to give her my Apple ID password to reset it?
Was the old ablative pronoun "med" or "mēd"?
How to travel to Japan while expressing milk?
How do I exit BASH while loop using modulus operator?
How badly should I try to prevent a user from XSSing themselves?
Knowledge-based authentication using Domain-driven Design in C#
Did 'Cinema Songs' exist during Hiranyakshipu's time?
Why were 5.25" floppy drives cheaper than 8"?
Does the Idaho Potato Commission associate potato skins with healthy eating?
What's the meaning of "Sollensaussagen"?
Is there a hemisphere-neutral way of specifying a season?
How to find if SQL server backup is encrypted with TDE without restoring the backup
How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?
How can I prove that a state of equilibrium is unstable?
Finding the error in an argument
Observer doesn't work
Can't set an observer on customer_loginRewrite Credit Memo API in Magento CE 1.9Collection items don't trigger product load event observers or backend models, but can they?Override Adminhtml importexport dataflow Profile Controllerhow to override a Core Customer Model in a local module in magento 1.9.2Magento 1: use of observers and missing native core setter?Simple Observer not firing on eventMy observer not workMagento1 createBlock method returns “bool(false)” in livehostClass observer in config.xml doesn't work
I tried a few iterations and for whatever reason I can't add cookies or even execute any code from my observer, as it's not giving anything even if my observer has dies in it. I have my module visible on the list and enabled, there are no exceptions in the exception.log.
This is my xml file where observer define
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
<events>
<customer_login>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</MyProject_Cookie123>
</observers>
</customer_login>
<customer_logout>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</MyProject_Cookie123>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</MyProject_Cookie123>
</observers>
</controller_front_send_response_before>
</events>
</global>
</config>
This is my Observer file:-
app/code/local/MyProject/Cookie123/Model/Observer.php
<?php
class MyProject_Cookie123_Model_Observer
public function customerLogin($observer)
Mage::getModel('core/cookie')->set('testing_auth', 1);
public function customerLogout($observer)
Mage::getModel('core/cookie')->delete('testing_auth');
public function sendResponse($observer)
Mage::getModel('core/cookie')->set('test_123', 1);
$cartItems = Mage::helper('checkout/cart')->getItemsQty();
if ($cartItems > 0)
Mage::getModel('core/cookie')->set('testing_cart', 1);
else
if (Mage::getModel('core/cookie')->get('testing_cart'))
Mage::getModel('core/cookie')->delete('testing_cart');
magento-1.9 event-observer configuration
New contributor
add a comment |
I tried a few iterations and for whatever reason I can't add cookies or even execute any code from my observer, as it's not giving anything even if my observer has dies in it. I have my module visible on the list and enabled, there are no exceptions in the exception.log.
This is my xml file where observer define
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
<events>
<customer_login>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</MyProject_Cookie123>
</observers>
</customer_login>
<customer_logout>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</MyProject_Cookie123>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</MyProject_Cookie123>
</observers>
</controller_front_send_response_before>
</events>
</global>
</config>
This is my Observer file:-
app/code/local/MyProject/Cookie123/Model/Observer.php
<?php
class MyProject_Cookie123_Model_Observer
public function customerLogin($observer)
Mage::getModel('core/cookie')->set('testing_auth', 1);
public function customerLogout($observer)
Mage::getModel('core/cookie')->delete('testing_auth');
public function sendResponse($observer)
Mage::getModel('core/cookie')->set('test_123', 1);
$cartItems = Mage::helper('checkout/cart')->getItemsQty();
if ($cartItems > 0)
Mage::getModel('core/cookie')->set('testing_cart', 1);
else
if (Mage::getModel('core/cookie')->get('testing_cart'))
Mage::getModel('core/cookie')->delete('testing_cart');
magento-1.9 event-observer configuration
New contributor
add a comment |
I tried a few iterations and for whatever reason I can't add cookies or even execute any code from my observer, as it's not giving anything even if my observer has dies in it. I have my module visible on the list and enabled, there are no exceptions in the exception.log.
This is my xml file where observer define
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
<events>
<customer_login>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</MyProject_Cookie123>
</observers>
</customer_login>
<customer_logout>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</MyProject_Cookie123>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</MyProject_Cookie123>
</observers>
</controller_front_send_response_before>
</events>
</global>
</config>
This is my Observer file:-
app/code/local/MyProject/Cookie123/Model/Observer.php
<?php
class MyProject_Cookie123_Model_Observer
public function customerLogin($observer)
Mage::getModel('core/cookie')->set('testing_auth', 1);
public function customerLogout($observer)
Mage::getModel('core/cookie')->delete('testing_auth');
public function sendResponse($observer)
Mage::getModel('core/cookie')->set('test_123', 1);
$cartItems = Mage::helper('checkout/cart')->getItemsQty();
if ($cartItems > 0)
Mage::getModel('core/cookie')->set('testing_cart', 1);
else
if (Mage::getModel('core/cookie')->get('testing_cart'))
Mage::getModel('core/cookie')->delete('testing_cart');
magento-1.9 event-observer configuration
New contributor
I tried a few iterations and for whatever reason I can't add cookies or even execute any code from my observer, as it's not giving anything even if my observer has dies in it. I have my module visible on the list and enabled, there are no exceptions in the exception.log.
This is my xml file where observer define
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
<events>
<customer_login>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</MyProject_Cookie123>
</observers>
</customer_login>
<customer_logout>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</MyProject_Cookie123>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<MyProject_Cookie123>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</MyProject_Cookie123>
</observers>
</controller_front_send_response_before>
</events>
</global>
</config>
This is my Observer file:-
app/code/local/MyProject/Cookie123/Model/Observer.php
<?php
class MyProject_Cookie123_Model_Observer
public function customerLogin($observer)
Mage::getModel('core/cookie')->set('testing_auth', 1);
public function customerLogout($observer)
Mage::getModel('core/cookie')->delete('testing_auth');
public function sendResponse($observer)
Mage::getModel('core/cookie')->set('test_123', 1);
$cartItems = Mage::helper('checkout/cart')->getItemsQty();
if ($cartItems > 0)
Mage::getModel('core/cookie')->set('testing_cart', 1);
else
if (Mage::getModel('core/cookie')->get('testing_cart'))
Mage::getModel('core/cookie')->delete('testing_cart');
magento-1.9 event-observer configuration
magento-1.9 event-observer configuration
New contributor
New contributor
edited 18 hours ago
Magento_Bhurio
335110
335110
New contributor
asked 18 hours ago
MarcinWolnyMarcinWolny
1056
1056
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
change your config to following move your events to frontend tag & gave unique event ids:-
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
</global>
<frontend>
<events>
<customer_login>
<observers>
<myproject_cookie123_customerlogin>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</myproject_cookie123_customerlogin>
</observers>
</customer_login>
<customer_logout>
<observers>
<myproject_cookie123_customerlogout>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</myproject_cookie123_customerlogout>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<myproject_cookie123_sendresponse>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</myproject_cookie123_sendresponse>
</observers>
</controller_front_send_response_before>
</events>
</frontend>
</config>
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
MarcinWolny is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268332%2fobserver-doesnt-work%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
change your config to following move your events to frontend tag & gave unique event ids:-
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
</global>
<frontend>
<events>
<customer_login>
<observers>
<myproject_cookie123_customerlogin>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</myproject_cookie123_customerlogin>
</observers>
</customer_login>
<customer_logout>
<observers>
<myproject_cookie123_customerlogout>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</myproject_cookie123_customerlogout>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<myproject_cookie123_sendresponse>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</myproject_cookie123_sendresponse>
</observers>
</controller_front_send_response_before>
</events>
</frontend>
</config>
add a comment |
change your config to following move your events to frontend tag & gave unique event ids:-
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
</global>
<frontend>
<events>
<customer_login>
<observers>
<myproject_cookie123_customerlogin>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</myproject_cookie123_customerlogin>
</observers>
</customer_login>
<customer_logout>
<observers>
<myproject_cookie123_customerlogout>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</myproject_cookie123_customerlogout>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<myproject_cookie123_sendresponse>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</myproject_cookie123_sendresponse>
</observers>
</controller_front_send_response_before>
</events>
</frontend>
</config>
add a comment |
change your config to following move your events to frontend tag & gave unique event ids:-
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
</global>
<frontend>
<events>
<customer_login>
<observers>
<myproject_cookie123_customerlogin>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</myproject_cookie123_customerlogin>
</observers>
</customer_login>
<customer_logout>
<observers>
<myproject_cookie123_customerlogout>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</myproject_cookie123_customerlogout>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<myproject_cookie123_sendresponse>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</myproject_cookie123_sendresponse>
</observers>
</controller_front_send_response_before>
</events>
</frontend>
</config>
change your config to following move your events to frontend tag & gave unique event ids:-
app/code/local/MyProject/Cookie123/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Cookie123>
<version>1.0.0</version>
</MyProject_Cookie123>
</modules>
<global>
<models>
<Cookie123>
<class>MyProject_Cookie123_Model</class>
</Cookie123>
</models>
</global>
<frontend>
<events>
<customer_login>
<observers>
<myproject_cookie123_customerlogin>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogin</method>
</myproject_cookie123_customerlogin>
</observers>
</customer_login>
<customer_logout>
<observers>
<myproject_cookie123_customerlogout>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>customerLogout</method>
</myproject_cookie123_customerlogout>
</observers>
</customer_logout>
<controller_front_send_response_before>
<observers>
<myproject_cookie123_sendresponse>
<type>model</type>
<class>MyProject_Cookie123_Model_Observer</class>
<method>sendResponse</method>
</myproject_cookie123_sendresponse>
</observers>
</controller_front_send_response_before>
</events>
</frontend>
</config>
answered 18 hours ago
Hassan Ali ShahzadHassan Ali Shahzad
655317
655317
add a comment |
add a comment |
MarcinWolny is a new contributor. Be nice, and check out our Code of Conduct.
MarcinWolny is a new contributor. Be nice, and check out our Code of Conduct.
MarcinWolny is a new contributor. Be nice, and check out our Code of Conduct.
MarcinWolny is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268332%2fobserver-doesnt-work%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown