Stack Exchange Network

Stack Exchange network consists of 174 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 [class]

The tag has no usage guidance.

0
votes
1answer
101 views

Getting Fatal error: Class 'IntlDateFormatter' not found in Magento2 [duplicate]

I am getting Fatal error Class 'IntlDateFormatter' not found in /home/sanjeevkahali/public_html/sanjeev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111:
0
votes
1answer
31 views

Magento 2 | How to include a class from a seperate PHP File

I'm currently coding a module and I got a PHP File which has nothing to do with Magento. This is my structure: - My --- Module ---- Observer ------- MediabaseObserver.php ------- vuxml.php I want ...
1
vote
1answer
25 views

Magento 2 - How to get class file from event name observer on stripe payment module

I got this event observer code in the stripe payment module <event name="payment_method_assign_data_stripecreditcards"> <observer name="stripecreditcards_payment_gateway_data_assign" ...
0
votes
0answers
9 views

Magento 2 - How to add selected class in compare link if it's already in compare list

I want to display compare link like the checkbox in the product list page. See the above screenshot. So just I want to add a selected class in compare link if this product already in compare list.
1
vote
0answers
22 views

Magento 2 - How to add video icon in dot if the gallery has video?

I want to add video-icon class in dot if the gallery has video.
1
vote
1answer
57 views

After upgrading Magento2.2.3 to Magento 2.2.5 getting Error

After upgrading Magento2.2.3 to Magento 2.2.5 below getting Error Fatal error: Cannot use Magento\Sales\Model\Order as Order because the name is already in use in D:\Projects\xampp\htdocs\project\...
0
votes
1answer
28 views

RewardspointsFactory class does not exist

Please anyone review my code. Facing this error. Exception #0 (ReflectionException): Class Sugarcode\Test\Model\ResourceModel\Test\RewardspointsFactory does not exist Exception #1 (ReflectionException)...
1
vote
1answer
29 views

Overwrite function of Magento Core Class without having to develope extension

I try to overwrite a function from a core class without having to create an extra extension for it. I need to overwrite the function _loginPostRedirect() from Mage_Customer_AccountController to ...
2
votes
2answers
90 views

Difference between declare class in : “__construct” and in the top of file with “use” [duplicate]

Anyone have idea about declare class in __construct and declare class in top of file with use. Exemple: use Magento\Store\Model\StoreManagerInterface; and public function __construct( \...
1
vote
1answer
20 views

Magento 2 Add Record to Custom Table

I am building a module that requires a custom table and insert. I have created a controller to test the insert, but I am getting an error. Here is what I have and the error: Veratad/...
3
votes
1answer
144 views

Magento 2: How to validate the cart rules?

I need to develop a function in the cart rules. Basically it is to check the amount that is added in the cart and apply a fixed price to the product. I have in mind how to apply the logic. But I ...
0
votes
1answer
36 views

Magento 2.2.2 - Class not found in Factory

Namespace/Modulename/Model/WebService/ClientFactory.php <?php namespace Namespace\Modulename\Model\WebService; use Magento\Framework\ObjectManagerInterface; use Namespace\Modulename\Model\...
0
votes
2answers
807 views

Fatal error: Cannot declare class , because the name is already in use

Fatal error: Cannot declare class Vendor\Modelname\ResourceModel\Doccount, because the name is already in use in /var/www/html/readyresale/app/code/Vendor\Modelname/Model/ResourceModel/Doccount.php on ...
1
vote
1answer
105 views

Magento 2.2.4 - Couldn't override block class

I am trying to override the Magento\ConfigurableProduct\Block\Product\View\Type\Configurable class. I have added a preference in app/code/vendor/module/etc/di.xml file. <config xmlns:xsi="http://...
0
votes
0answers
15 views

Total number of transaction not equal to total number of orders

I fetched all the transaction details using modelclass: sales/order_payment_transaction but my number of transactions are not close to Magento orders. What can be the problem or am I fetching it using ...
1
vote
1answer
19 views

Extends Dashboard customer for telephone number

I'm trying to extend Magento\Customer\Block\Account\Dashboard\Info.php file. I created a module, where I have my custom block, Info.php. I want to display the telephone number of the customer after. ...
0
votes
0answers
128 views

How to override layout block class for specific product

I am using "Extension #1" which has in its layout code: <block class="MagicToolbox\MagicZoomPlus\Block\Product\Renderer\Configurable" name="product.info.options.swatches" as="swatch_options" ...
0
votes
0answers
21 views

How can we apply custom class for landing page and product page?

How can we apply custom class for landing page and product page? Ex: i want 100% width on landing page and custom width on product page
0
votes
1answer
44 views

Extending Adminhtml blocks class _prepareCollection

I am trying to override a adminhtml block and I created all files accordingly. The problem is that it does not have any effect. My files are as follows: app/code/local/Grando/Groupfilter/etc/config....
0
votes
2answers
40 views

Modify Magento2 module php class

I have to add a work around fix for a payment method by adding a line of code to vendor/magento/module-payment/Helper/Data.php. I've tried my fix by adding it directly to that file and it's working, ...
0
votes
0answers
44 views

Magento 2 : checkout error copy does not exist

Al momento de hacer el checkout la pagina de luma me muestra esto: Cuando me voy a los logs especificamente en exception que es a donde me envia me aparece esta linea de error: [2018-06-06 16:57:...
4
votes
0answers
108 views

Problem with block override in Magento 2

Note: Before marking the question as duplicate or off-topic, please read the question carefully. Scenario: I have to show custom column in the admin grid of a custom extension. So I used override ...
0
votes
1answer
41 views

Magento2 extend a class from SalesRule module

I'm using magento 2.2 and I'm trying to extend a class, more exactly this one: \Magento\SalesRule\Model\Utility And I'm facing an error: Declaration of MagePal\CouponCodeExtraValidation\Model\...
2
votes
3answers
186 views

Class 'Ebizmarts_MailChimp_Helper_Data' not found

When I extracted the mailchimp extension in root folder. I came across this error Class 'Ebizmarts_MailChimp_Helper_Data' not found in /home/occasion/public_html/occasionwearforkids.com.au/app/...
0
votes
1answer
67 views

Load custom block content inside class

I have a module in which a protected variable is defined as follows: protected $stores = array('a','b', 'c', 'd'); I want to load define this variable inside a custom block so I am trying to do this:...
0
votes
0answers
4 views

Giving a CSS class name to the blocks created through the admin panel — Magento 2

If it possible to assign a CSS class name or any similar identifier to one of the blocks on a page, that is made through the Admin panel? For more description on what I am trying to achieve, I have ...
1
vote
1answer
28 views

When to extends Magento Framework Action

I have seen a sample module with a class like following. My question is: 1) Why do it need to extends \Magento\Framework\App\Action\Action since $context is not used in execute? 2) Why parent::...
0
votes
0answers
20 views

Adding category to body element on product page

I can find examples of how to display the current product category through using the Object Manager, and I have found ways of adding a class to the body element via the XML. Is there a way to combine ...
3
votes
1answer
801 views

Magento 2 : add custom class on checkout page shipping address field

I am using magento 2.1.7. I want to add one class in country select box on checkout page shipping address. If anyone knows please help to add class.
0
votes
1answer
495 views

Magento 2: Override product image JPG quality

Magento 2.2.1 with custom theme which inherits from Magento/blank. Attempting to fix the JPG compression for product images. I know, based on this solution, that I must extend the Image class found ...
0
votes
0answers
13 views

Can class names in custom modules be named after module name instead of path?

I'm a little confused by how the file and naming system works in Magento 2... let's say my module name is Itsybitsy_Spider and the path to it is app/code/Hakuna/Matata. Magento recognizes the module ...
1
vote
3answers
50 views

How to load 1587 classes from single file in magento 2?

I'm integrating Magento 2 with NetSuite CRM. I'm following this GitHub doc I want all of the services provided in there There are 3 files 1. NSconfig.php 2. NSPHPClient.php 3. NetSuiteService....
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 ...
2
votes
1answer
309 views

What should we use instead of the Magento\Checkout\Model\Cart model?

The Magento\Checkout\Model\Cart class was marked as deprecated a long time ago (since 2.1 ver.). What should I use instead of it to work with a customers cart? I know that I can work directly with a ...
0
votes
2answers
126 views

Magento 2 Module development Class does not exist error

I am trying to develop a Magento 2 module following a number of tutorials and a lot of Google searching. I am also following a couple of Packt Publishing books and I am getting confused with an error ...
0
votes
1answer
445 views

Class not found even exist on Magento 2

I have a custom module and i tried to extend this class in my Image.php file: Magento\Framework\Data\Form\Element\Image namespace Vendor\Namespace\Block\Adminhtml\Form\Element; class Image extends ...
0
votes
4answers
82 views

Magento 2 Class

i'm trying to convert a module from Prestashop to Magento 2 but i have a problem with the class. I'm following several tutorial and my whole module is based on the administration part of the website. ...
2
votes
6answers
5k views

Magento 2 custom layout add body class

I create custom page layout. In admin area select this layout: Amin -> Products -> Categories -> MyCategory -> Design -> Layout Q: How add css class to body tag? My file: app/design/frontend/...
1
vote
3answers
7k 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
709 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....
0
votes
0answers
322 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
624 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
76 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
430 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
555 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
56 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
0answers
511 views

Magento2 Set Customer Account Link Active (custom links)

I have created few links in customer account section. But the issue is current pages link is not active. How can I do it? Here is code customer_account.xml <page xmlns:xsi="http://www.w3.org/2001/...
0
votes
2answers
227 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
55 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
794 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 ...