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
How can I tell someone that I want to be his or her friend?
I Accidentally Deleted a Stock Terminal Theme
How do I write bicross product symbols in latex?
AES: Why is it a good practice to use only the first 16bytes of a hash for encryption?
SSH "lag" in LAN on some machines, mixed distros
Why can't we play rap on piano?
Is there a hemisphere-neutral way of specifying a season?
Can a virus destroy the BIOS of a modern computer?
What does it mean to describe someone as a butt steak?
Twin primes whose sum is a cube
Could gravitational lensing be used to protect a spaceship from a laser?
Alternative to sending password over mail?
How can I make my BBEG immortal short of making them a Lich or Vampire?
Forgetting the musical notes while performing in concert
When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?
Why do bosons tend to occupy the same state?
Took a trip to a parallel universe, need help deciphering
How to take photos in burst mode, without vibration?
Why doesn't using multiple commands with a || or && conditional work?
What is the most common color to indicate the input-field is disabled?
90's TV series where a boy goes to another dimension through portal near power lines
Would Slavery Reparations be considered Bills of Attainder and hence Illegal?
Why is the 'in' operator throwing an error with a string literal instead of logging false?
Blender 2.8 I can't see vertices, edges or faces in edit mode
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
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
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 2 days ago
Magento_Bhurio
374110
374110
New contributor
asked 2 days 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 2 days 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