Questions tagged [helper]

Denotes question regarding Magento Module Helper

Filter by
Sorted by
Tagged with
0
votes
1answer
29 views

when iam paasing arugment to helper from controller iam getting error magento 2.3

Iam Getting the below error Recoverable Error: Object of class Magento\Framework\App\ObjectManager could not be converted to string in /var/www/html/development/amt/app/code/vendor/...
0
votes
0answers
11 views

Mangeto2: instantiate Helper if exists

I am developing a module and I need to instantiate a helper of another module only if this module exists (is installed). use \Magento\CatalogSearch\Helper\Data as CatalogSearch; use \Magento\...
0
votes
2answers
49 views

In magento2,How to inject helper in collection

I have created a custom grid, in this grid collection I have to inject helper .while injecting helper in the collection it throws error like this Type Error occurred when creating object: My ...
0
votes
2answers
30 views

Unable to override Helper Class in Magento2

I have used below code to override helper class. Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=...
0
votes
3answers
51 views

How can i get phtml file in helper magento 2?

I have tried this solution but it is not working $this->_layout->createBlock('Vendor\Module\Block\Productdesigner'); $response = $layout->setData(array("customer_data" => $result))...
1
vote
1answer
78 views

Magento 2.3 - Swatches Helper override

I'm trying to override a function in the Helper of the Swatches module of Magento 2. The function resides in the Data.php file. As some of you may know in specific versions of Magento 2 the text ...
1
vote
0answers
27 views

How to add handler to \Magento\Catalog\Helper\Output

I'd like to display the unit of measurement after each product attribute with some dimension (mm, g, …). To prevent duplicated code in each PHTML template file that probably displays a product with ...
0
votes
1answer
172 views

Fatal error: Class Helper_Data not found in app\Mage.php

Fatal error: Class 'Mage_Category_Password_Helper_Data' not found in /home/pypub/public_html/app/Mage.php on line 547 I've read this: Fatal error: Class Helper_Data' not found in app\Mage.php but ...
0
votes
0answers
14 views

Fatal error: Uncaught Error: Class 'Amasty_Feed_Helper_Data' not found

Fatal error: Uncaught Error: Class 'Amasty_Feed_Helper_Data' not found in /homepages/18/d784821810/htdocs/app/Mage.php:547 Stack trace: #0 /homepages/18/d784821810/htdocs/includes/src/...
0
votes
1answer
58 views

Override Helper in Magento2 - Vendor\Module\Helper\Data doesn't extends Magento\Framework\App\Helper\AbstractHelper

May be i'm missing something really small. Here is a class Class1 namespace Vendor\Module\Helper; class Class1 extends AbstractHelper { /** @var Client */ private $client; /** @var ...
0
votes
2answers
33 views

Injecting Helper causes “Undefined constant” and “'generated' directory permission is read-only”

When I inject the helper class it gives me the below errors. If I remove the reference to the Helper class in the constructor then everything works perfectly. controller file: /var/www/html/app/code/[...
0
votes
1answer
46 views

Helpers are singleton classes?

Given this code <?php class Vendor_Module_Helper_Data extends Mage_Core_Helper_Abstract { protected $_currentCustomer = null; protected $_settingsHelper = null; public function ...
3
votes
3answers
286 views

Magneto 2 How to call Helper function in observer file

I am new to Magento development and I am using a custom MySQL query in some places like in observer/plugin etc. These codes are repeating for all these files. so I want to make a new reusable ...
1
vote
1answer
144 views

How to implement a method retrieving config value both at store and default scope: Magento 2

In Magento 1, a call to Mage::getStoreConfig('section/group/field') was able to retrieve a config of the current store. Indeed, if we called it from a front block for example, it retrieved the config ...
0
votes
1answer
78 views

Magento 2.3.1 Fatal Error when overriding Helper in Magento Bundle module

In order to override the function getBundleOptions from magento2/vendor/magento/module-bundle/Helper/Catalog/Product/Configuration.php i have implemented the following module: MySpace/MyModule3/etc/...
1
vote
1answer
27 views

Class function not working

I tried to call the class using construct method. <?php namespace Vendor\Module\Helper; class Data extends AbstractHelper { /** * @var \Magento\Framework\App\Config\ScopeConfigInterface *...
0
votes
0answers
27 views

Get configValue in _prepareToRender function of a block

I want to get the configValue of system.xml in this block <?php namespace Module\Vendor\Block\Adminhtml\Menu\Field; use Magento\Config\Block\System\Config\Form\Field\FieldArray\...
2
votes
0answers
42 views

Take value of a field in a block and place it in another field

I have a problem taking values from a system.xml field to show them in another field. This is the system.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
4
votes
1answer
34 views

Is it good practice to get product collections in helper function and calling in phtml file custom module Magento 2

Hi all, i wanted to know either is it good practice to get product collections in helper function and calling that function in phtml file within custom module Magento 2 Because in my case ...
0
votes
2answers
147 views

Uncaught Error: Call to a member function getId() on null in [closed]

I have some problem about this error, who can tell me why? Thank you!! Fatal error: Uncaught Error: Call to a member function getId() on null in
0
votes
0answers
171 views

Magento 2.3 - Custom Payment Method error on install - Type Error occurred when creating object: Magento\Framework\Communication\Config\Data

I want to install a payment module, but i got this error. Magento clean instal. When i run setup:upgrade i got: Running schema recurring...Type Error occurred when creating object: Magento\Framework\...
1
vote
1answer
46 views

Captcha Helper method override not working in Magento2

Need to override method getImgUrl() from vendor\magento\module-captcha\Helper\Data.php but not success app/code/YourCompany/YourModule/etc/di.xml <config xmlns:xsi="http://www.w3.org/2001/...
1
vote
0answers
58 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 ...
7
votes
2answers
81 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
2answers
55 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
2answers
154 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
2answers
193 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
1answer
395 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
1answer
119 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
2answers
79 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
1answer
144 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
2answers
62 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" ...
2
votes
1answer
610 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
1answer
182 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
1answer
69 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
1answer
29 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
0answers
34 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
4answers
673 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
1answer
89 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 ...
9
votes
5answers
7k 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 ...
0
votes
1answer
709 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
1answer
260 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
2answers
114 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
1answer
48 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
1answer
38 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
2answers
782 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
1answer
333 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
1answer
41 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
3answers
1k 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
2answers
46 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
2 3 4 5