How to fix an error in Helper/Data.phpMagento started displaying Fatal Error: getSummaryHtml() on non-object...
Early credit roll before the end of the film
Could an Apollo mission be possible if Moon would be Earth like?
Plausible reason for gold-digging ant
Can you tell from a blurry photo if focus was too close or too far?
Strange "DuckDuckGo dork" takes me to random website
Eww, those bytes are gross
Potential client has a problematic employee I can't work with
Saint abbreviation
Why don't key signatures indicate the tonic?
systemd service won't start nodejs
Existence of Riemann surface, holomorphic maps
Can we "borrow" our answers to populate our own websites?
Changing the laptop's CPU. Should I reinstall Linux?
Current across a wire with zero potential difference
Is there any risk in sharing info about technologies and products we use with a supplier?
How can I find y?
Removing whitespace between consecutive numbers
When obtaining gender reassignment/plastic surgery overseas, is an emergency travel document required to return home?
How to access internet and run apt-get through a middle server?
Definition of "atomic object"
Best way to strengthen a wheel?
How to remove from the data the rows of with fixed number of elements?
How do you voice extended chords?
How do I prevent a homebrew Grappling Hook feature from trivializing Tomb of Annihilation?
How to fix an error in Helper/Data.php
Magento started displaying Fatal Error: getSummaryHtml() on non-object during product lookups and category listingsExclude a specific categorycatalog_product_load_before event gives getRequestedRouteName() errorCustom Contact Form using Custom Template (Works .. Kind of)Solved: Braintree and Magestore Onestepcheckout setData() on a non-objectError start SessionMagento - Add customer attribute to order gridError Running script with shell_exec from custom controllerSend Multiple input value to database through ajax?Reset password don't work after patch 10888
Added a couple of functions, trying to call them in the form template and get the error.
<?php
class RonisBT_Feedback_Helper_Data extends Mage_Core_Helper_Abstract
{
public function getName()
{
if (Mage::getSingleton('customer/session')->getFeedbackName() != "") {
$name = Mage::getSingleton('customer/session')->getFeedbackName();
} else {
$name = $this->helper('contacts')->getUserName();
}
return $name;
}
public function getEmail()
{
if (Mage::getSingleton('customer/session')->getFeedbackEmail() != "") {
$email = Mage::getSingleton('customer/session')->getFeedbackEmail();
} else {
$email = $this->helper('contacts')->getUserName();
}
return $email;
}
public function getPhone()
{
Mage::getSingleton('customer/session')->getFeedbackPhone();
$phone = Mage::getSingleton('customer/session')->getFeedbackPhone();
return $phone;
}
public function getMessage()
{
Mage::getSingleton('customer/session')->getFeedbackMessage();
$message = Mage::getSingleton('customer/session')->getFeedbackMessage();
return $message;
}
}
Call
<?php echo Mage::helper('feedback')->getName(); ?>
I get this error.
Fatal error: Call to undefined method RonisBT_Feedback_Helper_Data::helper()
magento-1.9
New contributor
add a comment |
Added a couple of functions, trying to call them in the form template and get the error.
<?php
class RonisBT_Feedback_Helper_Data extends Mage_Core_Helper_Abstract
{
public function getName()
{
if (Mage::getSingleton('customer/session')->getFeedbackName() != "") {
$name = Mage::getSingleton('customer/session')->getFeedbackName();
} else {
$name = $this->helper('contacts')->getUserName();
}
return $name;
}
public function getEmail()
{
if (Mage::getSingleton('customer/session')->getFeedbackEmail() != "") {
$email = Mage::getSingleton('customer/session')->getFeedbackEmail();
} else {
$email = $this->helper('contacts')->getUserName();
}
return $email;
}
public function getPhone()
{
Mage::getSingleton('customer/session')->getFeedbackPhone();
$phone = Mage::getSingleton('customer/session')->getFeedbackPhone();
return $phone;
}
public function getMessage()
{
Mage::getSingleton('customer/session')->getFeedbackMessage();
$message = Mage::getSingleton('customer/session')->getFeedbackMessage();
return $message;
}
}
Call
<?php echo Mage::helper('feedback')->getName(); ?>
I get this error.
Fatal error: Call to undefined method RonisBT_Feedback_Helper_Data::helper()
magento-1.9
New contributor
Have you declare helper in etc/config.xml?
– Saphal Jha
1 hour ago
add a comment |
Added a couple of functions, trying to call them in the form template and get the error.
<?php
class RonisBT_Feedback_Helper_Data extends Mage_Core_Helper_Abstract
{
public function getName()
{
if (Mage::getSingleton('customer/session')->getFeedbackName() != "") {
$name = Mage::getSingleton('customer/session')->getFeedbackName();
} else {
$name = $this->helper('contacts')->getUserName();
}
return $name;
}
public function getEmail()
{
if (Mage::getSingleton('customer/session')->getFeedbackEmail() != "") {
$email = Mage::getSingleton('customer/session')->getFeedbackEmail();
} else {
$email = $this->helper('contacts')->getUserName();
}
return $email;
}
public function getPhone()
{
Mage::getSingleton('customer/session')->getFeedbackPhone();
$phone = Mage::getSingleton('customer/session')->getFeedbackPhone();
return $phone;
}
public function getMessage()
{
Mage::getSingleton('customer/session')->getFeedbackMessage();
$message = Mage::getSingleton('customer/session')->getFeedbackMessage();
return $message;
}
}
Call
<?php echo Mage::helper('feedback')->getName(); ?>
I get this error.
Fatal error: Call to undefined method RonisBT_Feedback_Helper_Data::helper()
magento-1.9
New contributor
Added a couple of functions, trying to call them in the form template and get the error.
<?php
class RonisBT_Feedback_Helper_Data extends Mage_Core_Helper_Abstract
{
public function getName()
{
if (Mage::getSingleton('customer/session')->getFeedbackName() != "") {
$name = Mage::getSingleton('customer/session')->getFeedbackName();
} else {
$name = $this->helper('contacts')->getUserName();
}
return $name;
}
public function getEmail()
{
if (Mage::getSingleton('customer/session')->getFeedbackEmail() != "") {
$email = Mage::getSingleton('customer/session')->getFeedbackEmail();
} else {
$email = $this->helper('contacts')->getUserName();
}
return $email;
}
public function getPhone()
{
Mage::getSingleton('customer/session')->getFeedbackPhone();
$phone = Mage::getSingleton('customer/session')->getFeedbackPhone();
return $phone;
}
public function getMessage()
{
Mage::getSingleton('customer/session')->getFeedbackMessage();
$message = Mage::getSingleton('customer/session')->getFeedbackMessage();
return $message;
}
}
Call
<?php echo Mage::helper('feedback')->getName(); ?>
I get this error.
Fatal error: Call to undefined method RonisBT_Feedback_Helper_Data::helper()
magento-1.9
magento-1.9
New contributor
New contributor
New contributor
asked 1 hour ago
Рома ЛытарьРома Лытарь
415
415
New contributor
New contributor
Have you declare helper in etc/config.xml?
– Saphal Jha
1 hour ago
add a comment |
Have you declare helper in etc/config.xml?
– Saphal Jha
1 hour ago
Have you declare helper in etc/config.xml?
– Saphal Jha
1 hour ago
Have you declare helper in etc/config.xml?
– Saphal Jha
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
It looks like you are calling $this->helper('contacts')
from inside your Helper class. The helper()
function only exists on certain classes, but Mage_Core_Helper_Abstract
is not one of them. You should instead call Mage::helper('contacts')
Update
For the sake of a more informative answer, the two core classes that come with the helper()
function are Mage_Core_Model_Layout
and Mage_Core_Block_Abstract
. If you are inside of a class that extends either of these you will be able to use $this->helper()
. Otherwise you would need to call the global Mage::helper()
.
Changed, but the error did not disappear
– Рома Лытарь
1 hour ago
Please be sure all cache is cleared/disabled. If you made this change the error message should have changed or gone away. What is the new error message?
– rain2o
1 hour ago
Cache cleared, all the same error
– Рома Лытарь
1 hour ago
The compiler reassembled, the error disappeared, but now the function displays nothing (
– Рома Лытарь
1 hour ago
Sounds like the error is resolved then, but you have another issue now. At this point I would check each of the pieces ingetName
to make sure they are getting a value. My guess is$name
isn't getting a value.
– rain2o
1 hour ago
|
show 1 more 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
});
}
});
Рома Лытарь 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%2f263516%2fhow-to-fix-an-error-in-helper-data-php%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
It looks like you are calling $this->helper('contacts')
from inside your Helper class. The helper()
function only exists on certain classes, but Mage_Core_Helper_Abstract
is not one of them. You should instead call Mage::helper('contacts')
Update
For the sake of a more informative answer, the two core classes that come with the helper()
function are Mage_Core_Model_Layout
and Mage_Core_Block_Abstract
. If you are inside of a class that extends either of these you will be able to use $this->helper()
. Otherwise you would need to call the global Mage::helper()
.
Changed, but the error did not disappear
– Рома Лытарь
1 hour ago
Please be sure all cache is cleared/disabled. If you made this change the error message should have changed or gone away. What is the new error message?
– rain2o
1 hour ago
Cache cleared, all the same error
– Рома Лытарь
1 hour ago
The compiler reassembled, the error disappeared, but now the function displays nothing (
– Рома Лытарь
1 hour ago
Sounds like the error is resolved then, but you have another issue now. At this point I would check each of the pieces ingetName
to make sure they are getting a value. My guess is$name
isn't getting a value.
– rain2o
1 hour ago
|
show 1 more comment
It looks like you are calling $this->helper('contacts')
from inside your Helper class. The helper()
function only exists on certain classes, but Mage_Core_Helper_Abstract
is not one of them. You should instead call Mage::helper('contacts')
Update
For the sake of a more informative answer, the two core classes that come with the helper()
function are Mage_Core_Model_Layout
and Mage_Core_Block_Abstract
. If you are inside of a class that extends either of these you will be able to use $this->helper()
. Otherwise you would need to call the global Mage::helper()
.
Changed, but the error did not disappear
– Рома Лытарь
1 hour ago
Please be sure all cache is cleared/disabled. If you made this change the error message should have changed or gone away. What is the new error message?
– rain2o
1 hour ago
Cache cleared, all the same error
– Рома Лытарь
1 hour ago
The compiler reassembled, the error disappeared, but now the function displays nothing (
– Рома Лытарь
1 hour ago
Sounds like the error is resolved then, but you have another issue now. At this point I would check each of the pieces ingetName
to make sure they are getting a value. My guess is$name
isn't getting a value.
– rain2o
1 hour ago
|
show 1 more comment
It looks like you are calling $this->helper('contacts')
from inside your Helper class. The helper()
function only exists on certain classes, but Mage_Core_Helper_Abstract
is not one of them. You should instead call Mage::helper('contacts')
Update
For the sake of a more informative answer, the two core classes that come with the helper()
function are Mage_Core_Model_Layout
and Mage_Core_Block_Abstract
. If you are inside of a class that extends either of these you will be able to use $this->helper()
. Otherwise you would need to call the global Mage::helper()
.
It looks like you are calling $this->helper('contacts')
from inside your Helper class. The helper()
function only exists on certain classes, but Mage_Core_Helper_Abstract
is not one of them. You should instead call Mage::helper('contacts')
Update
For the sake of a more informative answer, the two core classes that come with the helper()
function are Mage_Core_Model_Layout
and Mage_Core_Block_Abstract
. If you are inside of a class that extends either of these you will be able to use $this->helper()
. Otherwise you would need to call the global Mage::helper()
.
answered 1 hour ago
rain2orain2o
1416
1416
Changed, but the error did not disappear
– Рома Лытарь
1 hour ago
Please be sure all cache is cleared/disabled. If you made this change the error message should have changed or gone away. What is the new error message?
– rain2o
1 hour ago
Cache cleared, all the same error
– Рома Лытарь
1 hour ago
The compiler reassembled, the error disappeared, but now the function displays nothing (
– Рома Лытарь
1 hour ago
Sounds like the error is resolved then, but you have another issue now. At this point I would check each of the pieces ingetName
to make sure they are getting a value. My guess is$name
isn't getting a value.
– rain2o
1 hour ago
|
show 1 more comment
Changed, but the error did not disappear
– Рома Лытарь
1 hour ago
Please be sure all cache is cleared/disabled. If you made this change the error message should have changed or gone away. What is the new error message?
– rain2o
1 hour ago
Cache cleared, all the same error
– Рома Лытарь
1 hour ago
The compiler reassembled, the error disappeared, but now the function displays nothing (
– Рома Лытарь
1 hour ago
Sounds like the error is resolved then, but you have another issue now. At this point I would check each of the pieces ingetName
to make sure they are getting a value. My guess is$name
isn't getting a value.
– rain2o
1 hour ago
Changed, but the error did not disappear
– Рома Лытарь
1 hour ago
Changed, but the error did not disappear
– Рома Лытарь
1 hour ago
Please be sure all cache is cleared/disabled. If you made this change the error message should have changed or gone away. What is the new error message?
– rain2o
1 hour ago
Please be sure all cache is cleared/disabled. If you made this change the error message should have changed or gone away. What is the new error message?
– rain2o
1 hour ago
Cache cleared, all the same error
– Рома Лытарь
1 hour ago
Cache cleared, all the same error
– Рома Лытарь
1 hour ago
The compiler reassembled, the error disappeared, but now the function displays nothing (
– Рома Лытарь
1 hour ago
The compiler reassembled, the error disappeared, but now the function displays nothing (
– Рома Лытарь
1 hour ago
Sounds like the error is resolved then, but you have another issue now. At this point I would check each of the pieces in
getName
to make sure they are getting a value. My guess is $name
isn't getting a value.– rain2o
1 hour ago
Sounds like the error is resolved then, but you have another issue now. At this point I would check each of the pieces in
getName
to make sure they are getting a value. My guess is $name
isn't getting a value.– rain2o
1 hour ago
|
show 1 more comment
Рома Лытарь is a new contributor. Be nice, and check out our Code of Conduct.
Рома Лытарь is a new contributor. Be nice, and check out our Code of Conduct.
Рома Лытарь is a new contributor. Be nice, and check out our Code of Conduct.
Рома Лытарь 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%2f263516%2fhow-to-fix-an-error-in-helper-data-php%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
Have you declare helper in etc/config.xml?
– Saphal Jha
1 hour ago