The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [class]

A template for creating new objects that describes the common state(s) and behavior(s). NOT TO BE CONFUSED WITH CSS CLASSES. Use [css] instead.

Filter by
Sorted by
Tagged with
2
votes
3answers
10k views

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

Please help me guys to fix it : Fatal error: Class 'Mage_Parcelamento_Helper_Data' not found in C:\wamp64\www\magento\app\Mage.php on line 547 Error log Warning: include(Mage\Parcelamento\...
0
votes
1answer
1k views

Include custom module block within phtml file?

I've created a custom module for a distributor search with a php class/block inside. Module Structure: - /Distributor Search - /Block - DistributorSearch.php - /etc - module....
1
vote
0answers
519 views

Compile: Extra parameters passed to parent construct: $context

This has been asked a few times I know and I studied all of them and I also get the ieda what went wrong. However I cannot adapt those solutions to my issue. I have a Class Post which extends \...
3
votes
1answer
862 views

Magento2 rewrite: product resource collection class does not effect on functions

I have rewrite catalog product resource collection Magento\Catalog\Model\ResourceModel\Product\Collection. Class override successfully but functions override is not working. Suppose, i want ...
0
votes
2answers
112 views

How to define methods inside of Plugin in Magento 2

I try to overwrite get_url() function located in item.php from this path \vendor\magento\module-catalog\Model\Layer\Filter\Item.php For this, i created a PLUGIN, and my code it's this one: <?php ...
2
votes
2answers
499 views

how to override any .phtml or class file in magento2 using custom module?

Well I have an idea to create custom module in magento2 but when it comes to override code functionality I stucks. for example I have to override this file default.phtml in /vendor/magento/module-...
0
votes
1answer
806 views

Magento 2 Class Catalog\Model\Product\Attribute\Backend\Media does not exist

When trying to edit or add a new product on the backend I receive the following error Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist. It stops me from editing or adding ...
1
vote
0answers
71 views

Mangeto 2: How to override core abstract class function? [duplicate]

Magento 2: How to Override Abstract Class for Product Category Indexing Issue? I need to override below files one function only magento\vendor\magento\module-catalog\Model\Indexer\Category\Product\...
0
votes
2answers
369 views

Magento2 - how to know when what parameter i have to pass in controller - _construct function

i was reading a book magento2 tutorial. When learning how to create module. 2 augments was receiving in _construct function of controller. Actually i am talking about this 2 \Magento\Framework\App\...
0
votes
1answer
69 views

Error when trying to ban url with Varnish Cache

I've updated the EcomDev_Varnish module to it's latest version and it seems I've gotten everything properly running, but as a test I tried following command: php ecomdev-varnish.php cache:ban -v ...
2
votes
1answer
1k views

Dynamically instanciate class with arguments

I am actually trying to instanciate a class dynamically with these arguments. Here is the code I use in class A: /** @var string $source */ $source = '\Foo\Bar\My\Class'; // Dynamic value that I ...
1
vote
2answers
541 views

Magento2 - Change “LINKS” CSS class in footer

I would like to change the div class "links" to something like "footerlinks", so if I change the css only the footer links are affected and not all divs with "links" as a class. Below you can see ...
1
vote
2answers
34 views

Class Mage_Facebookilike_Helper_Data not found

When i click magento adminpenal's system>configuration The Error will caused..... Fatal error: Class 'Mage_Facebookilike_Helper_Data' not found in C:\xampp\htdocs\magento\app\Mage.php on line ...
1
vote
2answers
219 views

Extend Mage_Core_Model_Email_Template_Filter

I am trying to extend Mage_Core_Model_Email_Template_Filter class to add translate directive but I can't make it work. Here my module: app/code/local/Company/Module/etc/config.xml <config> ...
0
votes
1answer
123 views

static block (created via admin panel) the same as a php Block class in a module?

Magento 2 related Question. Is a block(CMS Static Block) which I create via the Admin Panl, the same as a block which I created programatically in a module (app/code/Vendor/Module1/Block/Bla.php) ? ...
0
votes
1answer
28 views

Added function to class core not returning anything

I want add a function to the core class. To do this I have added a file to extend the class core but when I call the function it's returning nothing.
1
vote
0answers
38 views

magento 2 : Equivalent class for Adapter Product and Parser abstract

What is the equivalent class for the same in Magento2 Mage_Catalog_Model_Convert_Adapter_Product Mage_Eav_Model_Convert_Parser_Abstract
1
vote
1answer
51 views

Equivalent class for /Mage/CatalogSearch/Model/Layer.php in Magento2

What is the equivalent class for /Mage/CatalogSearch/Model/Layer.php in magento2
0
votes
1answer
2k views

Use custom classes in Magento 2 controller

I'm migrating my module from Magento 1 to Magento 2, some code is no longer working. Instantiating the class doesn't work anymore, is there a different way to do it in Magento 2? include("...
1
vote
2answers
194 views

how to get Agreement in my custom class

I am trying to recover the termes and conditions in my class but without success. Here is my class : class Bvr extends \Magento\Framework\Model\AbstractModel{ public function __construct( \...
2
votes
1answer
7k views

Magento 2 class does not exist error backend

I'm trying to add another field to the customer create form. The following code troughs an error in the backend. The error is: Class Magento\Customer\Model\Metadata\Form\String does not exist or ...
1
vote
1answer
128 views

Mage.php unable to find module class files

We have a Magento 1.9.2.4 site that works perfectly on our development server, but when deployed to production, throws errors that it can't find custom module classes (Mage_Ultimo_Helper_Cssgen is one ...
2
votes
1answer
735 views

Magento 2: Custom function – best place to put it?

I've created a little function for one of my template (.phtml) files which I'd like to re-use in a few other template files. All the function does is concatenate a couple of strings together and trim ...
0
votes
0answers
225 views

Overriding a class : Mage_Catalog_Block_Product_View_Type_Configurable

I want to override Mage_Catalog_Block_Product_View_Type_Configurableclass. I have created one module : Ved_Catalog Here are my module files: Code from config.xml : <config> <global> ...
3
votes
1answer
3k views

Magento 2 Class does not exist error

I am trying to create a custom grid in admin, based on customer collection using ui-component. The problem that I am facing is that I am getting Class does not exist error and magento does not tell ...
1
vote
0answers
43 views

Changes to a .php file not getting compiled

I made some changes to the file app/code/core/Mage/Checkout/Model/Observer.php. However those changes are not reflecting in includes/src/__checkout.php in the Mage_Checkout_Model_Observer class.(After ...
2
votes
1answer
2k views

Magento 2: Update the CSS class name of #maincontent

Is there a way for me to remove the class name 'page-main' from the 'maincontent' div and add a new class name?
6
votes
1answer
5k views

Magento 2: Overriding Block class – not generating output

I'm trying to override the module-catalog/Block/Product/View/Options/Type/Select.php class with a new version which includes a few other bits of custom php (adding HTML classes and IDs to the ...
0
votes
1answer
183 views

Magento 2: New module causing crash

I'm trying to override the module-catalog/Block/Product/View/Options/Type/Select.php class with a new version which includes a few other bits of custom php. I have done the below and then run the php ...
1
vote
1answer
537 views

Magento 2: Updated file not working

I want to update the class Select and its getValuesHTML() method which is saved here: module-catalog/Block/Product/View/Options/Type/Select.php I have made a copy of this file and placed it in my ...
6
votes
2answers
5k views

\Magento\Framework\Registry already exists in context object on compile

when I do compile I do get the following error which is referencing my custom module Blocks, class Incorrect dependency in class ... \Magento\Framework\Registry already exists in context ...
0
votes
1answer
220 views

Extending class not working unless you copy all methods

In my module I want to overwrite the method public function collect(Mage_Sales_Model_Quote_Address $address) in Mage_Sales_Model_Quote_Address_Total_Abstract. If I copy only that method in my class: ...
1
vote
1answer
82 views

How to inject dependencies on class extend

can somebody explain when I extend another Block what is the way to inject dependencies? For example my Block is extending ListProduct
1
vote
0answers
83 views

How to instantiate my new class and methods

I'm looking to trigger anything on a /admin/customer/edit just to know it's working.. an echo or print.. I have this code below. app/code/community/YourModule/etc/config.xml <global> <...
1
vote
1answer
806 views

Magento model extension experiment, return: “class does not exist”

trying to create a new model class to be used as a source model for the admin configuration setting of a new module, I got the following message: Class Makke\GroupOrders\Model\Config\Source\Sort ...
3
votes
1answer
5k views

Where are class constructor parameters defined in Magento2?

If you see AbstractExpress class for PayPal payment method, you could see: /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @...
1
vote
1answer
200 views

Class 'Mage_Catalog_Block_Product_Mostviewed' not found

i am trying to display most viewed products on homepage. getting following error. class Mage_Catalog_Block_Product_Mostviewed extends Mage_Catalog_Block_Product_Abstract { public function __construct(...
2
votes
2answers
2k views

Update Const template at Magento 2 Class

I need to update a template defined in a Constant at Configurable Class(Magento/Swatches/Block/Product/Renderer/Configurable.php). I tried with a Plugin, but how the function which gets the constant ...
19
votes
2answers
5k views

What is __construct and _construct in magento2?

In Magento 2, most of classes have these two constructs (__construct and _construct) methods. What is the difference between them?
2
votes
1answer
132 views

Magento Top Links Login class disappears randomly!

So I have slightly modified the customer.xml file to add classes to the top links, so I could add font awesome icons to them. The issue I am having is for some reason the login class disappears if I ...
0
votes
1answer
150 views

1.9 Related rewrite being ignored

I'm struggling with the following thing. Because I would like to write my own kind of filter for Related Products, I will have to rewrite the class "Mage_Catalog_Block_Product_List_Related". While ...
1
vote
1answer
34 views

Where do you place common methods that you use throughout your module

I have a method that is going to be called in multiple files in my module: public function getStore(){ $order = Mage::registry('current_order'); $store_id = $order->...
1
vote
2answers
41 views

Help writing an observer the “Magento Way”

Fairly new to objected oriented programming and very new to Magento programming, but trying to learn the "right way". I'm writing a before save observer to update product attributes based on other ...
4
votes
2answers
3k views

What does Mage:: correspond to?

I just had one of those moments where I realized I don't understand something. What does the Mage part in say Mage::helper or Mage::log represent? There is no class Mage{ .. } in Magento. Thanks ...
0
votes
1answer
83 views

access parent class on class overwrites in magento, from a sibling

It is required to overwrite customer_resource class. I added required config.xml options for resource rewriting, but when overwritten class method calls parent class method from itself, it actually ...
0
votes
0answers
143 views

Can't change Customer's Customer Tax Class

I have this weird problem where I can't change a customer's Customer Tax Class through the admin interface. It keeps jumping back to Retail customer. So when I select a different Customer Tax Class ...
0
votes
1answer
169 views

Extending Plugin Model - Magento + Wordpress

I haven't created a Magento module before and after a lot of research I attempted to create a module to insert wordpress avatars into blog posts inside Magento (I am using Fishpig). Below I will list ...
0
votes
0answers
445 views

How to Fetch Product child Function Outside External file in Magento

I want to fetch all child function of magento outside of it.I have CORE_PHP with some jquery functionality and php function,In that Files,I need to add Product Children Function of magento into that ...
0
votes
3answers
73 views

Problem modifying core function - class is not called

I apologize in advance for this question has been treated many times, but I think I just need a personal trainer on this! I am trying to modify the function sendPasswordResetConfirmationEmail in Mage/...
0
votes
1answer
705 views

Add category id to product item class

Is it possible to add the category ids of a product into the html class of the product item itself? For example: let's say I do have 3 categories, catID: 20, ID: 21 and ID: 22. For each product I ...