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).

0
votes
1answer
22 views

Magento 2 How to prevent product save with custom condition using plugin 'aroundSave'?

I want to prevent to save the product with my custom condition, for that, I want to use the plugin with method 'aroundSave', When the user clicks on 'Save & Duplicate' button I do not want to ...
2
votes
0answers
18 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
28 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"...
2
votes
1answer
44 views

Magento 2 developer mode doesn't generates Interceptors

If a class has plugins and the deploy mode is set to developer the ObjectManager is supposed to generate an Interceptor of the class as needed. That's what happens when running bin/magento setup:di:...
1
vote
1answer
24 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="...
2
votes
1answer
75 views

Upgrade magento 2.2.3 to 2.2.8 fatal error

Hi I upgrade my magento 2.2.3 to 2.2.8 where I have some custom functionality for emails. After upgrading am getting Fatal error: Uncaught Error: Call to undefined method Magento\Framework\Mail\...
0
votes
2answers
35 views

Plugin not working in magento 2

Vendor/Work/Plugin/ShippingInformationManagementPlugin.php <?php namespace Vendor\Work\Plugin; class ShippingInformationManagementPlugin { const XML_PATH_EMAIL_RECIPIENT = 'contact/email/...
2
votes
0answers
31 views

Magento 2 Save custom customer address attribute in customer edit form using extension attributes

I want to save custom customer address attribute in Customer Edit Form under My Account section. I have created an attribute using Setup script and save that attribute using extension attributes. ...
0
votes
0answers
14 views

Override product load via plugin

I'm looking to insert some functionality before the admin product page is loaded on /admin/catalog/product/edit Which class would I be looking for in order to override it with a plugin please? ...
0
votes
0answers
33 views

before plugin parameter magento 2

I am writing a before plugin for below public method. public function setup($user,$pass,$url = null){ $this->username = $user; $this->password = $pass; if ($url) { ...
1
vote
2answers
33 views

Plugin wont set Stock level and status - Module wont fire on Product Load

Please advise on this I'm trying to update a stock level and status via a seperate API, and will code that when I get this working, however, I'm struggling to even set the Stock status and count to ...
0
votes
1answer
36 views

Magento 2, get field backend model by path

I'm making a plugin for the Magento\Framework\App\Config\ScopeConfigInterface file. I need to get the config value from database. Right now, I manage to accomplish this, but I'm having an issue with ...
0
votes
1answer
49 views

Magento2 update cart on qty change event plugin created

My website i have updatecart on qty btn change event call so with ajax how to created a plugin for this.
6
votes
2answers
89 views

Does <sequence> also affect the load order of plugin?

According to magento devdocs declares the list of components that must be loaded before the current component is loaded. It’s used for loading different kind of files: configuration files, view ...
0
votes
1answer
21 views

Extension point for set website ids product in case admin not set website

This is my scenario I have hidden website_ids field in product form (default magento show it) So how i can use plugin for set website ids for product when it create. Is there any entry-point to do ...
0
votes
1answer
16 views

Magento 1: Email Marketing

I have a virtual store in magento and I want to know which is the best plug-in email marketing or platform that can be synchronized with magento 1, to do: an automatic email to send when the customer ...
0
votes
0answers
11 views

How can I return custom products to catalog search result in Magento 2?

I am developing a custom search engine for my Magento 2 store. How can override the products returned in catalog search result with a custom plugin ?, and Can I override the result without changing ...
2
votes
1answer
53 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
76 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
30 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
38 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
53 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
47 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
10 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
28 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
61 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
32 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
25 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
57 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
30 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
34 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
56 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
22 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
99 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
42 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
23 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
37 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
205 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
16 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
61 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
65 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
20 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
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
49 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
27 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
44 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
32 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
43 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: <...