Questions tagged [abstract-class]
General questions on the Magento Abstract Class.
27
questions
1
vote
1
answer
88
views
Error: Cannot instantiate interface Magento\Catalog\Model\Layer\ContextInterface Magento Plugin
I've created a plugin in Magento 2.4.5 to overwrite Magento\CatalogSearch\Model\Layer\Filter\Price 's method.
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/...
0
votes
1
answer
42
views
How to remove the Deprecated property of __construct from Abstract Class using overriding or any other way
Error
main.ERROR: Deprecated Functionality: Creation of dynamic property
Magiccart\Magicproduct\Controller\Adminhtml\Product\Index\Interceptor::$_resultRedirectFactory
is deprecated in
vendor/...
1
vote
1
answer
57
views
Cannot instantiate abstract class Magento\Framework\Data\Collection\AbstractResource
I am getting this error on my homepage after upgrading my Magento version from 2.4.0 to 2.4.6.
Error: Cannot instantiate abstract class
Magento\Framework\Data\Collection\AbstractResource in
/home/...
0
votes
0
answers
89
views
Magento 2 - override private method in abstract class
Is there a way to override a private method of an abstract class in magento 2?
I need to override the private method correctText of Magento\Sales\Model\Order\Pdf\AbstractPdf
0
votes
2
answers
49
views
Magento 2 : How to override the abstract class [ sender.php] in custom module
I create a custom module to send email to customer and admin separately if i try to override the core file in my custom module its shown error .Error come when i override the [ sender.php ] file in my ...
1
vote
0
answers
238
views
Error After Magento upgrade to 2.4.5-p1
Im getting following error after upgrade to magento2.4.5-p1, while creating new customer account in frontend
Error: Cannot instantiate abstract class Magento\Framework\Model\ResourceModel\...
0
votes
1
answer
1k
views
How to override a controller using Plugin?
I want to override abstact class controller Magento\Sales\Controller\AbstractController\Reorder.php using Plugin.
How can I do that?
di.xml
<?xml version="1.0"?>
<config xmlns:xsi=&...
0
votes
1
answer
245
views
Magento 2.3 override public function in Abstract Class
I need to override the public function getValue(\Magento\Framework\DataObject $object) in the Magento\Eav\Model\Entity\Attribute\Frontend\AbtsractFrontend.
Can anyone tell me how to do it using a ...
1
vote
2
answers
370
views
how to override AbstractCarrierOnline class function in Magento 2
I want to override "proccessAdditionalValidation" function of app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php file in custom module.
Please help me and thanks in advance.
1
vote
1
answer
685
views
Magento 2: Abstract Controller class is not being override
I am trying to override an abstract class vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php using di.xml but it is not working.
I need to do some changes in method protected function ...
1
vote
3
answers
1k
views
Override PrepareTemplate function of Magento\Sales\Model\Order\Email\Sender.php in Magento 2.3
I want to override PrepareTemplate function of Sender.php and have tried to override Sender.php with the help of link Override abstract class but its not working for me.
I have followed the exact ...
2
votes
1
answer
490
views
Override abstract class
I have to override Sender.php which path is Magento\Sales\Model\Order\Email
I try but its not work my code is :
di.xml
<type name="Magento\Sales\Model\Order\Email\Sender">
<plugin ...
1
vote
1
answer
152
views
Difference between core_abstract_delete_after and core_abstract_delete_commit_after events in magento 2
Can anyone please explain to me what is the use of core_abstract_delete_after and core_abstract_delete_commit_after events in magento 2.
For your information, it is declared in (Magento\Framework\...
0
votes
0
answers
213
views
Magento 2 : How to override a Abstract Class? [duplicate]
I made some modification related to magento2 order pdf.
I want to know how to override a abstract class AbstractPdf extends \Magento\Framework\DataObject
0
votes
0
answers
185
views
Magento 1.9.x - How can rewrite Mage_Core_Model_Session_Abstract_Varien class
I am trying to re-write Mage_Core_Model_Session_Abstract_Varien class in my custom module but getting error :
Recoverable Error: Argument 1 passed to Mage_Core_Block_Messages::addMessages() must be ...
0
votes
2
answers
258
views
How to create Single abstract controller to inherit in other controllers
I would like to create a single abstract controller in which i will define my authorization code to check for user validity and want to inherit that controller in my other controllers, so that i don't ...
4
votes
2
answers
4k
views
Magento2 : Remove shipping charge and credit cart type and number from order invoice
I want to remove shipping charge and credit card type and credit card number from order invoice.
please check image:
I have overridden this core file
vendor/magento/module-sales/Model/Order/...
0
votes
0
answers
866
views
Fatal error: FileIterator contains 1 abstract method must therefore be declared abstract or implement the remaining methods
I need to add a custom shipping method. I was fallowging this tutorial: https://www.mageplaza.com/devdocs/magento-2-create-shipping-method/
I am receiving this error:
Fatal error: Class Magento\...
0
votes
1
answer
8k
views
Facing this issue, It contains 1 abstract method and must therefore be declared abstract or implement the remaining method
Facing fatal error given as below.
Fatal error: Class Sugarcode\Test\Model\Total\Fee contains 1 abstract
method and must therefore be declared abstract or implement the
remaining methods
(Magento\...
3
votes
1
answer
6k
views
Fatal error: Class 'Mageplaza\Core\Helper\AbstractData' not found [closed]
Fatal error: Class 'Mageplaza\Core\Helper\AbstractData' not found in
/home/dukaania/public_html/testing2/app/code/Mageplaza/SocialLogin/Helper/Data.php
on line 32
Facing this issue after run ...
0
votes
0
answers
159
views
How to override abstactclass methods in magento2?
I want to override \Magento\ImportExport\Model\Import\Entity\AbstractEntity's method _saveValidatedBunches.
I have tried using preference but it's not working.
Can anyone help me
1
vote
3
answers
856
views
I want to override AbstractTemplate.php of vendor\magento\module-email\Model\
I want to override AbstractTemplate.php of vendor\magento\module-email\Model\ in magento 2.1.12.I want to change getUrl method which are declare in AbstractTemplate.php.How can do it?
1
vote
2
answers
778
views
Magento2 - Get Value of New Column in Tier Price Table
I have added a new column "admin_user" column in catalog_product_entity_tier_price table. This column value needs to come when following method is executed.
$p=$productRepo->get('sample');
$tier=$...
2
votes
1
answer
722
views
Abstract Class - override or rewrite?
I have a custom module for checkout. I want to add some custom code for function _getStepCodes() in app/code/core/Mage/Checkout/Block/Onepage/Abstract.php
I found that abstract functions cannot be ...
1
vote
0
answers
21
views
Magento:Custom code in abstract class [duplicate]
My requirement is to change the order of checkout steps. I have a custom module (Customization with checkout structure) for checkout.
I want to change the function _getStepCodes() in app/code/core/...
6
votes
2
answers
699
views
How to override class which extends Abstract Class
I want to override a class Magento\Catalog\Model\Product\Type\Simple
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:...
38
votes
3
answers
14k
views
Magento 2 - Object manager tries to instantiate Abstract class. ( Fatal error )
Playing around with Magento 2 but run into a problem I can not wrap my head around. The object manager tries to instantiate Abstract class, this gives an Fatal Error. Does someone know what might ...