Questions tagged [around-plugin]

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

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

Magento 2 System Config Plugin

I have created a custom tab in system config and added 1 field Module Enable Yes/No and 1 Dynamic fields which is depends on Module Enable. When Module Enable is set Yes I created various dynamic ...
0
votes
0answers
21 views

Magento 2 system config Concatenate data to existing field with plugin beforeSave or aroundSave

I have a drop down field containing fruits where I would like to concatenate some data e.G: Using a Plugin save the data like so: Bananas are high in potassium Where are high in potassium is the ...
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
1answer
29 views

Magento 2 validate the form input using plugin and save the modified data

I am using custom plugin to validate the user input for customer profile. I have created Module Company_Module and create di.xml file in etc to verify the input given by the user: <type name="...
0
votes
2answers
23 views

Magento 2 describe attrubute property used in Plugin method

I am trying to create a simple module and I can't find the propose of the attribute name and type inside the tag type and plugin in di.xml. can anyone describe attribute name used in plugin? <?...
0
votes
1answer
40 views

Magento 2.2.2 : Redirect not working from plugin

di.xml <type name="Magento\Framework\AppInterface"> <plugin sortOrder="1" name="noroute_redirect" type="Namespace\ModuleName\Plugin\AppInterfacePlugin"/> </type> ...
0
votes
1answer
33 views

Magento 2 : Swatches not display when use plugin around

I used around plugin to call custom phtml in category list page. It's working proper. But, In configurable product it's hide to display swatches. I upload here my files code. Which function should I ...
0
votes
1answer
35 views

Redirect from around plugin in Magento 2

How to redirect from around plugin to another page with an error ?
0
votes
1answer
128 views

Magento : Around Plugin for LoginPost

I would like to write a plugin for Magento\Customer\Controller\Account\LoginPost. Actually I've custom template that is called when customer clicked on Proceed to Checkout. (Only when customer is not ...
0
votes
1answer
55 views

Page cache issue, my plugin only works after the first page load

I have created a module that autoselects a currency based on the user's country using a plugin for Magento\Store\Model\Store::getDefaultCurrencyCode() . On the first page load it will show the ...
0
votes
0answers
179 views

Display notification/error message in frontend from a helper override

I have created a custom module for restrct one cms page access in few conditions. If the page is restricted, then I want to redirect the page to home page and display one message. My code is ...
0
votes
3answers
214 views

Customer redirect issue with plugin method magento2

I have used below code to write plugin method for loginPost controller. this is the code of etc/di.xml <type name="Magento\Customer\Controller\Account\LoginPost"> <plugin name="...
0
votes
0answers
117 views

Magento2: Stop user registration email notification to customer programmatically

I want stop email notification for user registration(createuser) programmatically. We can use plugin, observer, extend createpost controller. Can anyone please suggest which way is standard to do ...
0
votes
0answers
57 views

Purpose of closure and callable in plugins

I am new in Magento.I am trying to understand how plugin works.But I do not understand the purpose of callable and closure .In many resources it is written that those are used to proceed the argument ...
1
vote
0answers
214 views

Magento 2.1.11 - Interceptor throwing ltrim expects 1 parameter to be string, object given warning exception

I want to make a plugin to do something around a custom made checkout method. I do have other interceptors working prior to adding this, but this one I am getting a ltrim warning. CRITICAL: ...