Questions tagged [helper]

Denotes question regarding Magento Module Helper

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

Magento Module - PHTML

I need some help with a problem I have with a module, I know this is a newbie question but here i go. <div class="field company <?= $block->isrequiered() ? 'required' : '' ?>">...
2
votes
1answer
122 views

Magento 2 - Load values in di.xml from a helper class

Currently the template is defined like this: Company/PdfDesign/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
2answers
27 views

How to extend this file app/code/Magedelight/SMSNotification/Helper/Data.php in Magento 2

I want to extend app/code/Magedelight/SMSNotification/Helper/Data.php this file in my custom module. I have created a module. My di.xml file app/code/Hl/Smsnotification/etc/di.xml <?xml version=&...
0
votes
1answer
42 views

How to get value for Number of Lines in a Street Address that have been set in magento 2 configuration

I am using Magento 2.3.5-p2 I know that in Magento 2, the Street address configuration is not able to be changed through admin by going to Stores > Settings > Configuration > Customers > ...
0
votes
2answers
103 views

Magento 2.3 to 2.3.6 - help - urgent

I just updated my Magento instalation from 2.3.3 to 2.3.6. PHP version 7.3 Everything seamed to fine except when I do reindex. I get this error: PHP Fatal error: Uncaught Error: Cannot instantiate ...
0
votes
1answer
312 views

How to add country code dynamically in telephone field on Checkout in Magento 2

I want to develop custom module that is used for adding country code field before telephone field on checkout page in magento 2.3.4.
0
votes
0answers
37 views

How to write google business review API in custom module and call into phtml file

What is the best approach to write google business review API in custom module and call inside the custom phtml file, Eg Code: <?php $accountId = 'your_account_id'; $locationId = 'your_location_id'...
0
votes
2answers
37 views

How to used same code in helper data in magento 2?

Here is my object manager code can any one guide me how can i used same code in my helper data $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customOptions = $objectManager ...
0
votes
1answer
29 views

Get dropdown value in helper file?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); /** @var \Magento\Eav\Api\AttributeOptionManagementInterface $attributeOptions */ $attributeOptionsManagement = $...
2
votes
2answers
236 views

Get current page title in observer (Magento 2)

Is their any way we can get current page title in magento 2 ?
0
votes
1answer
408 views

How To 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 minicart and i want to show the product Qty as Dropdown and get value from Helperdata. Any help would be ...
3
votes
1answer
148 views

Is it okay to use $this->helper(...) in phtml files?

A question on using $this->helper(...) in phtml files: It returns something like this: ObjectManager->get(...) (Singleton) I'm aware it's bad practice to use Object Manager phtml, but ...
0
votes
1answer
63 views

Override a helper using Plugin

I have been trying to use plugin to override Magento\Sales\Helper\Reorder.php. I have added a comment inside the code what I would like to change. /** * Check is it possible to reorder * ...
1
vote
0answers
18 views

fatal error: bms_class_helper_data not found

I created a custom module and its gives a error "fatal error: bms_class_helper_data not found " after that i removed the complete module, layout file and data enabler file and database, but ...
1
vote
2answers
58 views

"Fatal error: Class 'Mage_Outgoing_Form_Helper_Data' not found in /var/www/html/app/Mage.php on line 547"

I am getting error "Fatal error: Class 'Mage_Outgoing_Form_Helper_Data' not found in /var/www/html/app/Mage.php on line 547" Even i removed module,layout file and module enabler file and i ...
0
votes
1answer
423 views

Uncaught Error: Using $this when not in object context

I am going through an older module created in PHP 5.x.x and we have just moved the website to the php 7.2.x so we suddenly got the error in a helper class Uncaught Error: Using $this when not in ...
1
vote
1answer
354 views

Get userid of the admin logged in magento 2 helper

Trying to get admin user id in Magento 2 helper, in new at magento 2 any help will be appreciated.
0
votes
2answers
53 views

Issue in extending a model magento 2

I want to extend the Magento\ConfigurableProduct\Helper\Product\Options\Loader as per this github issue https://github.com/magento/magento2/issues/21663#issuecomment-477966963 My di.xml file is <?...
0
votes
3answers
145 views

Magento 2 - "Undefined constant 'Product\SizeChart\Helper\Data'" while using helper

If anyone have idea then please share with me. I am going to stuck in this error: Uncaught Error: Undefined constant 'Product\SizeChart\Helper\Data' in /opt/lampp/htdocs/M2/app/code/Product/SizeChart/...
1
vote
0answers
43 views

Magento 2.3 extra whitespace and lines

done a ton of searching, found some similar issues but nothing that could lead me to a solution. I'm running the Magetique theme on Magento 2.3. On my homepage, I have 2 of the Featured Products ...
0
votes
1answer
44 views

Best method to use helper in any template

It seems to be impossible to use a helper in the template Magento_Catalog\templates\product\list\items.phtml. I have tried it via argument injection: app\design\frontend\company\base\Magento_Catalog\...
0
votes
2answers
355 views

Magento 2 - product passed to helper parameter is NULL

I created this helper method: app\code\Company\Base\Helper\Product.php public function test($product = null) { if (!empty($product)) { exit("TRUE, product is not empty!"); } else { return false; ...
0
votes
2answers
28 views

Can't load current product

I try to load the current product in gallery.phtml Helper (app\code\Company\Base\Helper\Data.php): ... use \Magento\Catalog\Helper\Data as CatalogHelper; class Data extends \Magento\Framework\App\...
0
votes
1answer
43 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
2answers
131 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
295 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
92 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
436 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
1answer
265 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
921 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
1answer
487 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
324 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
229 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
1k 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
711 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
241 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
72 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 *...
2
votes
0answers
63 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
132 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
1k 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
1
vote
1answer
114 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
128 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
2answers
246 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
70 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
584 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
920 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
1k 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
645 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
238 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
383 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/...

1
2 3 4 5 6