Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [helper]

Denotes question regarding Magento Module Helper

1
vote
0answers
24 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 ...
2
votes
0answers
24 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
41 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
72 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
36 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
38 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\...
0
votes
0answers
29 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 ...
1
vote
2answers
28 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
37 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
37 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
46 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
0answers
25 views

Magento 2.2 - Session not working on Helper Class

public function add($productId, $data) { $this->_customerSession->setData('customData', $data); } private function hasData($productId, $side) { return $engraving = $this->...
0
votes
0answers
16 views

Magento 2 I cant able to get the session in Helper function

<?php namespace Sdi\Orders\Helper; use Sdi\Orders\Model\StubFactory; use \Magento\Framework\Module\Dir\Reader; use Magento\Framework\View\Asset\Repository; use Sdi\Orders\Model\EngravingFactory; ...
0
votes
0answers
16 views

How to set the coupon on the specific product using SKU. Magento 2

I followed this code $price = 100; $sku = '24-WG085'; $discount = ($price - (($price + 1) / 2)); $shoppingCartPriceRule = $this->_objectManager->create('Magento\SalesRule\Model\Rule'); $...
0
votes
1answer
23 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
47 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
23 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
23 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
286 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
44 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 ...
0
votes
1answer
245 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 ...
0
votes
0answers
22 views

How to run query subdate(now(), INTERVAL 1 DAY) in Magento Helper

in Magento 1.9 Community, I have this query created_at >= subdate(now(), INTERVAL 1 DAY) Group By product_id order By sum(qty_ordered) desc How do I do this in Helper/Data.php? Currently this is ...
0
votes
0answers
24 views

getting error after run compilation magento 1!

I am getting below error after run compilation process on the website: Fatal error: Uncaught Error: Class 'Mage_ThemeOptionsBizarre_Helper_Data' not found in /var/www/example/app/Mage.php:547 ...
1
vote
1answer
74 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
0answers
120 views

Display notification/error message in frontend from a helper override

I have created a custom module for restrct one cms page access in few conditions. If the page is restricted, then I want to redirect the page to home page and display one message. My code is ...
0
votes
2answers
69 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
23 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
37 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
1answer
344 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
172 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
33 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
282 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
43 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
2answers
195 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
1answer
249 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
1answer
54 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
1answer
61 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: ...
1
vote
4answers
891 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
1answer
190 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
1answer
73 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
2answers
26 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
1answer
21 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
1answer
720 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 ...
0
votes
3answers
600 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
1answer
207 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
1answer
648 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
1answer
253 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
1answer
30 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
2answers
150 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
0answers
21 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 ...