Questions tagged [interceptor]

The tag has no usage guidance.

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

Have a plugin (interceptor) run once per session

So, I have this plugin for our project (drop-shipping marketplace), which redirects vendors without signed contracts to the contract signing page. The thing is, as it is, it infinitely redirects ...
user avatar
0 votes
0 answers
9 views

RAM taking too much space when there is more call on this class - /FrontController/Magento\Framework\App\FrontController\Interceptor

I'm using Magento2.4.3-p1. We are facing RAM too hight alert issue becuase of the following class requested more time per second. /FrontController/Magento\Framework\App\FrontController\Interceptor /...
user avatar
0 votes
1 answer
45 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 $...
user avatar
  • 3
0 votes
0 answers
25 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\...
user avatar
  • 529
0 votes
1 answer
46 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 ...
user avatar
1 vote
1 answer
168 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 ...
user avatar
0 votes
0 answers
35 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=&...
user avatar
  • 737
2 votes
2 answers
182 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 ...
user avatar
  • 195k
0 votes
0 answers
18 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 ...
user avatar
0 votes
1 answer
105 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/...
user avatar
2 votes
0 answers
20 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 ...
user avatar
  • 828
0 votes
1 answer
57 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 ...
user avatar
0 votes
1 answer
384 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. ...
user avatar
  • 5
0 votes
2 answers
272 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 ...
user avatar
  • 1
1 vote
1 answer
1k 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('...
user avatar
2 votes
1 answer
846 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 ...
user avatar
  • 123
1 vote
1 answer
998 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 &...
user avatar
-1 votes
2 answers
3k 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 ...
user avatar
  • 641
0 votes
5 answers
7k 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.
user avatar
  • 641
3 votes
1 answer
4k 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 ...
user avatar
0 votes
0 answers
109 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 ...
user avatar
  • 630
0 votes
4 answers
912 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 ...
user avatar
  • 1,170
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 ...
user avatar
  • 387
22 votes
7 answers
64k 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
user avatar
  • 353
4 votes
1 answer
297 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 ...
user avatar
  • 519
0 votes
0 answers
3k 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) { ...
user avatar
  • 630
1 vote
1 answer
212 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" ...
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. ...
user avatar
0 votes
1 answer
133 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 ...
user avatar
  • 45
2 votes
1 answer
424 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” ...
user avatar
0 votes
1 answer
255 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-...
user avatar
0 votes
1 answer
845 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 ...
user avatar
  • 1
1 vote
1 answer
681 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 ...
user avatar
1 vote
1 answer
677 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() || ...
user avatar
  • 4,613
0 votes
1 answer
155 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(): ?...
user avatar
0 votes
2 answers
562 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/...
user avatar
  • 11
0 votes
0 answers
189 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" /> </...
user avatar
  • 387
3 votes
1 answer
75 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*/ $...
user avatar
  • 2,625
1 vote
1 answer
603 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 ...
user avatar
  • 2,625
0 votes
1 answer
63 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\...
user avatar
  • 133
1 vote
2 answers
367 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 ...
user avatar
  • 141
3 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 ...
user avatar
  • 798
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 ...
user avatar
3 votes
1 answer
760 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->...
user avatar
2 votes
1 answer
466 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, ...
user avatar
  • 263
1 vote
0 answers
78 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 ...
user avatar
4 votes
2 answers
4k 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, ...
user avatar
  • 11.6k
1 vote
1 answer
303 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 ...
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 ...
user avatar
  • 2,549
2 votes
2 answers
249 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 ...
user avatar