Questions tagged [around-plugin]

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

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

around plugin error | too few to function ::resolve()

This function runs around the resolve function for coupon api on Graphql, once the core function throws exception this function will catch and update the error message. core file [module-quote-graph-...
user avatar
  • 1
0 votes
1 answer
61 views

Around plugin usage in Magento2

I have to override the file Magento\ConfigurableProduct\Helper\Data.php into my custom module I have few changes in the function getOptions public function getOptions($currentProduct, $...
user avatar
  • 135
0 votes
1 answer
46 views

How to override core plugin method?

I would like to override core plugin method Core plugin path Magento\InventorySales\Plugin\StockState\CheckQuoteItemQtyPlugin.php In this file I would like to override aroundCheckQuoteItemQty() ...
user avatar
0 votes
0 answers
37 views

Magento 2 : Update billing address using around plugin while doing place order

Original method /** * Place Order * * @param mixed $result * * @return string * @throws CouldNotSaveException */ public function place_order($result, $location) { $paymentMethod = $result['...
user avatar
  • 367
1 vote
1 answer
175 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
1 answer
45 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, ...
user avatar
1 vote
1 answer
66 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"?> <...
user avatar
  • 2,048
1 vote
1 answer
59 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 ...
user avatar
  • 1,028
1 vote
2 answers
903 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/...
user avatar
0 votes
1 answer
244 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 ...
user avatar
0 votes
2 answers
51 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\...
user avatar
0 votes
2 answers
290 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 ...
user avatar
  • 1,549
0 votes
0 answers
88 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....
user avatar
  • 1,047
0 votes
0 answers
168 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 ...
user avatar
0 votes
0 answers
33 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 ...
user avatar
2 votes
1 answer
175 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?
user avatar
2 votes
1 answer
552 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="...
user avatar
0 votes
2 answers
32 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? <?...
user avatar
  • 189
0 votes
1 answer
171 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> ...
user avatar
0 votes
1 answer
86 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 ...
user avatar
0 votes
1 answer
243 views

Redirect from around plugin in Magento 2

How to redirect from around plugin to another page with an error ?
user avatar
0 votes
1 answer
507 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 ...
user avatar
  • 3,664
0 votes
1 answer
103 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 ...
user avatar
  • 139
0 votes
3 answers
1k 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="...
user avatar
  • 1,729
0 votes
0 answers
286 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 ...
user avatar
  • 1,749
1 vote
0 answers
654 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: ...
user avatar