Stack Exchange Network

Stack Exchange network consists of 175 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 [interface]

The tag has no usage guidance.

0
votes
0answers
17 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.
1
vote
1answer
26 views

How to sort by position field

This is my collection function: public function getCollection() { $searchCriteria = $this->searchCriteriaBuilder->addFilter('status', '1')->create(); $someCollection = $this->...
0
votes
2answers
22 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\...
3
votes
2answers
41 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::...
0
votes
0answers
6 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. ...
0
votes
1answer
19 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 &...
2
votes
0answers
76 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 ...
1
vote
1answer
53 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 ...
0
votes
0answers
12 views

Preventing recursion in custom Magento API

I'm having some issues dealing with recursion in a custom API endpoint I have written for Magento 2. I have an endpoint that returns an entity which contains a number of fields, one of these fields ...
0
votes
1answer
33 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.
0
votes
0answers
14 views

interceptor has wrong interface

Im trying to override a plugin render function with a call to afterRender(); I need part of the existing function but that causes a Fatal error: Fatal error: Uncaught TypeError: Argument 1 passed to ...
0
votes
1answer
25 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 ...
2
votes
0answers
24 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 `...
2
votes
1answer
80 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\...
0
votes
0answers
62 views

Magento2 fatal error on 2.2.2

I occasionally get the below error on our live website. Fatal error: Class Magento\Framework\Session\SaveHandler contains 3 abstract methods and must therefore be declared abstract or implement ...
0
votes
1answer
318 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 $...
0
votes
1answer
739 views

Magento2 interface not found in Model class

I am new to Magento2. I am developing a payment method and I am getting the message: Fatal error: Interface 'Test\TestThesis\Model\Test\TestThesis\Api\Data\CryptocurrencyInterface' not found in C:...
5
votes
2answers
5k views

Magento 2 : Override core Interface and Model

I am trying to override core interface of Customer Group. I add my custom get and set methods to core Api interface. Vendor\magento\customer-module\Api\Data\GroupInterface.php Where its working ...
1
vote
0answers
91 views

Magento 2 ProductInterface Override

I need to Override Default Magento 2 ProductInterface to add extra key's to Product Details API response.
1
vote
2answers
63 views

I am overridding the default file in my module,but when i add extra method in the file my overriden is not called

I am overridding the default file in my module,it fine but when i add extra method in the overriden file the method is not called. these is my di.xml <?xml version="1.0" ?> <config xmlns:...
1
vote
0answers
969 views

PHP Fatal error: Uncaught Error: Cannot instantiate interface

I have a preference in di.xml: <?xml version="1.0"?> <config> <preference for="Magento\CatalogRule\Api\Data\RuleInterface" type="Module\Vendor\Model\RuleInterface" />...
0
votes
1answer
28 views

Magento Admin Panel turns into Text File

After I "accidently" changed the Interface Locale in my Magento Admin Panel > Account Setting, the page reloaded and became a text page. When I tried to change the Interface Locale again, the Save ...
1
vote
2answers
137 views

Magento2 API must use fully qualified namespaces?

In Magento2.1, I see almost all API use the fully qualified namespaces in the function param and PHPDoc, instead of using importing and aliases, like PageRepositoryInterface and ...
2
votes
3answers
318 views

REST Api interface di not working. Class ItemInterface does not exist

ItemInterface: namespace MyVendor\SampleModule1\Api\Data; interface ItemInterface { /** * @return string */ public function getName(); /** * @return string|null */ ...
1
vote
1answer
1k views

How can override shipping API interface in Magento2

I need to override below two core file of vendor folder : vendor/magento/module-quote/Api/Data/ShippingMethodInterface.php vendor/magento/module-quote/Model/Cart/ShippingMethod.php file to my code ...
0
votes
0answers
322 views

Fatal error: Uncaught Error: Cannot instantiate interface - LowestPriceOptionsProviderInterface

I moved fully working Magento 2 to a different host (same server settings) and now I'm getting following error: Fatal error: Uncaught Error: Cannot instantiate interface Magento\ConfigurableProduct\...
3
votes
0answers
638 views

Overriding or Extending Core Interfaces

I am trying to add a new getter and setter to \Magento\Catalog\Api\Data\CategoryTreeInterface. I have created a new interface - \Wildcard\CategoriesApi\Api\Data\CategoryTreeInterfaceand a new model -...
5
votes
1answer
933 views

Magento 2 - “Property \”Slider\“ does not have corresponding setter in class ”Magento\\Eav\\Api\\Data\\AttributeOptionInterface\“.”

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface. The idea behind is, As of now we can only pass defined ...
1
vote
1answer
865 views

M2 module structure api directory

I am developing a m2 module. Should i put all of my interfaces in an api directory? Core magento sees to do this but im not sure if this is official guidelines or not.
0
votes
2answers
661 views

Magento 2 how to get product id from QuoteDetailsItemInterface object

I am using Magento 2.1.5 . I am trying to get product id in tax apply function calculateWithTaxNotInPrice is below /** * {@inheritdoc} */ protected function calculateWithTaxNotInPrice(...
0
votes
0answers
58 views

Magento 2 : Getting Interface Error on Frontend

I'm getting following error on frontend. Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\App\RequestSafetyInterface in C:\xampp\htdocs\Magento\vendor\magento\framework\...
2
votes
1answer
2k views

How to get Extension Attribute in a model in Magento 2?

I have added an extension attribute by creating extension_attributes.xml file in etc. Its content is: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
1
vote
1answer
130 views

How to resolve this error in magento 2?

Payfort\Fort\Block\Payment\Redirect Incorrect dependency in class Payfort\Fort\Block\Payment\Redirect in /var/www/magento/app/code/Payfort/Fort/Block/Payment/Redirect.php \Psr\Log\LoggerInterface ...
0
votes
1answer
326 views

How can i override core api interface in my custom module

i am trying to override model and interface of core api in to my custom module for adding new data but i am not able to override interface to add that data contract.
2
votes
0answers
145 views

How add sku attribute to TotalsItemInterface?

I want to add sku attribute to Magento\Quote\Api\Data\TotalsItemInterface (and Magento\Quote\Model\Cart\Totals). This attribute is not my and default for magento, but he turned off from the interface. ...
1
vote
1answer
657 views

Magento 2 Save custom entity primary key

Before all I am using Magento 2.1.2, with a custom entity. I am trying to save multiple row in a flat table that I have created with $connection->insertMultiple($this->getMainTable(), $answers)...
16
votes
3answers
16k views

Fatal error: Cannot instantiate interface in Magento 2?

As the part of creating bundle product programmatically in Magento 2. I am getting below error. Even i removed var/cache and generation. This may be a duplicate question but none of the answer is ...
2
votes
1answer
342 views

Overriding Magento 1.9 interface

I've just started writing Magento 1.9 plugins and I started with a basic example of writing a basic Shipping Method plugin that will return static rates. Here is what the structure of the model file ...
5
votes
1answer
3k views

Magento 2 DI preference priority

I've used DI preferences to set an interface to use a class in my own module e.g. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
1answer
292 views

Magento Event for change of interface locale (or language locale)

Is there any event dispatched when you change the interface locale ?
3
votes
1answer
382 views

Magento 2 API vs. Web Interface vs. Web API

Just as a basic question in Magento 2. In Magento U tutorials, it says: In Magento 2 Modules only communicate through API One module in not aware of the internals of another, so the ...
2
votes
1answer
792 views

Magento 2 - How to generate an Interface and a model?

Sometimes i have to create lots of api models, how would I be able to automate that?
17
votes
2answers
2k views

What is IdentityInterface in Magento2

I see that a lot of the models in Magento 2 implement Magento\Framework\DataObject\IdentityInterface. This interface has a single method called getIdentities The implementations of the method usually ...
0
votes
3answers
2k views

Magento2 interface error

I do not understand what this error is and how it was produced ? I think it happend after I set up SetEnv MAGE_PROFILER "html" and after that I removed that line from the .htaccess file. And ...