Questions tagged [helper]
Denotes question regarding Magento Module Helper
262 questions
1
vote
0
answers
306
views
Pass data from Helper Data to Knockout JS file Magento 2
How i can pass helper data to Knockout JS to show it on my html file. Actually i am working on Checkout page and i want to show the name of product owner on checkout summary.
Any help would be ...
8
votes
2
answers
397
views
Magento 2 - Call phtml in helper
I have found multiple threads related to calling helper function in .phtml.
But I have a case where I need to call phtml file in helper and return HTML.
I have used this code:
//Where $this->...
1
vote
2
answers
177
views
Get product views in Controller
If anyone could help me.
My curent value that I get is '0' in my controller:
foreach($productCollection as $product)
{
$_helper_views =$this->helper_views->getProductCount($...
1
vote
2
answers
1k
views
How to pass store code to custom URL in magento 2
I would like to add store code to a custom URL in Magento 2.3.0
Actually, I want to pass store code to a custom URL in my custom module based on relevant store order.
Let's take an example:
public ...
2
votes
2
answers
2k
views
Get static block content by identifier in helper class?
I am trying to get the content of a static block in a helper class. So far I had no luck. So, how can I get the content of a static block by block identifier in a helper class?
I tried:
$...
1
vote
1
answer
2k
views
Get Product Image custom use Helper and Block in Magento 2
How can I put the below code into the module's files like helper/data.php or block/product.php, and how to use it to call Helper and Block into file.phtml .
$objectManager = \Magento\Framework\App\...
1
vote
2
answers
2k
views
Magento 2 cookie not set when full cache enable
I have created one helper file that get, set and delete cookie.
This helper file I called in observer to set cookie.
The helper file called but cookie not set when full cache enabled.
<?php
...
2
votes
2
answers
357
views
Magento 2 : Call Function From app/code to app/design
Is there any way to call function defined in the app/code/Custom/Module/helpers/HelperClass.php inside the app/design/frontend/Custom/Theme/Magento_Theme/template/html/View.phtml in Magento 2?
I'm ...
0
votes
1
answer
1k
views
'Class' not found error in Magento 2 frontend
This is a screenshot of the error.
My code is
app/code/Prayag/Module/view/frontend/layout/cms_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/...
0
votes
2
answers
166
views
Magento 2 when I click on frontend my account cannot open and it shows error
I am facing this issue.
My XML file is app/code/Prayag/Module/view/frontend/layout/cms_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
3
votes
1
answer
2k
views
Magento 2.2 - Problem with Helper class not found in custom module
I'm creating a payment module and I'm having a curious problem. I started by creating the module inside the app/code/Vendorname/Payment folder for convenience. It is not yet complete, but the system....
0
votes
1
answer
766
views
Cannot call my custom Helper Class. Magento 2
I'm trying to call my custom Helper class in Controller but when I call the function of my helper in Controller it gives me Fatal error: Uncaught Error: Call to undefined method Magento\Backend\Helper\...
1
vote
1
answer
260
views
How to apply Coupon on the Specific Products in Magento 2?
I want to apply the coupon on the specific product I tried:
use Magento\SalesRule\Model\Rule;
public function __construct(
\Magento\Framework\App\Helper\Context $helpercontext,
Rule $rule,
)...
1
vote
1
answer
43
views
Set Coupen for specific Products. Magento 2
I create the coupon function in Helper which is
public function setCoupon()
{
// $this->_state->setAreaCode('adminhtml');
// $this->_state->setAreaCode('frontend'); ...
1
vote
0
answers
49
views
Magento 2.3.0 - Class MailCampaigns\Connector\Helper\MailCampaigns_API does not exist [closed]
I installed the module (https://github.com/mailcampaigns/Magento2Connector) On my Magento (2.3.0 version) application.
It installed successfully but when I try to add a product to the cart.
It's ...
5
votes
4
answers
2k
views
Magento 2 : Call Helper Without Using __construct in Own Module
I have created a new module and override the
\Magento\Catalog\Block\Product\View\Description
function using preference.
In this module we create new helper located in
Custom_Hello/Helper/Data....
2
votes
1
answer
193
views
Call to helper of module not change the Mage_ prexif by my module prefix
I have changed my etc/system.xml and my etc/config.xml with the structure which should replace the Mage_JaviNewListProductController_Helper_Data by Lecasa_JaviNewListProductController_Helper_Data.
I ...
10
votes
5
answers
12k
views
SodiumChachaIetf::decrypt() must be of the type string, boolean
I did migration Magento 1 to Magento 2.3.0 all is good but when I create customer form both of side (front and admin) I got the error related to decrypt even I can not edit the customer when I click ...
1
vote
1
answer
2k
views
How to call helper function observer in magento2
I am trying to call helper function on observer custom module in Magento2 but Unable to call helper in observer.
Please help me if anybody have this solution. I am waiting for all your positive ...
1
vote
1
answer
1k
views
Magento 2 How to add new address in 'customer_address_entity' from helper?
I am using helper data function to add the new address in customer_address_entity but it is not working. code as below :
<?php
namespace Name\Module\Helper;
use \Magento\Framework\App\Helper\...
0
votes
2
answers
201
views
Solving helper rewrite conflict. Three modules conflicted on payment/data helper.
I have a problem where a newly installed module is not working due to a conflict.
The result of n98-magerun dev:module:rewrite:conflicts:
How would I solve this problem? Is there any particular way ...
0
votes
1
answer
245
views
Where and what is the best way to create utility function in Magento?
I would like to ask for example I have a function doSomething() which will be used by one or more other files, where is the best place to put it?
As of now, I put everything in Data.php (helper class)...
0
votes
1
answer
40
views
Does initializing a helper variable before using it multiple times benefits performance?
I wonder if it is better to write:
$lesser2000 = Mage::helper('wr_epo')->getFensterbankTill2000mm($quote);
$higher2000 = Mage::helper('wr_epo')->getFensterbankHigherThen2000mm($quote);
...
2
votes
2
answers
2k
views
Magento 2 : How to get current product programmatically in a helper?
Could someone advise what's the best way to get the current product in a custom helper? Basically if I am a product page I need to get it's sku
0
votes
1
answer
672
views
Calling helper functions from within cron job file
I am trying to run tests on helper functions, so I created a cron job to test them. I have already verified that the cronjob itself is set up correctly (it is running when I have simple logging ...
2
votes
1
answer
115
views
Translator not working on helper class
I try to translate a text in a function inside sales_helper_data with this code $this->__('TEXT') but it just returns the same input string.
I Also tried Mage::helper('sales')->__("TEXT"), Mage:...
0
votes
3
answers
3k
views
Magento 1.9 problem call Helper
My Config.xml
<?xml version="1.0"?> <config>
<modules>
<MyCompany_MyModule>
<version>1.0.0</version>
</MyCompany_MyModule&...
0
votes
2
answers
64
views
Get current customer collection in custom account navigation link
I have created the custom link in customer account left navigation. I am successfully created it.
I am trying to get current customer Data in template file. I am getting 500 server error. Below is ...
1
vote
2
answers
785
views
Magento2 - accessing helper in controller
I have helper class that has constructor that takes following parameters: Context, Cart, Session, CollectionFactory. It derives from \Magento\Framework\App\Helper\AbstractHelper.
I would like to use ...
0
votes
1
answer
808
views
How to call controller action from helper?
Is it possible to call my controller action from a helper?
I have a controller action in app\code\local\Fekete\Newsletter2Go\controllers\IndexController.php
public function apiAction()
{
echo "...
0
votes
1
answer
408
views
Constant return null (2.2.4)
I'm trying to define constant in an helper of my module :
here's my Data.php :
class Data extends AbstractHelper
{
const base = "my/url";
public function getBase(){
return $...
1
vote
1
answer
358
views
Calling custom constant issue
I have defined a constant in a custom helper in module A. I want to call it an admin method from a custom controller from a custom module B.
This is my custom helper class from module A:
...
2
votes
4
answers
3k
views
Magento 2: call helper function in ui component form
In my form.xml, I have used below code to show input field
<field name="price">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
...
0
votes
1
answer
604
views
Store Specific string from Html Page into PHP variable [duplicate]
i have complete html page, i need to store a specific string value in php variable.
specific value i can only select by css selector. but i have to store it in php variable.
however i can do ...
0
votes
1
answer
162
views
Magento 1.9: Fatal error: Class 'FANCourier_Ship_Helper_Data' not found
Need some help with an error.
I've installed a third party module, it is a shipping module. After I've installed it and I go the shipping methods in the backend, I get this:
Fatal error: Class '...
1
vote
2
answers
39
views
Magento 1.8 - Class 'Mage_Helloworld_Helper_Data' not found
I can't access System -> Configuration in the backend anymore. I get the message Class 'Mage_Helloworld_Helper_Data' not found.
How can I debug this, I am new to magento.
I found a Module named "...
0
votes
1
answer
129
views
Account Link label generated by helper returns escaped html
In a link block I am calling a helper function to return a label with a piece of svg:
<block class="Magento\Customer\Block\Account\Link" name="my-account-link" after="top.links.right.search">
...
0
votes
1
answer
1k
views
Fatal error: Call to a member function getConfigTimezone() on null Magento 2.2
I'm trying to create a helper class that will help me determine If I should present some labels like new/sale etc. I'd like to inject to it a TimezoneInterface via the constructor however $_localeDate ...
1
vote
3
answers
2k
views
How to call helper class in controller magento 2?
I have a helper class with parameter as shown below. I need this function to work on a specific controller. But returns this error. My helper Code below
<?php
namespace Rk\Wallet\Helper;
class ...
1
vote
1
answer
467
views
Get configuration for custom module
I'm trying to get a configuration for my custom module
My Custom module overrides \Magento\Swatches\Block\Product\Renderer\Configurable
With the following Code:
namespace Vendor\swatchExtender\...
2
votes
1
answer
3k
views
Call Helper methods in phtml file Custom Module in Magento 2.x
In /var/www/html/magento2/app/code/Custommodule/ReviewRating/Block/HomehorizontalWidget.php
<?php
namespace Custommodule\ReviewRating\Block;
class HomehorizontalWidget extends \Magento\...
1
vote
1
answer
591
views
Helper function calling issue in magento1
When I call my custom module's helper function in catalog/product/list.phtml file my list page is gonna black.
In phtml :
$helperToday = Mage::helper('today_special/data');
$arr = $helperToday->...
0
votes
1
answer
48
views
Tracking error Mage_Freight_Helper_Data on Editing permission roles
The magento is giving this error when i access index.php/admin/permissions_role/editrole/rid/1/:
Fatal error: Uncaught Error: Class 'Mage_Freight_Helper_Data' not found in ../app/Mage.php:547 Stack ...
1
vote
2
answers
294
views
Strict Notice: Declaration of ::helper() should be compatible with Mage_Core_Block_Abstract::helper($name)
I've been seeing an issue in the Magento system.log relating to the following but I'm a little bit of a novice and not certain how to resolve.
ERR (3): Strict Notice: Declaration of ...
1
vote
0
answers
39
views
How should I deal with multiple classes used in the same algorithm in Magento2?
I have a situation where I am building a module for Magento2 with 3 Models that kind of interact with each other depending on the situation.
I tried to inject the classes withing them selves but that ...
2
votes
1
answer
1k
views
Call block function from helper
I tried to call the block function from my custom module helper like this:
$resultLayout = $this->_resultLayoutFactory->create();
$block = $resultLayout->getLayout()->getBlock('category....
0
votes
2
answers
1k
views
Overriding Helper
I'm trying to override the Helper_Data of a thirdparty module. But for some reason it wont work.
app/etc/modules/My_CustomModule.xml
<?xml version="1.0"?>
<config>
<modules>
...
0
votes
1
answer
87
views
Magento 1.9 : Class 'Mage_Creditmemoexport_Helper_Data' not found
I am creating a module for exporting Creditmemo data in xml but I am getting following error.
I have checked everything but I am unable to find the bug please help me.
Config.xml
<?xml version="1....
1
vote
0
answers
155
views
Send email after 7 days if status is always "pending"
I need help or an explanation to send an email once, to people who do not pay bank transfer or bank check (status pending) after 7 days.
Example: A customer orders today by bank transfer.
If after 7 ...
2
votes
2
answers
908
views
Injected class in helper in Magento 2
I have my helper where I want to implement my override logger.
The logger work perfect outside the helper but I can't make it work inside the helper:
namespace Acme\Module\Helper;
class Data extends ...