Questions tagged [plugin]
Denotes questions about Magento 2 Plugins (BeforePlugin , AfterPlugin and AroundPlugin). Plugins are also known as interceptors in the Magento documentation.
616
questions
0
votes
0
answers
23
views
Sometimes Magento 2 observers not getting executed after order place event
We recently came across an issue that sometimes all observers related to Magento 2 order created after event not getting executed.
We didn't found any similarities between such orders. This is very ...
0
votes
0
answers
17
views
Stripe Plugin\Context doesn't exist
Trying to install Stripe on local Magento 2.4 instance
I followed the steps here https://docs.stripe.com/connectors/adobe-commerce/install
But after installing it, Amin page breaks with Plugin class ...
0
votes
1
answer
21
views
Are Magento & Adobe Commerce the same integration?
I'm with a Payments Services Provider and we currently have a plugin for Magento. I've only now learned that Magento is now Adobe Commerce.
I have a potential client that's asked if we have a plugin ...
0
votes
0
answers
16
views
Help Finding Extension: Surcharge on product (M2)
We sell cleaning chemicals (B2B) and the state requires a VOC tax for each sale, which must be shown separately.
For accounting reasons, we are looking for a more specialised solution. Simply charging ...
0
votes
0
answers
20
views
Custom Attribute not saving into the Sales_Order Table
This is my PLugin :
<?php
namespace Vendor\Module\Plugin;
use Magento\Sales\Api\Data\OrderItemExtensionFactory;
use Magento\Sales\Api\Data\OrderItemInterface;
use Magento\Sales\Api\Data\...
1
vote
1
answer
60
views
Magento 2 extension submission to the marketplace was failed
"command": "composerConfigRepository0",
"output": [
"Finished with the '0' exit code."
...
2
votes
1
answer
231
views
Error: Cannot instantiate interface Magento\Catalog\Model\Layer\ContextInterface Magento Plugin
I've created a plugin in Magento 2.4.5 to overwrite Magento\CatalogSearch\Model\Layer\Filter\Price 's method.
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/...
0
votes
0
answers
24
views
Magento 2 Compile Void on <directory> in line 20
I have updated one of my plugin versions (payment plugin) to the most recent version and after running bin/magento setup:upgrade i run the comand : bin/magento setup:di:compile which gives me the ...
0
votes
0
answers
112
views
How can I set a different home page depending on customer group (including people not logged in) on Magento 2.4?
I want to change homepage based on customer group.
I tried defining a plugin in this post Magento 2: Change hompage on login , But it doesn't seem to work for me.
I could override the CMS default ...
0
votes
0
answers
43
views
How to Bundle products based on customer selection?
What is the best approach to achieve a step-by-step walkthrough experience, prompting customers to select items from 3 categories and sell them as a bundle with a single dynamic price during checkout?
...
0
votes
2
answers
58
views
Before Plugin asks for the class argument
I am new to Magento and following a course, yet some things hold me back. I really want to learn it but my only duties are as a frontend developer. If you could guide me through this problem it would ...
0
votes
2
answers
41
views
Magento 2 - Class doesn't Exists when compiling
I tried to create a simple plugin (magento 2.4.3-p1) :
But when I run the compiler, I have the following error :
In PluginListGenerator.php line 326:
Plugin class Fseb\ModuleA\Plugin\Catalog\Model\...
1
vote
2
answers
110
views
Magento 2 - after Plugin for \Magento\Csp\Model\Policy\FetchPolicy not working
Why is my plugin not getting called?
app/code/Company/Configurator/etc/module.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
1
answer
26
views
Plugin for Magento\Setup\Model\ConfigOptionsList::validate
Is it possible to make a plugin for Magento\Setup\Model\ConfigOptionsList::validate()?
This function checks the validity of connection to DB and since I am dynamically generating password for DB, I ...
0
votes
1
answer
133
views
2.4.6: Filter available attribute sets according to product type, using a plugin
In my custom plugin, the InstallData.php script creates a custom attribute set. For the purposes of this Q&A, we will call it 'Custom Attribute Set #1'.
I would like the attribute set to only be ...
0
votes
1
answer
74
views
Magento2 How to translate City names in the Arabic language
How to translate City names in the Arabic language.
here is the screenshot.
https://i.imgur.com/2UVdzrJ.png
I can not translate city names on my account page.
0
votes
3
answers
662
views
How can I remove a condition from a collection
I tried to use two methods to reset or clear the collection but it didn't work.
I am working with the category collection on which I want to remove this part of the condition : (e.created_in <= '...
0
votes
1
answer
39
views
How i override or create plugin product applier?
I am trying to create plugin product applier but not succeed.
I am trying to send email when content goes live, so i schedule product and goes live then send a push email
when i send 10 product update ...
0
votes
1
answer
31
views
How to use plugin for Magento\Cms\Controller\Adminhtml\Wysiwyg\Images\Thumbnail execute() function
I want to put an around plugin.
This is the core file
vendor/magento/module-cms/Controller/Adminhtml/Wysiwyg/Images/Thumbnail.php
The main purpose is on the execute function I want to upload a custom ...
1
vote
1
answer
176
views
magento 2 : How to create module in pwa studio
Regarding pwa module development
How to create module in pwa studio?
how we can apply current custom magento plugin in pwa ??
0
votes
0
answers
178
views
Hot to create plugin for savePaymentInformationAndPlaceOrder method
This method is calling at checkout step but with plugin using after method it's not calling, core method is calling.
etc/di.xml
<type name="Magento\Checkout\Model\PaymentInformationManagement&...
0
votes
0
answers
271
views
Magento 2.4 : How to save delivery comment in order and in database?
I'm using Magento 2.4.4 and PHP 8.1 . How can i use the order comment as show in screenshot but use it in shipping method as delivery comment and save comment in sales_order "e table?
I have ...
0
votes
1
answer
200
views
Plugin SortOrder
I was reading plugin documentation and I was wondering, if there is a plugin with SortOrder=0 how can i excute another plugin before that one, would SortOrder=-1 work? Is that a bad practice? Is there ...
1
vote
1
answer
177
views
Can I use sitemap_products_generating_before event to modify Product Sitemap in Magento2?
In Magento 1, sitemap_products_generating_before event allows us to modify the Product Sitemap.
Can I use sitemap_products_generating_before event names in Magento 2.4?
I want to filter the product ...
0
votes
2
answers
902
views
Magento 2 Certification Question - How can a developer prioritize a plugin's execution, if possible?
How can a developer prioritize a plugin's execution, if possible?
A. The developer can use sortOrder property by specifying a higher value than the target plugin.
B. This cannot be achieved as the ...
1
vote
2
answers
468
views
Magento 2 - Send data into a new quote_item column from an API call
I have added a new column in quote_item table and want to add this field as a parameter in cart API payload but I don't how this will happen.
This is what I get when i try to hit add to cart api.
...
0
votes
2
answers
309
views
How to override CartItemInterface class in in my custom model?
I have to add 2 new methods getter and setter in CartItemInterface but i am facing issues.
Basically I have added a new column in quote item table and now I want to add this column in cart api.
Please ...
0
votes
1
answer
325
views
Change the variable to the coming function from before plugin
I would like to change the variable - $validate to false from before the plugin. May I know how to do it?
app/code/MyModule/ReviewCheck/Plugin/ReviewModel.php
<?php
namespace MyModule\ReviewCheck\...
0
votes
1
answer
269
views
How can i get order data using credit memo plugin in Magento 2?
Here I used the credit memo plugin for updating the order data after refund success so how
can I get order data in that function?
etc/adminhtml/di.xml
<?xml version="1.0"?>
<...
2
votes
2
answers
4k
views
Class "Magento\Framework\Component\ComponentRegistrar" not found in setup/src/Magento/Setup/registration.php:9
When I run "composer install or "composer update" command from my magento 2.4.5 root folder I am getting this error.
- Installing laminas/laminas-dependency-plugin (2.4.0): Extracting ...
1
vote
0
answers
198
views
Custom Validation rule doesn`t works in shipping address
Hi dears I have going crazy to add a custom validation to vat field.
I tried several ways, but I don't get an solve, I don't know why?!
I have a module Vendor/module
i have create a custom rule ...
0
votes
3
answers
83
views
How to override taxvat.phtml
Hi dears I want to override taxvat.phtml in vendor > magento > module-customer > view > frontend > templates > widget
Before I try to create a file Vendor > Module > etc > ...
5
votes
1
answer
2k
views
How can I change the shipping price at checkout with an observer or plugin?
The shipping method may be flatrate or FedEx or freeshipping, but I want to override this price with $1. How can I do this?
2
votes
0
answers
597
views
Magento 2 checkout, I need to display or hide a shipping method depending on if a coupon code was entered and is valid. How can I do this?
I have a price rule attached to the flat rate shipping method as an option, and I want to intercept when the coupon is added, so that I can hide this flat rate method unless the coupon code matches ...
0
votes
2
answers
218
views
override checkout index controller
I would like to override only one line in checkout/index/index controller.
do I need to use preference or plugin or observer?
if (!$this->_customerSession->isLoggedIn() && !$...
1
vote
0
answers
263
views
Magento 2.4 Plugin afterGetPrice() - issues with Full Page Cache
I am overriding the frontend price by using the Magento\Catalog\Model\Product plugin like so:
Sulman/Mymodule/etc/frontend/di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...
0
votes
1
answer
566
views
Magento 2: How to override the core interface and add a new constant?
I need to extend the core interface Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface and need to add a new constant but when I override the interface via preference its not working. When I ...
0
votes
1
answer
524
views
Order Updated At Date same as Created At
I am using the after plugin for the Place method following this link https://www.rakeshjesadiya.com/create-plugin-after-place-order-action-checkout-magento-2/
But I get the order updated at the date ...
1
vote
0
answers
309
views
Magento 2.3.7-p3 Unable to save extension attribute to Quote Item
I want to show customers how many 'points' they could be making, per quote item, on each item row of the basket. Using extension attributes, this is what I have:
di.xml
<type name="Magento\...
0
votes
2
answers
896
views
How to change the parameter being sent using a Before Plugin?
I have a before Plugin that runs when a customer data is updated thru the admin. When "save customer" is clicked I need to update the values of some of the fields (like customerID) the form ...
1
vote
2
answers
250
views
Observer that runs when an order is attempted to be created in the Admin
I need to create an observer or plugin or something else that will run when an order is attempted to be created through the admin. I added a custom attribute for customers (offline/online). If the ...
0
votes
1
answer
22
views
Include shipping on quote item not quote
What I'm trying to achieve
During the checkout, if the customer has a Bike item in their basket, we want the shipping cost to be added as a product option to the cart item as opposed to being added to ...
0
votes
1
answer
173
views
Magento 2 Category rule and override the cart file by plugin
how do I can set up a rule in Magento 2 by category, If need to do something like this:
I one product that is from one category is added to the cart then the customer can't add any product from ...
0
votes
2
answers
488
views
Magento 2 - automatically set product as new when CREATING product only
I want Magento (2.4) to set newly created products as new for specified period of time but only when product is created and not saved after being edited...
So, I would need something very similar to ...
0
votes
2
answers
92
views
Magento 503/500 errors when products collection accessed
I have created a Magento (2.4) extension, which creates a custom product listing page in a specific route.
It works well and loads a product listing with all products.
Then I added following plugin ...
0
votes
1
answer
287
views
How can I intercept a sale order created from within the admin panel in Magento 2?
I need to write data to an extension attribute after the order is created from within the admin panel. The extension attribute is the admin user's first and last name. How do I intercept this the ...
1
vote
1
answer
295
views
How to intercept customer order in Magento 2?
When an order is submitted, I need to write data to extension attributes. I need to either create an event observer or plugin. How do I do this the right way?
0
votes
1
answer
888
views
Magento 2: How can I add new field and save data to newsletter database table?
How can I save data in a new field in newsletter table of database? This is how I created my module based on other answers, but no one of aproaches worked. The fields of column c_firstname is always ...
0
votes
2
answers
913
views
Magento 2.4: Which event triggers when the category page is loaded in magento2?
I want to know which event is triggered when a category page is loaded from the megamenu?
I want to load a custom collection of data based on a particular category.
0
votes
1
answer
917
views
How do I extend/override \Magento\Theme\Block\Html\Topmenu::_getMenuItemClasses?
I cannot find it di.xml. Any ideas?
I want to add a custom css class to specific TopMenu items. I don't know how to extend this.