Questions tagged [plugin]

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

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

Plugin with custom API call in Magento 2.3

I have a question that whether we can make functionality in which we want to update the product stock when the product detail page is loaded. For that, I am using Plugin feature and I want to fetch ...
4
votes
1answer
60 views

Magento 2 :How to change or update request data using beforeExecute plugin?

i just want to change some request params by using beforeExecute plugin so can i do same.... ? etc/di.xml ** <type name="Magento\Customer\Controller\Account\CreatePassword"> <plugin ...
2
votes
0answers
93 views

Reference to undeclared plugin with name 'stockedProductsFilterPlugin' warning in di compile magento 2.3.2

I have recently upgraded my site from Magento 2.2.6 to Magento 2.3.2. During each di compilation it shows a warning like main.INFO: Reference to undeclared plugin with name '...
0
votes
1answer
31 views

What are the three different kinds of Plugins available and their difference with observer in magento2?

I want to know the different kinds of plugins, their utilities and difference along with their difference with observer in magento2.
2
votes
0answers
56 views

Magento 2: How to get products data on admin product save plugin?

I am working on Admin Actions Log Extension. For the reference i am using link below https://amasty.com/admin-actions-log-for-magento-2.html I want to get old and new data of products while we save ...
1
vote
1answer
29 views

Plugin stop normal function

is there a way to cancel the normal function in a Plugin and show some message? Something like: public function beforeSet(\Magento\Quote\Model\CouponManagement $subject, $cartId, $couponCode){ $...
1
vote
1answer
29 views

Magento 2-Override FinalPriceBox using Preference or Plugin class of Configurable Product module

Anyone has idea how to make preference or plugin on Magento\ConfigurableProduct\Pricing\Render\FinalPriceBox class of Magento\ConfigurableProduct. Basically, new function i wanted to add in the ...
2
votes
1answer
25 views

get Coupon Code in beforePlaceOrder

Hello I want to get the coupon code in a plugin. My code is: private $logger; private $checkoutSession; public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Checkout\...
1
vote
0answers
22 views

what things and concept i should learn before learning magento 2

I am a php , html , css , javascript developer and i have worked on wordpress , laravel also , now i am learning magento 2 and i am not understanding most of the things . i want to know what concepts ...
0
votes
2answers
31 views

Netbeans plugins for development in magento 2 [closed]

Does anyone know what are the best netbeans plugins to develop in magento 2? It would be very useful to have a list of the best plugins and to know what they do, since I haven't found a guide on ...
0
votes
0answers
14 views

Is there something like Wordpress' advanced custom fields plugin for magento 2

ACF is a WordPress plugin, there's a free and paid version, 1 time payment, which let you add any field in the backend and echo it in the front-end among many other things. The company I work for ...
0
votes
1answer
18 views

How to add a pay until date to invoice in Magento2?

Please excuse me if I am asking a dumb question, but I am new to Magento and frankly, my first impression is that it is over-designed and poorly documented. Maybe this is part of their business model, ...
1
vote
1answer
21 views

Coupon Plugin the cart is shown as empty

I want to create a plugin to hook into the CouponManagement System. I hook into beforeSet and it triggers but the cart is shown as empty, This is my code: protected $_quote; private $logger; ...
0
votes
0answers
16 views

Revolution Slider not working

i'm using revolution slider plugin for image slider in home page.it was working fine. but now when ever i open my site the slider do not load images, and also plugin is not showing properly in my back-...
0
votes
1answer
10 views

Trouble testing plugin with object manager

Issue: When attempting to test a plugin "after" method with $objectManager->create('Shopgate\Base\Model\Config')->startup(), the original startup() method is called but not my plugins ...
1
vote
1answer
30 views

Magento 2 REST API: extension attribute for saleability not working for some products

I needed product's stock status in the product listing API: V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=144 ...
0
votes
0answers
24 views

how i can get parameter value in plugin into magento 2 observer

i have plugin for customer account create public function aroundExecute( \Magento\Customer\Controller\Account\Create $subject, \Closure $proceed ) { $getid = $subject-&...
1
vote
1answer
34 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
34 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
31 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
55 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
28 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
118 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
49 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
89 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
15 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
51 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
41 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
63 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
71 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
96 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
24 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
17 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
14 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
62 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
1answer
112 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
47 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
61 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
83 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
31 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
86 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
38 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
27 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
98 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
38 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
52 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
100 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
22 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 ...