Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [interface]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views

Magento 2 : Fail to override interface module

I face problem with extension interface in website. My extension_attributes.xml: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
Matias's user avatar
  • 1
0 votes
1 answer
23 views

Cannot instantiate interface Magento\Payment\Gateway\Config\ValueHandlerPoolInterface?

After updating a shop to 2.4.6-p4, I am getting this error in a custom extension. The Interface file is there, I checked, so it must be some other problem. Any ideas on how to approach this? The full ...
user4095519's user avatar
0 votes
0 answers
27 views

Creating a Custom Helper Class with Coding Best Practices ? Code Review Request

Adobe Commerce ver. 2.4.6-p2, multi-site instance Inheriting code base with numerous custom modules that are not scoped - but need to scope them as individual sites are migrated to new frontend stack ...
emp1211's user avatar
0 votes
2 answers
28 views

Magento 1.9 Fatal error: Interface 'Zend_Session_SaveHandler_Interface' not found

I migrated from a cpanel hosting to plesk hosting, going thru error by error and resolving them. Right now facing a bottleneck when trying to login to admin backend it results in error as below. Fatal ...
joell's user avatar
  • 1
0 votes
0 answers
18 views

Issue with custom extensible entity and getList method from repository

I have a custom extensible entity: interface that extends ExtensibleDataInterface with get and set; model that extends AbstractExtensibleModel with get and set; My GetList method from repository: ...
Dramorian's user avatar
0 votes
1 answer
29 views

Why do some core repositories use a data model in the save function while others use a model?

I have a quick question and this could help me determine what is the good practice using the repositories. To provide an example to the question I ask in the title of this subject, I can take as ...
beluga's user avatar
  • 41
0 votes
0 answers
36 views

Error: Cannot instantiate interface Magento\ReCaptchaWebapiApi\Api\WebapiValidationConfigProviderInterface

I have just upgraded my magento version from 2.4.0 to 2.4.6 and i am getting this issue on checkout shipping page and shiiping methods are not displaying. Error: Cannot instantiate interface Magento\...
Tisha Jhanwar's user avatar
0 votes
1 answer
491 views

How to save data to database using interface repository api

I'm a newbie magento 2 developer. I'm currently learning how to store data to database using repository-interface-model-api approach. My code is not working. model ItemRepository class ...
jsnewbie21's user avatar
2 votes
0 answers
40 views

Magento2.4.5 throws error while di:compile from Inventory module, SourceValidatorInterface not found

I upgraded the magento version from 2.3.6-p1 to 2.4.5-p1 for enterprise edition. While running di:compile, got the following error. Please guide Error: Interface "Magento\InventoryApi\Model\...
Jaisa's user avatar
  • 2,626
1 vote
2 answers
243 views

REST API return JSON object using factory and interface

I am trying to create a simple module to return JSON data, if i returned string or array it will return the targeted data, but i can't return JSON object with key value when i return the interface it ...
Mohamad Zbib's user avatar
0 votes
1 answer
223 views

Where is \Magento\Catalog\Api\Data\ProductExtensionInterface?

In Magento Product class (\Magento\Catalog\Model\Product) there is the function public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensionInterface $extensionAttributes) ...
Tero Lahtinen's user avatar
2 votes
1 answer
1k views

Using Class or Implemented interface is non API on version '2.4.4'

I have generated Upgrade Compatibility Tool Report and most of the errors are as below. [ERROR] [1328] Line 24: Implemented interface 'Magento\Framework\GraphQl\Query\ResolverInterface' that is non ...
Kaushik Kumar Roy's user avatar
0 votes
2 answers
873 views

Magento 2: How to add new method in core interface?

I need to add new method to the core interface so I was checking all the Magento forums and came to know that this can be achieved via extension attributes as like in the post Magento 2 : Override ...
MagentoDev's user avatar
1 vote
1 answer
533 views

Cannot instantiate interface Vendor\ProductImport\Api\Data\ProductImportInterface

I'm working on a command line start of an import process. The process itself is already a custom plugin. It uses a cron job to run the import with some custom rules. Here is my command class: <?php ...
PaulM's user avatar
  • 27
0 votes
1 answer
256 views

how to create customer using custom rest api Magento 2.4.4

I have to create custom rest api for create customer programmatically in Magento-2.4.4. so anyone have an idea then share with me.
Deep Shah's user avatar
  • 561
0 votes
1 answer
481 views

Magento 2: How to override the core interface and add a new constant?

I need to extend the core interface Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface and need to add a new constant but when I override the interface via preference its not working. When I ...
MagentoDev's user avatar
0 votes
1 answer
223 views

Magento2 override core interface without extension Attribute in it [duplicate]

I need to override this interface Magento\Catalog\Api\Data\CategoryTreeInterface I need to add setIncludeInMenu & getIncludeInMenu but there are no extension attributes, how can I achieve this?
Arjun's user avatar
  • 3,586
0 votes
1 answer
238 views

Extending custom interface and data model

I have successfully created a custom interface. My model: app/code/Vendor/Samples/Model/Orders.php class Orders extends \Magento\Framework\Model\AbstractModel implements OrdersInterface { ...
Johndd74's user avatar
0 votes
1 answer
190 views

Use of external library with interfaces - Error: Cannot declare interface, because the name is already in use

I try to use an external library in my Magento2 module. The library is the Amazon MWS-PHP Library. I included the library via composer.json in PSR-0 Format since classnames are in PSR-0 standard (like ...
ulbiopro's user avatar
0 votes
1 answer
161 views

How to override OrderRepositry - save function | API

I need to add some custom functionalities in the Order save function when some API request comes. To be exact need to override the core OrderRepository class vendor/magento/module-sales/Model/...
Sathya's user avatar
  • 518
0 votes
1 answer
2k views

Uncaught Error: Cannot instantiate interface - Filesystem\DriverInterface

Suddenly I started getting following error on Magento 2.3 website, on product listing page, home page and other pages are working fine: <b>Fatal error</b>: Uncaught Error: Cannot ...
NileshPlus91's user avatar
0 votes
1 answer
267 views

How it work Magento\Customer\Api\Data\AddressInterfaceFactory

I am analysising Magento\Customer\Model\Address\AbstractAddress By the way I am facing with $addressDataObject = $this->addressDataFactory->create(); in 567 line $this->addressDataFactory ...
Thomas Peters's user avatar
1 vote
0 answers
192 views

Magento error when calling /rest/all/schema?services=all

When calling http://b2b.localhost/rest/all/schema?services=all on local server I get error: <response> <message>The "OrderItemInterface[]" class doesn't exist and the namespace ...
Paweł's user avatar
  • 11
0 votes
1 answer
419 views

Cron job to delete catalog_product_entity_datetime table data, am I using the correct interface?

I have a query to select data from catalog_product_entity_datetime table. can I use below interface to grab the data from above table? If can't what should I do to grab data from this table? I don't ...
Paul Fan's user avatar
  • 658
0 votes
1 answer
301 views

Override third party module service contract

There is third party custom module. For add entries they used service contract entities. I need to add one more entry. Don't want to touch third party module. How can i extend their interface and ...
Nadim's user avatar
  • 91
1 vote
1 answer
1k views

How can I implement HttpMethod (HttpMethodNameActionInterface) for ActionInterface in a controller?

This class Magento\Framework\App\Action\Action is deprecated: What is the interface to be implemented in the controller action? How should I implement the interface in the controller action? What ...
St3phan's user avatar
  • 2,907
1 vote
0 answers
59 views

How to manage config changes through interface and into version control efficiently

When manipulating config in the interface and wanting to track it into version control, as I see it, there are multiple options and I have doubts with every single one of them. bin/magento app:config:...
Ambidex's user avatar
  • 113
3 votes
1 answer
437 views

Is it possible to override vendor/magento/module-sales/Api/Data/OrderAddressInterface.php

Is it possible to override vendor/magento/module-sales/Api/Data/OrderAddressInterface.php as I want to get sales order address custom column value in order REST API.
user12992122's user avatar
0 votes
1 answer
148 views

Unable to override interface in magento2

I want to declare new method in interface "Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface" I tried to override interface using di.xml <preference for="...
Unknown's user avatar
  • 581
7 votes
1 answer
2k views

How to override Interface of Other custom module?

I have tried with preference to override interface as below in di.xml file <preference for="Custom\Module\Api\Data\AccountInterface" type="Override\Module\Api\Data\AccountInterface" /> <...
rakesh prajapati's user avatar
0 votes
2 answers
77 views

Magento 2 - Factory Related Question

I have created a custom module, in that I have created the interface. As I am learning magento, I have seen in demo videos that for ex:- This is my custom interface name AffiliateMemberInterface. ...
Soni5041's user avatar
  • 145
2 votes
0 answers
163 views

Get a dropdown attribute value from ProductInterface, without breaking interface contract

I have an instance of \Magento\Catalog\Api\Data\ProductInterface. This product has a product attribute 'custom_attribute', which is a dropdown. Now, if this was an instance of \Magento\Catalog\Model\...
Tjitse's user avatar
  • 1,310
1 vote
1 answer
46 views

I'm starting at zero and need advice:

My name is Mathias, I'm completely new to web-development and all of this and I would appreciate it if someone can quide me the right way to start learning the basics. Very short part to my ...
Mathias's user avatar
  • 11
0 votes
0 answers
138 views

Mass update doesnt work in Magento 2.3.2

I am using bulk action feature in admin, on catalog page when am trying to update attribute am getting below error Got error 'PHP message: PHP Fatal error: Uncaught Error: Cannot instantiate ...
Daniel_12's user avatar
  • 680
2 votes
1 answer
500 views

Magento 2: Regarding Initialling Interface

As per object oriented programming concept, an interface can not be initialised directly but can be used to implement in other class and the instance of that class can be created. So my question is ...
Kishan Patadia's user avatar
4 votes
2 answers
9k views

Uncaught Error: Cannot instantiate interface Magento\\InventoryReservationsApi\\Model\\GetReservationsQuantityInterface

I just installed the latest magento 2 (Magento-CE-2.3.2) and imported a database from another working magento 2 store with Magento 2.3.1. But if I try to load a product in the frontend, then I get a ...
Black's user avatar
  • 3,369
0 votes
1 answer
853 views

Magento2.2.5 - getting error

I got the below error in magento 2.2.5 Interface Magento\Framework\App\Action\HttpPostActionInterface' not found in /var/www/html/app/code/Sm/CartQuickPro/Controller/Product/Compare/Remove.php
Anas Mansuri's user avatar
  • 2,627
0 votes
0 answers
160 views

How to add custom method in product interface.And how to overide productinterface and product model

I want to add custom method in product interface and override product interface and product model.
Tushar's user avatar
  • 515
2 votes
1 answer
6k views

How to sort by position field

This is my collection function: public function getCollection() { $searchCriteria = $this->searchCriteriaBuilder->addFilter('status', '1')->create(); $someCollection = $this->...
Rufus's user avatar
  • 621
0 votes
2 answers
48 views

Create QuestionManagement class

I have made Question repository class: namespace Vendor\Module\Model; use Magento\Framework\Api\DataObjectHelper; use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Api\Search\...
Rufus's user avatar
  • 621
3 votes
2 answers
2k views

Magento 2.3.0 How to add store filter in searchCriteriaBuilder

In my custom module, I am trying to add store filter in orderRepository using searchCriteriaBuilder but it is throwing an error like below. 1 exception(s): Exception #0 (Exception): Warning: PDO::...
Chirag Patel's user avatar
  • 6,136
1 vote
0 answers
61 views

Magento 2: 2.3.1 Is there a way to 'compact' or improve the UX of the Magento 2 backend?

Magento 2: 2.3.1 Is there a way to 'compact' or improve the UX of the Magento 2 backend? Coming from M1 we love the new Wordpressy kind of look of Magento 2. But ... it does take up a lot of space. ...
snh_nl's user avatar
  • 5,452
1 vote
1 answer
466 views

How to override the GroupInterface by creating extension attributes in magento 2

I wish to override Magento\Customer\Api\Data\GroupInterface to add my custom fields. Custom fields are 1.custom_terms 2.handling_fee I have created the below file in etc/extension_attribues.xml &...
Jaisa's user avatar
  • 2,626
2 votes
0 answers
884 views

Magento 2 : how to add extension attribute to filter?

how to add extension attribute to to filter ? I am getting items if i remove my custom filter. But i want to add my extension_attributes in searchCriteriaBuilder to check further condition. Here is ...
Dharmesh Hariyani's user avatar
2 votes
1 answer
1k views

Magento 2 Join with ProductRepositoryInterface

I want to add join query with productRepository. Here is my class. Can anyone help with this. I have used \Magento\Catalog\Api\ProductRepositoryInterface::getList() method to get product list and now ...
Dharmesh Hariyani's user avatar
0 votes
1 answer
501 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.
Magento Dev's user avatar
  • 1,264
0 votes
1 answer
129 views

What is the significance, or how important is Interface in Magento2

I m studying Magento2, and have reviewed one of the documentation where every design pattern which is used in Magento2 is explained with extending and Interface. Right now I only know basic of what ...
Tester's user avatar
  • 367
2 votes
0 answers
84 views

Magento 2 - Can I have to create API, Interface & Resource Model for relational table

I am creating a module which have three tables let's say for example table1 -------- id int(13) PRIMARY_KEY title varchar(50) table2 -------- id int(13) PRIMARY_KEY title varchar(255) table3 `...
Himanshu's user avatar
  • 1,761
3 votes
1 answer
799 views

I am trying to override core interface in Vendor\magento\sales\Api\Data\OrderItemInterface.php

My di.xml code is here, is there any alternative way to override an interface for core file. <preference for="Magento\Sales\Api\Data\OrderItemInterface" type="Vendor\Name\Api\Data\...
user avatar
1 vote
1 answer
1k views

Why Magento 2.2.3 returns empty collection?

I don't have any prior experience in this. I want to fetch the products from Database. I am trying from past few hours.But not working. I am using following code. protected $...
Mohammad Alfaz's user avatar