Questions tagged [after-plugin]

Denotes questions about Magento 2 AfterPlugins. For general questions use "plugin" tag.

Filter by
Sorted by
Tagged with
0
votes
2answers
22 views

Magento 2 - Create a log file in plugin that will print log when data is inserted in database

I have entered data in the database using object Manager in Model file itself. I want to print a log file from the plugin that will print the log of the last data that is inserted in the database.
1
vote
0answers
81 views

How to extend store credit functionality in Magento 2 Enterprise Edition

I want to add amount as store credit by: -> API -> Using Payment Method By default store credit is added when we redeem gift card. But my requirement is to add store credit directly by customer ...
2
votes
1answer
28 views

Around Plugins ( Interceptors) in magento can be used to suppress before and after plugin execution?

In around plugin function, if we don't use proceed() then after plugin execution will be suppressed. Is there anyway by which we can suppress before plugin execution?
1
vote
2answers
30 views

Can I access changed parameters in an after/around plugin?

I want to access a parameter of a method in an after plugin. The value of the parameter has been changed inside the original method, and I want to access the modified value. Example: class ...
2
votes
2answers
65 views

Override Shipping Rates at checkout

I am simply looking to get the shipping rates from the current quote and override them via a plugin/interceptor but have no idea where I'm going wrong here: <?php namespace Vendor\Module\Plugin\...
2
votes
0answers
36 views

Magento 2 REST API: Get the name of child products in bundle_product_options-> product_links

So I am trying to go for a headless magento approach. I am using the following API to get product details: V1/products/:sku If the product is a bundle product, it shows bundle_product_options in ...
0
votes
1answer
35 views

Get Product info from afterAddProduct Plugin in magento 2

I have a custom functionality for add to cart in product detail page. Once button clicked, sending product id and adding product to the cart. Used below code to implement it. <input type="hidden"...
1
vote
1answer
30 views

I cant seem to write an Plugin for \Magento\ImportExport\Model\Import\AbstractSource

I am trying to write a plugin for \Magento\ImportExport\Model\Import\AbstractSource::current using <type name="Magento\ImportExport\Model\Import\AbstractSource"> <plugin name="...
0
votes
1answer
36 views

Plugin method not found

This is my plugin: <?php namespace Vendor\Module\Plugin; use Magento\Email\Controller\Adminhtml\Email\Template\DefaultTemplate; class MyPlugin { public function afterExecute(DefaultTemplate $...
1
vote
1answer
60 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" ...
1
vote
1answer
212 views

Magento 2.3.0 How to override wishlist & compare product list page using plugin

I want to override wishlist & compare product grid using plugin. after that i would like to append custom div under class="product-image-container". I try & search a lot but no luck. is there ...
0
votes
0answers
24 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
0answers
221 views

Customer redirect issue with login post plugin magento2

I have used two plugins to use the referral url's for customer login page. here is the code of my etc/di.xml <type name="Magento\Customer\Controller\Account\LoginPost"> <plugin ...
0
votes
0answers
26 views

How to access data in the function that I am observing?

I created a plugin for Iways\PayPalPlus\Controller\Order\Create.php This is the function that I am observing. public function execute() { try { $cartId = $this->checkoutSession->...
0
votes
0answers
88 views

How to get popup on button click via plugin at admin side in Magento 2

I have "New Add Product" button at Sales->Order->Create New Order which I added through plugin. My di is at: etc/adminhtml As <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
0answers
35 views

How to insert a text into before all magento notification messages in magento 2 with plugin?

I'm new Magento. Can someone tell me how to insert a text into before all system messages of Magento 2 with a plugin. When I do anything, I get the message.Ex :login, create account, add to cart,...
1
vote
0answers
37 views

Magento2 Plugin for beforeExceute that return a $resultRedirect->setPath('customer/account/login');

I've to "override" a module that manage a redirect. The original module have this code: public function execute() { [...] $resultRedirect = $this->resultFactory->...
2
votes
1answer
47 views

Magento2: Intercept category moved inside tree

I am trying to intercept when a category is moved inside the category tree. At the beginning I thought to observe the event catalog_category_tree_move_after with an Observer class but I found that ...
0
votes
2answers
54 views

Plugin isn't working in Magento2 local host

My very basic plugin is not working and i can't understand why. I'm very new to Magento 2 so it's probably something simple. The Plugin is suppose to display "Too expensive" or "too cheap" on all ...
3
votes
2answers
103 views

Magento 2 Plugin Not Extending Model - Finally Solved It

I'm trying to use a plugin from the answer on this question Add additional select attributes to grouped product's child collection I would go back and ask the person who answered but I don't ...
1
vote
1answer
262 views

Argument passing error in after plugin

I am trying to create after plugin for delete function of Magento\Tax\Model\TaxRuleRepository function looks like follows public function delete(TaxRuleInterface $rule) { $ruleId = $rule-...