The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [plugin]

Denotes questions about Magento 2 Plugins (BeforePlugin , AfterPlugin and AroundPlugin). Plugins are also known as interceptors in the Magento documentation.

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

get checkout value for new field Magento 2

I have created a field in Frontend which is a datepicker. I have used a plugin <type name="Magento\Checkout\Block\Checkout\LayoutProcessor"> <plugin name="date_picker" type="Module_Name\...
0
votes
0answers
7 views

Grouping customers under a parent account in Magento 2?

I am looking for a solution that will allow me to create a parent account(B2B Unit) and be able to create customer's accounts associated with the parent. It is required that the customers use the ...
0
votes
0answers
20 views

Sorting products based on a custom attribute Magento2

I have a plugin that adds some custom product sorting, based on a customer attribute, in a way similar to below. # Vendor\ModuleName\Plugin\Product\ProductList\Toolbar; case 'capacity_low_to_high': ...
0
votes
0answers
17 views

Magento 2 : Add custom data in product attribute using plugins

I want to add custom data of product attribute using plugin. Path : stores -> product -> edit attribute and save record. Class : Magento\Catalog\Controller\Adminhtml\Product\Attribute\Save I ...
0
votes
0answers
15 views

is it possible to add a plugin for Magento\Framework\Filesystem\Driver\File class?

I have tried to add around plugin on Magento\Framework\Filesystem\Driver\File::readDirectory method but couldn't succeed. <type name="Magento\Framework\Filesystem\Driver\File"> <plugin ...
0
votes
1answer
14 views

How to call static block into plugin Processor php file in magento2

How to call the static block into magento2 plugin processor php file. thanks
0
votes
1answer
32 views

How to run CLI Command on the product Save/update in Admin Magento2

How I can run an indexer command after save or update the product in the admin through any observer or any plugin? I want to run bin/magento wyomind:elasticsearchcore:indexer:reindex product command ...
1
vote
1answer
25 views

Magento 2 how to lock a customer account when it's in an specific group?

I have been searching how to lock a customer account but had no luck. My idea is to create a customer group called Locked, and every customer that is assigned to that group will be locked. I was ...
1
vote
0answers
30 views

Magento2 override customer name.phtml plugin, but it was not display, Pls help to check any wrong in this? Thanks

I want to override Magento2 Customer module firstname + lastname to lastname + firstname, I don't want to modify M2 orignal files,so made this plugin,but it wasn't desplay, Pls help to check any wrong ...
0
votes
1answer
19 views

How to install plugin for single store in multi store setup?

I have a plugin, that I only need installed against a single store in a multistore Magento 2 setup. Installing via composer appears to install the plugin globally across all storefronts, I can work ...
1
vote
1answer
64 views

How to Override WishList Customer Data in magento 2

i Want to Override Magento\Wishlist\CustomerData\Wishlist public function getSectionData() { $counter = $this->getCounter(); return [ 'counter' => $counter, ...
1
vote
1answer
58 views

Magento2.3.2 - Geo IP Location

Is there any plugin available for automatic detect customer current Geo location in Magento2.3.2 ?
0
votes
3answers
58 views

Magento 2 plugin for sending email when change customer's group

I created a Plugin for sending emails when the owner of the shop changes the customer's group in backend. I still need to add the group (discount) in the email. The problem is that when I access to a ...
0
votes
0answers
58 views

plugin for contact form magento2

im trying to make plugin for contact form to send email with the fields: first name last name phone comment email last name email phone comment Here my code <?php namespace Convert\...
0
votes
2answers
33 views

plugin for custom field for contact form magento2

I want to create plugin for contact form with two custom fields first-name and last-name to send email. anyone can help with this? Thanks in advance. in di.xml <config xsi:...
1
vote
3answers
68 views

Order beforeSave plugin throws TypeError

I've built a plugin that catches the order beforeSave event in order to add some extra data to the an order attribute. The problem is that when this plugin fires it causes an error: Uncaught ...
0
votes
0answers
35 views

Magento2 : Plugin for send email function

i'm trying to make plugin to custom email function, i need to create two field more first name and last name.I need to use plugin to get value of the first-name and last-name. When sending email, the ...
0
votes
0answers
38 views

How to create an extension for Magento 2

I want to create an extension to Magento 2, but I cannot find any information. I need to create an extension that can be installed in Magento 2 by downloading from the store or following the link. ...
0
votes
1answer
51 views

Magento2: How can update the product price using before plugin

I want to update the product price using plugin and I tried the afterGetPrice() plugin its working fine in normal case but showing wrong price calculation when catalog price rule applied, I want to ...
0
votes
0answers
25 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
77 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 ...
3
votes
0answers
750 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.
1
vote
1answer
39 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
79 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
32 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
26 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
56 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
18 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
27 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
28 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
22 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
13 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
60 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
29 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
42 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
53 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
56 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
78 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
30 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
166 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
68 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
314 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
22 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
161 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
57 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 ...
1
vote
1answer
127 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
114 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
118 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
25 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 ...