Questions tagged [around-plugin]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
24 views

Can the round method be intercepted?

I'm trying to override the round method in \vendor\magento\module-directory\Model\PriceCurrency.php. This is the method: /** * @inheritdoc */ public function round($price) { return round($price, ...
1
vote
1answer
19 views

Product compare plugin not working

Here is the plugin i created for limiting 3 products can be added into comparison. But it not loading, add one know what is the problem? etc/frontend/di.xml <?xml version="1.0"?> <...
1
vote
1answer
32 views

Magento 2 : override abstarct class method

I want to override mone method prepare of class Magento\Ui\Component\Form\Element\AbstractOptionsField I tried to do with preference but there is no effect I also tried using plugin but it throws ...
1
vote
1answer
78 views

Magento2 Around Plugin vs Preference. Which option is better?

I think I don't need to explain in detail about plugins, preferences and observers. These are types of overriding or extending default magento functionality. While overriding any magento core method/...
0
votes
1answer
76 views

Overriding Magento 2.3 Checkout Cart Control Using Plugin using around but not working

What I am trying to achieve is when a product is added to the cart, the customer will have the option to add a special gift box. As every product has a different gift box and price so to do this what ...
0
votes
2answers
44 views

how to create aroundplugin for abstractentity?

I have created around plugin for isAttributeValid function for Magento\ImportExport\Model\Import\Entity\AbstractEntity but it is not working. code: <type name="Magento\ImportExport\Model\Import\...
0
votes
0answers
20 views

My plugin is not working

I need to change the result of getMultilineFieldConfig from Magento\Checkout\Block\Checkout\AttributeMerger. I have a MyVendorName/Checkout module. On etc folder I have di.xml file with: <config ...
0
votes
2answers
65 views

product reviews - “around” plugin extend CollectionFactory query to show children reviews

I have looked everywhere for any reviews extension that supported grouped products and could not find any. So trying to hash it out myself. I need the reviews block on a grouped product to also show ...
0
votes
0answers
51 views

aroundSavePaymentInformationAndPlaceOrder plugin not working in magento 2

etc/di.xml <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config....
0
votes
0answers
82 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
28 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
77 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
153 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
27 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
78 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
71 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
76 views

Redirect from around plugin in Magento 2

How to redirect from around plugin to another page with an error ?
0
votes
1answer
331 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
61 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
3answers
798 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
189 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 ...
1
vote
0answers
505 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: ...