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
0
votes
2answers
46 views

Magento 2 - Adding Class to individual Navigation Items on Account Page

I need to add a class to each of these navigation items on the Account page. The file containing the navigation wrapper can be found at (vendor\magento\module-customer\view\frontend\templates\account\...
0
votes
2answers
41 views

Magento 2 - Add Class to ReferenceBlock

I need to add a new class to a referenceBlock, specifically the nav items in the Account Page. <referenceBlock name="customer-account-navigation-account-link"> <arguments> ...
3
votes
1answer
901 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
1answer
33 views

How to solve class not found error in magento 1.9?

I have try to install stamped.io extension, after install back-end showing following error if i click stamped.io setting. Fatal error: Uncaught Error: Class '...
1
vote
1answer
824 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 ...
4
votes
1answer
108 views

Magento 2: Add active class on selected shipping method

I want to add active class When I select a shipping method on the checkout page. For example: If I select free shipping then active class should be added on radio button which is free shipping. ...
15
votes
1answer
8k views

DI & Extending a Block on Magento 2

I seem to be struggling to grasp Magento 2 dependency injection with blocks, every time I try to extend a block that isn't \Magento\Framework\View\Element\Template I end up with errors. I want to ...
1
vote
1answer
5k 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 ...
4
votes
7answers
9k 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/...
2
votes
4answers
55 views

Get product details by product id in Magento 2

Hi i have a product id 22 . I want to get the product details by this id . in this page default/Magento_Catalog/templates/category/Products.phtml Example : $product=get_product_details(22); I ...
0
votes
0answers
28 views

Class does not exist ReflectionException keeps coming back

We have a Magento 2.1.5 project. We are getting strange errors. At some moment the website works properly and the next day we get an error when we login to the admin. We get the following error: ...
0
votes
1answer
20 views

Error in magento 2.3 Class Does Not Exist in backend and frontend

I upload my magento 2.3 on my server, so when i navigate in the frontend the navbar is disappeared see the photo so when change the mode to developer, to see the error in backend output print this ...
0
votes
0answers
79 views

Magento 2.2.8 : Class Magento\Ui\Block\Wysiwyg\ActiveEditor does not exist

I have updated from version 2.2.7 to 2.2.8 now I have this error Class Magento\Ui\Block\Wysiwyg\ActiveEditor does not exist in the back-end when I try to access for example to Categories page. ...
1
vote
1answer
24 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 *...
1
vote
2answers
19 views

How zend libs file(Rewrite Zend_Pdf_Resource_ImageFactory) class in Magento 2

i am trying to override Zend libs class like magento2 using preference My di.xml code is <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
1answer
18 views

Conceptually speaking, management interfaces are used for what?

For example Magento\Catalog\Api\ProductManagementInterface Magento\Catalog\Api\ProductLinkManagementInterface They are used for very specific tasks?
0
votes
2answers
61 views

Why does magento 2 use hard coded “Factory” class?

As I've checked in Magento 2.3.1 Sales module there is one hardcoded Factory file in below path: vendor/magento/module-sales/Model/ResourceModel/Order/CollectionFactory.php And in Cms module there ...
2
votes
0answers
27 views

Add css class to item on checkout xml

how can i add a css class eg.: class="myClass" to an item on checkout xml? for example <item name="after-place-agreements" xsi:type="array"> <item name="component" xsi:type="string">...
1
vote
2answers
117 views

Declaration of overridden method should be compatible with parent class

This is my custom class: class Collection extends \Magento\CatalogSearch\Model\ResourceModel\Search\Collection { public function _getSelectCountSql($select = null, $resetLeftJoins = true) { $...
0
votes
1answer
99 views

How to disable a single 3rd party module plugin class in Magento 2?

3rd party module has a file in the following location: Amasty/Xsearch/Plugin/Framework/View/Page/Config.php. This file contains a class like this: <?php namespace Amasty\Xsearch\Plugin\...
0
votes
1answer
850 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 ...
0
votes
0answers
28 views

Unable to override model class, only this file has problem

I am overriding Worldpay Model class that create xml request file. <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
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\...
2
votes
1answer
49 views

How to pass data from UI Form to PHP Class

I have created a form using UI component, This form has a select dropdown which displays option related to current entity id if form is in edit mode and all options if a new entity is being added by ...
1
vote
0answers
30 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 ...
0
votes
1answer
309 views

How i can extend more than one class in magento 2? [duplicate]

<?php use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\View\Result\PageFactory; use Magento\Framework\App\RequestInterface; use ...
6
votes
2answers
183 views

Proper way to call a model constant in Magento 1

I have the class below: class Company_Module_Model_Somemodel extends Mage_Core_Model_Abstract { const SOME_CONST = 'constant_text'; } What is the proper and correct way to call the constant ...
0
votes
2answers
465 views

How to use require_once in magento 2

I'm trying to include a PHP class in magento 2. I use a require_once and create a folder lib in the root of my module and there I put the folder that contains the class lib/Meli/Meli.php Also try in ...
0
votes
1answer
99 views

Create custom payment gateway in Magento 2?

Which class we need to extends,implement interface and method use when create a custom payment gateway.
3
votes
0answers
33 views

Can Magento 2 Proxies be used to handle non existing class

I am building an extension which is dependent on multiple third party payment gateways. So I have created a special service class which gives the respective payment gateway class object depending on ...
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
645 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:
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?
1
vote
1answer
126 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" ...
1
vote
0answers
33 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
252 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
40 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
60 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
1answer
109 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
55 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
502 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
68 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\...
1
vote
1answer
259 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://...
1
vote
0answers
565 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 \...
1
vote
1answer
22 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
24 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
56 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....
1
vote
3answers
1k views

Product Page - Add Span Class - Price Symbol

I wish to add a simple span class on the product view page for the price. <span class="price-symbol">$</span> <span class="price">$99.90</span>
0
votes
2answers
57 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, ...
2
votes
1answer
886 views

500 Internal Server Error in store page

I recently updated my Magento from 1.4 to 1.9 and faced with the issue: it gives HTTP-header 500 Internal Server Error, but all the content is still loading (so just instead 200 OK I have 500 Internal ...