Questions tagged [interceptor]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
23 views

Plugin for Magento\Setup\Model\ConfigOptionsList::validate

Is it possible to make a plugin for Magento\Setup\Model\ConfigOptionsList::validate()? This function checks the validity of connection to DB and since I am dynamically generating password for DB, I ...
InToSSH's user avatar
  • 11
0 votes
1 answer
154 views

Interceptor not exists issue when running setup:upgrade command in magento 2

When i run setup upgrade command i got the following error Class "Vendor_Name\Subscription\Test\Command\DispatchEventOOSProduct\Interceptor" does not exist I tried to remove the ...
Jaisa's user avatar
  • 2,522
0 votes
1 answer
167 views

Class Demo\Helloworld\Controller\Post\index\Interceptor does not exist

I am trying to get data from a database table, my code of Index.php <?php namespace Demo\Helloworld\Controller\Post; class Index extends \Magento\Framework\App\Action\Action { protected $...
MMM's user avatar
  • 3
0 votes
0 answers
97 views

Class Interceptor error

I have developed a module that use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection but when I call the method i get this error: Error occurred when creating object: Oct\Oct\Helper\Search\...
Miguel's user avatar
  • 549
0 votes
1 answer
289 views

There has been an error processing your request: "0":"Unable to serialize value. Error: Malformed UTF-8 characters, possibly incorrectly encoded"

I am attempting to set up my local environment for Magento. When I try to view the front end, I get the following error on the page: There has been an error processing your request Exception printing ...
Enzie Riddle's user avatar
1 vote
1 answer
349 views

About performance: Is better to use before and after plugin instead around always when possible?

About use of each kind of interceptor (plugin) was answered here: Is it better to use solely around function instead of before+after combined? But in Magento docs says: Avoid using around method ...
jefferson's user avatar
0 votes
0 answers
104 views

Parameter type seems to be wrong type in preference

I made this two preferences <preference for="Magento\Catalog\Block\Product\ProductList\Toolbar" type="Prj\Catalog\Block\Product\ProductList\Toolbar" /> <preference for=&...
Claims's user avatar
  • 944
2 votes
2 answers
338 views

Search Results not using the Product list interceptor class

I needed to make some changes to the product list in magento 2. So I went with this approach. Create a plugin on the Magento\Catalog\Block\Product\ListProduct::toHtml method and do my changes in ...
Marius's user avatar
  • 198k
0 votes
0 answers
32 views

Deactivating and reactivating plugins on-the-fly

I am currently developing on a VM with a Ubuntu host machine - it is super slow. I am currently trying to implement a plugin but the magento s:d:c command takes 6 minutes. Within examples for Plugins ...
Scott Anderson's user avatar
0 votes
1 answer
227 views

Magento showing errors in developer mode

I have enabled developer and it's showing me following errors : 1 exception(s): Exception #0 (Exception): Notice: A non well formed numeric value encountered in /opt/bitnami/apps/magento/htdocs/app/...
Anonymous Record's user avatar
2 votes
0 answers
39 views

Basic clarity on some magento default function

I had gone through a interview process. They fired some questions below which I don't know answers and couldn't find in google. The questions are below. How to create a object and why we need to ...
Ramesh KR's user avatar
  • 836
0 votes
1 answer
100 views

Strip space from frontend search query

my task at my work is that i remove spaces from a frontend sku search (the one at top and the one after hitting enter). All sku's are formatted like AB 100001234, regexe and so on is ready to go. If ...
Philipp's user avatar
0 votes
1 answer
718 views

magento 2 product class extending caused Type Error occurred when creating object: Company\Module\Model\Catalog\Product\Interceptor

https://magenticians.com/override-model-magento-2/ I have followed the above tutorial to extend the Product class to show our custom compatible products with the product that the customer views. ...
isc's user avatar
  • 5
0 votes
2 answers
398 views

Interceptor Plugin for Product Attributes

I'm trying to modify the "short_description" attribute using a plugin but I can't seem to get it to work across the whole website. I can do this on the product view page with the following but I don't ...
Johnny's user avatar
  • 1
1 vote
1 answer
2k views

Magento 2: Fatal Error: 'Uncaught Error: Call to undefined method setWebsiteId()

I had created a custom API for customer registration in Magento 2.3. I am checking that the weather the customer is already registered or not with below code. $email = $this->request->getParam('...
IntraPersonalLearner's user avatar
2 votes
1 answer
1k views

Plugin intercept before place order for PayPal method on Magento2

In my Magento2 instance, I created a Plugin interceptor for run custom validation before process the payment. Works for all payment methods but PayPal Express or PayPal Standard. di.xml <config ...
Davebra's user avatar
  • 123
1 vote
1 answer
1k views

Save cart through backend gives @return type error

I am trying to change some data on a cart through the backend programmatically, i have a grid with a few actions, if i execute the Approve or Reject action it will go to a GET url. Admin Controller &...
P. Sopacua's user avatar
-1 votes
2 answers
4k views

Magento 2 : Class interceptor does not exist [duplicate]

I have a simple module when I save data then this error : Magepow\Importexport\Controller\Adminhtml\Allimports\Save\Interceptor does not exist [] [] here is save file <?php namespace ...
MichaelHa's user avatar
  • 671
1 vote
5 answers
10k views

Class interceptor does not exist magento 2

Class Vendor\Mymodule\Controller\Adminhtml\Allimports\Save\Interceptor does not exist I have a custom form and when I save data this error message, how to fix it, except usage di: compile. Thank you.
MichaelHa's user avatar
  • 671
3 votes
1 answer
5k views

Type Error occurred when creating Interceptor after Updating to 2.3.2

After updating Magento from 2.1.6 to 2.3.2 and PHP from 5.6.30 to 7.2.20, now running into errors on page load. Have a module called Inquiry, which consists of forms to request things, and there is a ...
Ryan Freeman's user avatar
0 votes
0 answers
134 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
  • 670
0 votes
4 answers
1k views

Wishlist ajax remove

I want to remove product from wishlist from a custom button on detail. I did a plugin for the Magento\Wishlist\Controller\Index\Remove.php with an aroundExecute but for some reason I can't load/create ...
Vlad Patru's user avatar
  • 1,200
3 votes
3 answers
5k views

Magento 2.3 Type Error occurred when creating object: Magecomp\Imageclean\Model\ResourceModel\Imageclean\Grid\Collection\Interceptor

I am using under given module. https://magecomp.com/magento-2-image-clean.html Till Magento 2.3.1 it's working perfectly. After upgrade to 2.3.2 it giving under given error: Type Error occurred ...
JACK's user avatar
  • 387
27 votes
8 answers
90k views

Magento-2:Class Magento\Framework\App\Http\Interceptor does not exist

Exception.log file Error: {"exception":"[object] (ReflectionException(code: -1): Class Magento\Framework\App\Http\Interceptor does not exist
Lokesh M's user avatar
  • 403
4 votes
1 answer
430 views

How do I prevent interceptor classes from being generated so I can debug?

I'm using xdebug to set breakpoints in Magento Commerce, which is installed locally on Ubuntu. I have a breakpoint set in vendor/magento/framework/App/FrontController.php. However, that breakpoint ...
Ben Rubin's user avatar
  • 549
0 votes
0 answers
4k views

before plugin parameter magento 2

I am writing a before plugin for below public method. public function setup($user,$pass,$url = null){ $this->username = $user; $this->password = $pass; if ($url) { ...
Daniel_12's user avatar
  • 670
1 vote
1 answer
337 views

Unable to get newly inserted Product's Id using After Plugin for Catalog Product save controller method

I have created interceptor for catalog product controller's save action <type name="Magento\Catalog\Controller\Adminhtml\Product\Save"> <plugin name="ricky_catalog_save_product" ...
Kapil Dev Singh's user avatar
3 votes
3 answers
2k views

interceptor not generate for \Magento\Catalog\Block\Product\ListProduct

I'm trying to create plugin for getProductPrice but \Magento\Catalog\Block\Product\ListProduct Block Class not generate Interceptor Class like Magento\Catalog\Block\Product\ListProduct\Interceptor. ...
Arshad Muhammad's user avatar
0 votes
1 answer
155 views

Create an Interceptor/Observer to trigger action when specific page is loaded

I want to send info to third party services about the views on pages like cart, products, checkout, etc. This info is sent whenever someone visits the respective page or view. For example, when a ...
dirac's user avatar
  • 45
2 votes
1 answer
464 views

Compilation error due to final class Vault in Magento version before 2.2.0

I am writing a plugin on class Magento\Payment\Model\MethodInterface: <type name=“Magento\Payment\Model\MethodInterface”> <plugin name=“mageworx_ordereditor_change_title_print_order” ...
Артём Залесский's user avatar
0 votes
1 answer
290 views

Where to place magento 2.2.x custom interceptor

I am trying to look for a proper document where it is clearly told about where to place my interceptor code for continuous programming This document https://devdocs.magento.com/guides/v2.2/extension-...
Dickens A S's user avatar
0 votes
1 answer
962 views

Magento2 plugin/interceptor not working

I have following action: http://localhost/admin/catalog/product_attribute/edit/attribute_id/135/key/…/ I would like to do some extra things with attribute after saving. I have created and registered ...
mkas's user avatar
  • 101
2 votes
1 answer
797 views

Remove plugin (interceptor)

I want to prevent a certain plugin from loading, namely 'authorization' plugin in module-quote/Model/GuestCartManagement/Plugin/Authorization.php. What i tried to do is to comment lines in di.xml ...
Asadov Kamran's user avatar
1 vote
1 answer
907 views

plugin to stop redirecting to cart from checkout

In M2 if the user tries to go to the checkout without any items in their cart the Magento\Checkout\Controller\Index\Index::execute() function redirects them to the cart. if (!$quote->hasItems() || ...
Holly's user avatar
  • 4,813
0 votes
1 answer
164 views

How to stop Interceptor class rewriting return annotations

Magento version: 2.2.3 I have a Block class with a method to fetch the designer associated with a product. It is annotated to return a model interface or null. public function getDesigner(): ?...
James Dinsdale's user avatar
0 votes
2 answers
719 views

Why is Magento 2 creating this Interceptor file?

I've been comparing two versions of a website I'm working on -- one is fine and the other has a broken layout -- and the main difference I've found between them is the following file: generated/code/...
mxtthxw's user avatar
  • 11
0 votes
0 answers
218 views

Interceptor error in Observer

vendor/magento/module-sales/etc/events.xml <event name="sales_order_save_after"> <observer name="sales_order_save_after" instance="Magento\Sales\Observer\SalesOrderSaveAfter" /> </...
Midlaj's user avatar
  • 397
3 votes
1 answer
142 views

Is it better to use solely around function instead of before+after combined?

The codes below can achieve the same output: Using solely around plugin public function aroundXXX( SomeClass $subject, \Closure $proceed ){ beforeFunctions(); /*Perform XXX*/ $...
PY Yick's user avatar
  • 2,695
1 vote
1 answer
778 views

How to stop saving resource model and throw error messages inside _beforeSave function?

I have the following codes inside a custom resourceModel class: protected function _beforeSave( AbstractModel $object ) { //My operations return parent::_beforeSave($object); } I added a ...
PY Yick's user avatar
  • 2,695
0 votes
1 answer
67 views

Problem with widgets in Magento 2.1.9

I'm getting the next message when I try to add a widget on a block; Insert Widget... There has been an error processing your request Class Magento\Widget\Controller\Adminhtml\Widget\Index\...
Núria's user avatar
  • 133
1 vote
2 answers
414 views

Magento 2 - Select the interceptor/observer

I want to have products that not require to stay logged and other that need it. So i think the best way is set in the admin "Allow Guest Checkout = Yes" and when the client goes to the checkout and ...
Muribury's user avatar
  • 141
4 votes
1 answer
3k views

Magento 2 using around interceptor/plugin to modify exception message

In the Magento\Checkout\Model\PaymentInformationManagement::savePaymentInformationAndPlaceOrder() method all exceptions are caught and CouldNotSaveException is created with a generic message. I ...
jzahedieh's user avatar
  • 828
4 votes
2 answers
2k views

Plugin, get original function parameters in after method

When creating plugin (http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html) is there a way to get original parameters in after method? I'm not sure what i can find in the first ...
michalhosna's user avatar
3 votes
1 answer
918 views

Where is Magento\Framework\App\FrontController\Interceptor?

I am learning magento 2.1 request flow. I am stuck here: $frontController = $this->_objectManager->get('Magento\Framework\App\FrontControllerInterface'); $result = $frontController->...
Konstantin Gerasimov's user avatar
2 votes
1 answer
547 views

Magento 2 getProductCollection Interceptor everytime

I would like to intercept and modify a product collection every time it is used. However, I am having issues figuring out what functions to create a plugin for. I mostly understand Interceptors, ...
Tyler's user avatar
  • 263
1 vote
0 answers
82 views

Has anybody used Plugins(Interceptors) for Magento 1 from SafeMage Team? [closed]

everybody! Could anybody tell me if he use Plugins(Interceptors) from this team? http://www.safemage.com/function-plugins-for-magento-1.html It seems it is similar to the same functionality of ...
Mage Developer's user avatar
4 votes
2 answers
5k views

Magento 2 : Use plugin / interceptor on abstract class

I am trying to create a plugin that fires after \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShipment\PrintAction::execute. So I have my plugin setup in di.xml and an afterExecute() method, ...
Giel Berkers's user avatar
  • 12.2k
1 vote
1 answer
393 views

Sharing data between interceptor (plugin) and block. How?

I want to use some data from intercepters in a block. To start with I have attempted to use DI to inject a simple custom model but by logging I see that a instance is been used by the interceptor ...
Christopher Hackett's user avatar
2 votes
1 answer
4k views

Interceptor error in Controller magento2

Vendor\Module\etc\di.xml <preference for="Magento\CatalogSearch\Controller\Result\Index" type="Vendor\Module\Controller\Result\Index" /> Vendor\Module\Controller\Result\Index.php namespace ...
Sushivam's user avatar
  • 2,609
2 votes
2 answers
336 views

Add same plugin to all public methods of a type

Is there any chance to add a plugin to all public methods of a type without writing a separate method for all of them? I would like to use that to log method calls. The original method is always ...
Fabian Schmengler's user avatar