Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plugin]

Denotes questions about Magento 2 Plugins (BeforePlugin , AfterPlugin and AroundPlugin).

-1
votes
0answers
18 views

Magento 2 Plugin explain in deep

Magento 2 Plugin explain which type of available plugin. All explain all kind of plugin in deep Help Me
2
votes
1answer
29 views

Magento1 to Magento2 Migration Process Step

Magento1 to Magento2 Migration Process Step Know you free tool plugin available and file both migration Lets me know
1
vote
2answers
63 views

How to get current Cart_id/quote_id in plugin file Magento 2?

namespace Asm\Setsellerid\Plugin; use Magento\Quote\Model\Cart\Totals\ItemConverter; use Magento\Quote\Api\Data\TotalsItemExtensionFactory; class Item { /** * @var TotalsItemExtensionFactory ...
0
votes
0answers
15 views

instagram feed error is coming in server in magento2

when I am using widget it is giving an error like We're sorry, an error has occurred while generating this content. and the error is in this code Instagram.phtml <?php $helper = $this->helper(...
2
votes
2answers
36 views

two div horizontally when one div is disable another should take the whole space 100% width in Magento 2

I have two div's horizontally in one div there is Instagram feed plugin and another is the newsletter, now when Instagram feed plugin is disabled then newsletter should come in the whole space in ...
1
vote
0answers
39 views

How to redirect to 403 custom error page in magento2 from controller

I am trying to redirect to custom 403 error page. I have created plugin for controller as follow: etc\di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
1answer
23 views

Magento 2 - Add custom sort by option in cattegory page and make it default

I have added custom sort by option "random" for category page. I have used following code to add random option: I have used plugin . app/code/DL/CustomSortOption/etc/frontend/di.xml <config ...
0
votes
0answers
8 views

Plugin to make a Magento website as Mobile Responsiveness magento 2

I'm wondering to ask that is there any plugin available to make Magento 2 website as a Mobile Responsive? If any plugin is available, please let me know.
2
votes
0answers
24 views

Magento 2: Custom product attribute in FinalPrice afterGetValue

I have created a plugin to modify the final price with afterGetValue. <type name="Magento\Catalog\Pricing\Price\FinalPrice" shared="false"> <plugin name="my_module_plugin_product_price" ...
3
votes
1answer
42 views

Any Observer or plugin event for specific module disable?

I want to perform some action when my custom module gets disable. Is there any observer event or plugin event that being fired when i disable my module? Any help would be appreciated. Thank you,
2
votes
1answer
27 views

Magento 2: Checkout afterplace order plugin not working

Im creating a Magento 2 checkout plugin, I want to fetch the orderdata and send it to a third party for order handling. I have made a plugin for the Magento\Sales\Api\OrderManagementInterface class, ...
1
vote
1answer
22 views

Magento 2, plugin for MaintenanceEnableCommand does not get executed

Considering below in etc/di.xml: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type ...
0
votes
1answer
19 views

Standalone Magento Google Pay plugin

Is there any standalone plugin for Google Pay that I could use in M1 an M2? I do not want to use any hosted plugins such as Braintree or Stripe. I know that there is API from Google itself, but I ...
1
vote
1answer
23 views

How to determine if a customer is new in Magento when using afterSave (or other) Plugin?

What is the best way to identify a new customer when using an afterSave Plugin? Or should I use a different approach to do something with new customers?
0
votes
1answer
28 views

Magento 2 Around Plugin get posted form value

I am customizing the address form to add custom arithmetic captcha. We are using ClassyLlama\AvaTax module to validate the customer address in Model File. Now, to validate my custom captcha on server ...
1
vote
1answer
19 views

Zend_Mime_Part could not be converted to string magento 2

I am implemented functionality to change store info in email templates, for that I have created plugin public function aroundSendMessage(\Magento\Framework\Mail\TransportInterface $subject, \Closure ...
2
votes
1answer
19 views

change email template before sending email

Guys am trying to modifying variables used in email templates, like store name, store email for every email. How can we do this good manner? Add plugin on \Magento\Framework\Mail\TransportInterface ...
2
votes
0answers
17 views

Mocked shared instance incomplete on second identical integration test

I'm writing an integration test on a plugin that changes the action of an existing form. The plugin calls a helper method that decides whether the url should be changed and returns the result. I ...
1
vote
0answers
7 views

Creating custom 2FA provider

I'd like to enable the 2FA extension but I'd like to write my own provider (e.g. not Authy or Google Authenticator). Anybody who can point me in the right direction? I have been working with ...
1
vote
1answer
25 views

Call to Member function on null (plugin help)

I currently have this Plugin, which is just this at the moment: di.xm <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
2
votes
2answers
27 views

Change checkout tooltip to string

I am working with a custom plugin in Magento 2 that adds two radio fields after all the other inputs. Here is a photo of what it looks like: When you click on the question mark, a tooltip shows up ...
0
votes
2answers
20 views

Is it possible to change output function call parameters using a plugin

Like I have this function public function letsTry(){ $this->callFuncion($name1, $name2, true); } private function callFunction($arg1, $arg2, $arg3 = false){ // do stuff } How i can change the ...
0
votes
0answers
22 views

Magento 2 - Dynamically hide empty categories based on attribute selected in a cookie

I'm trying to hide empty categories based on an attribute selected previously. Basically I have a vehicle parts website and a customer can choose a vehicle model and I've changed the products ...
1
vote
1answer
45 views

How to add custom button in sales orders grid page in admin magento 2

I want to add a new custom button to the sales order grid pageactions, i was trying creating Plugin for "Magento\Backend\Block\Widget\Button\Toolbar" but in the grid containers this block is not used, ...
0
votes
0answers
14 views

Intercept any exception

how are you? So, I've been work in integration between Magento 2 and Microsoft Azure Application Insights to log the errors. There is the possibility to listen to all the exception that can occur in ...
4
votes
1answer
44 views

On what basis we need to pass the plugin parameters?how we know what should be pass?what's logic behind it?

My requirement is here:- I have a Game booking requirement in Magento 2, just like online movie booking(e.g- booking movie from Bookmyshow, Paytm etc). there is fix number of tickets in each slot ...
1
vote
3answers
47 views

hiding products for guest user M2

I have one question about showing products. I dont want to show products for guest user. Even when they search for those products they will not get that. Only logged in user will get those. Can ...
1
vote
0answers
18 views

How to save another data for Authorization Role in Magento 2

Hi Everyone i need help with this case. How can i save with a plugin with this additional data "Extra Data" ? Reference: How can i add this "extra-data" with the rest of the info of AUthorization ...
0
votes
2answers
22 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
27 views

Can't Override or Plugin Magento\Quote\Model\Cart\ShippingMethodManagement

I must be not understanding something. When I try to override or extend via plugin the Magento\Quote\Model\Cart\ShippingMethodManagement class it just doesn't work. Here's my code: frontend/di.xml &...
0
votes
1answer
26 views

After Plugin does not run at checkout

Recently I create two after plugins, one that point to Magento\Catalog\Pricing\Price\FinalPrice::getValue() and other that point to Magento\Catalog\Model\Product::getPrice() and Magento\Catalog\Model\...
0
votes
1answer
33 views

Adding custom layout handle for layouts (1 column, 2column etc) set via product admin page

I want separate layout handles defined for products dependent on their layout set via the layout options for product within admin (1 column, 2 column left, 2 column right). I need to set additional ...
1
vote
0answers
29 views

Magento 2 - CMS Specific page_layout XML and Dedicated page_layouts in general?

I'm looking for some BEST PRACTICES insight into using page_layout.xml. Is it a good idea to try and decouple the non-shared resources on Product Pages, Category Pages and CMS Pages? If so, what's the ...
0
votes
1answer
32 views

Cannot add custom topmenu link with plugin

I want to add custom links to the topmen / a submenu in the topmenu (I need the links for custom filters). To achieve this, I have created a plugin: app/code/Vendor/Module/etc/frontend/di.xml: <...
0
votes
1answer
22 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
28 views

skip function execution using before plugin

I'm overriding the controller Magento\User\Controller\Adminhtml\User\Validate::execute() using before-plugin so I can perform some checks before magento validate using this function. If certain ...
0
votes
1answer
28 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
66 views

Magento 2 plugin change price of products that have a custom attribute with

I'm trying to change the prices of products with a plugin. And it works, basically. The problem is this: i only need to change the price of products that have a specific attribute, not the price of ...
0
votes
0answers
47 views

Magento 2 store views hyphen/dash recommended solution

I'm not able to create store views with code/url like en-sa because of the backend validation: The store code may contain only letters (a-z), numbers (0-9) or underscore (_), and the first ...
1
vote
1answer
36 views

Magento 2 - Plugin to run only when function is called from specific module

Is there any way that I can specify that a Plugin X only runs when the class is called from Module Y? So that if same function is called from other modules the Plugin is not called.
0
votes
1answer
20 views

Redirect from around plugin in Magento 2

How to redirect from around plugin to another page with an error ?
0
votes
0answers
15 views

How to get Image data in Magento\Quote\Api\CartTotalRepositoryInterface using extension_attributes?

GET V1/carts/mine/totals This API Returns information for the cart totals a specified customer. How to get Item Images using extension_attributes on get function of Magento\Quote\Api\...
6
votes
1answer
193 views

Magento 2 : How to reload minicart from Plugin?

I've written plugin for Magento\Checkout\Controller\Cart::Delete Plugin works great and removed my desirable product from cart. As much as I know Minicart is render with local storage. So that we ...
0
votes
0answers
37 views

Customer Custom Attribute gets deleted upon update in Magento 2

We are facing an issue while updating customer information from Customer My account section on frontend that is Customer Custom attributes gets deleted upon update or save customer information. For ...
1
vote
1answer
53 views

Magento 2 get custom attribute of a single product inside a plugin

Hello Everyone :) I'm in a bit of an empasse now: I'm building a module to edit the price of products that have a custom attribute by multiplying their weight by a variable. Now, almost everything ...
0
votes
0answers
25 views

How to load vendor files in custom extension

Im making a custom extension - how do I load custom vendor files ? Do I add them to my extension composer file or the global Magento one ? I asking because I cant load Yaml. In my extension ...
0
votes
1answer
54 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
15 views

Magento 2. Custom text in place of Price is not working Properly

In custom module I hide the Price and in the place of Price I tried to show Custom text it work perfectly but in some Categories it shows the custom text twice e.g men, Women. I can show the details ...
0
votes
0answers
11 views

Project results change event in JS

In Javascript or Jquery is there an event that can be watched to see if the product results set has been changed or filtered because sometimes the window does not reload and my plugin login does not ...
2
votes
0answers
31 views

Magento 2. how to hide price only for specific categories

Actually I hide the price using Plugin but now I want to hide price only for specific categories like I only want to hide the Price for bags. I want to do this thing by using Admin configuration like ...