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
2answers
46 views

Interceptor Plugin for Product Attributes

I'm trying to modify the "short_description" attribute using a plugin but I can't seem to get it to work across the whole website. I can do this on the product view page with the following but I don't ...
0
votes
1answer
38 views

Magento 2.3 : Create plugin of __call method

I need to create plugin for this below file : vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php There are __call function in this file : public function __call($name, $arguments) { ...
1
vote
0answers
22 views

Magent2.3: Advanced Seacrh is not working

I have installed the Amasty Advanced search module in Magento 2 cloud and its not working, I'm getting the below error in the log: [app/code/Amasty/Xsearch/Helper/Data.php:144]\n#20 Amasty\...
0
votes
1answer
42 views

How to redirect to cart after adding product to cart programmatically

I want to redirect to cart page after adding the product into cart, I know there is a provision in config but I have a custom product type and that config is not working for that product. That ...
0
votes
0answers
21 views

How to validate data before shipping

I need to validate data before shipping the product (match order vs and shipping SKU, shipping qty vs qty remain to ship, etc..) I created a plugin to validate but it's not working, below is my ...
1
vote
1answer
35 views

empty or # link for my account

I need to set My account link to be # . It shouldn't redirect anywhere. There's a possible way to set it as # using plugin in module. But I want to do it in theme. Is there's a way to achieve in ...
0
votes
1answer
23 views

How do I get the base object from within a plugin?

How do I get the object that my plugin is attached to from within an after plugin? I thought it would be the $subject parameter, but that doesn't seem to be it. My plugin is defined like this di....
0
votes
0answers
22 views

Magento 2. Change image position in list plugin

I use Magic_360 in my magento 2. It is ok, but it show it's 360 picture first in fotorama. I am trying to write plugin wich move this picture to the second position. Files: /app/code/NickNick/...
0
votes
3answers
63 views

Magento 2.3, Get the order status before and after change using the plugin?

In Magento 2.3, How to get order statuses, before and after change using the plugin?
1
vote
1answer
42 views

Magento 2 how to restrict add wish list a product

I would like to stop adding products to the wishlist based on the product attribute how to do that? I would like to use the plugin concept instead of overriding the entire controller file. Magento\...
3
votes
1answer
44 views

How to override .phtml file in module?

I am trying to change sign in or create an account message which is called by block named product.review.form in catalog_product_view.xml. /vendor/magento/module-review/view/frontend/layout/...
2
votes
1answer
45 views

Plugin intercept before place order for PayPal method on Magento2

In my Magento2 instance, I created a Plugin interceptor for run custom validation before process the payment. Works for all payment methods but PayPal Express or PayPal Standard. di.xml <config ...
0
votes
0answers
14 views

Product view page image is loading slowly after adding buy now plug in

The image of the product view page is loading very very slowly after adding the buy now button from a plugin. How can I make the image loading fast?
0
votes
0answers
39 views

Magento2 : How to validate cart rule using plugin?

I was trying to validate the cart rule using plugin, but not able to do this, here I am explaining my approach in form of code files, please let me know how to do this. app\code\Vendor\Module\Plugin\...
0
votes
1answer
42 views

how can a buyer and vendor can video chat with each other

i'm creating a magento 2 store in which my client want me to add a feature where a buyer can video chat with the vendor regarding product details. Can any one tell me how can i do that?
1
vote
2answers
125 views

Magento 2 core session variable unable to fetch first time when user comes from 3rd party website

We have to fetch and set a session variable when the user redirects to our magento2 website using session-id from 3rd party site. It looks like http://magento2.com/?SID=322e00bfqm3g6rfpjumah3939n ...
0
votes
0answers
19 views

How can I use a block I created in my plugin to be used as a CMS block?

What am I trying to achieve? I want to show a block of my plugin on every product page of a specific category. What my problem is right now. In the Magento CMS you can add XML layout to a category ...
1
vote
1answer
29 views

How to set value of property of Class B using Plugin (Class A)

di.xml <type name="Magento\Sales\Model\Order\Invoice"> <plugin name="Vendor_Module::InvoiceIncrementId" type="Vendor\Module\Plugin\InvoiceSaveBefore" /> </type> Plugin code: ...
1
vote
2answers
88 views

Update item custom quantity and salable quantity value after place order in Magento 2

I need to decrease purchased item saleable quantity with custom value (x* ordered_qty) after place order in Magento 2.Right now I'm using the following observer and class to update the quantity of ...
2
votes
1answer
42 views

Cart page fatal error after creating a product collection plugin, Magento 2.3

We have a need to sometimes fetch product prices from an API for products loaded on the frontend. We figured it would be easiest to create a plugin for the collection: <?xml version="1.0"?> <...
0
votes
0answers
26 views

Change Zip/Postal Code field to drop down in Magento 2.2.x Checkout using custom module

I want to change the Zip/Postal Code input field to dropdown in magento 2 chckout page. Also I want to change its label. I want the above to be done using a custom module. This is what I did: I ...
0
votes
2answers
65 views

Magento 2.3: Redirect the customer to a custom page after logging in is not working

I'm aware, by default, Magento 2 provides us with a feature, that allows redirecting the customer to account dashboard after logging in, we can enable this feature by going to Stores → Settings → ...
0
votes
1answer
23 views

Toolbar not showing in overridden catalog list block

I have this in my di.xml <type name="Magento\Framework\View\Element\AbstractBlock"> <plugin name="easymart_inject" type="NameSpace\Module\Plugin\CategoryPlugin" /> </type> ...
2
votes
0answers
27 views

Magento2 - update to custom status after shipment creation

I created an Observer that makes some execution based on the company needs using event sales_order_shipment_save_after. It does everything I need except changing the order status to a specific. I ...
0
votes
0answers
24 views

Magento2 - Listen for order new comments

I am trying to create some kind of observer that will listen for new order comments and execute the function every time a comment is added. I tried three ways that did not work for me: Observer ...
0
votes
0answers
19 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
1answer
20 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
28 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
27 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
24 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
17 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
56 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" ...
1
vote
1answer
51 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
55 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
22 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
224 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
116 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
221 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
62 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
50 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
190 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
44 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
40 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
61 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
26 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 ...
5
votes
1answer
196 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
1k 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
35 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
146 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 ...

1 2 3 4 5 9