New answers tagged event-observer
0
votes
I am confused which observer should I use for an order placed event in magento 2?
I want to suggest 2 events which detailed scope and information:
checkout_submit_all_after: I will be going with this if I just need to get order information.
sales_order_place_after: I will be ...
1
vote
Accepted
Magento 2.4.2: The following modules are outdated: Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1
Keep your database backup before do it.
delete your module entry from setup_module table.
Ex.
SELECT * FROM setup_module where module = "Perfectmakeupmirrors_PmmHead";
delete FROM ...
1
vote
Accepted
Magento 2.4.2: observer class not getting invoked on event layout_load_before
The event name is correct and it should work. It is better to debug in where "layout_load_before" event is defined which is shown below.
vendor/magento/framework/View/Layout/Builder.php: ...
1
vote
Magento 2.4.2: observer class not getting invoked on event layout_load_before
The class name you mentioned in events.xml is different from the one you uploaded.
Please change events.xml to include instance as below
instance="Perfectmakeupmirrors\Order\Observer\...
0
votes
Magento 2.4.2: How to find out if it is category page in the observer class?
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Registry;
class Noindexfollow implements ObserverInterface
{
protected $request;
protected $registry;
protected $...
0
votes
Setting a custom item subtotal when adding product to cart?
Check to see if $item->getQuote()->getId() gives a valid quote ID. If it does not then you may not have access to the quote itself and can try adding:
use \Magento\Checkout\Model\Cart;
...
/**
...
0
votes
Magento 2: Get extension attributes data before customer address is saved
Have you correctly declared the extension attributes via extension_attributes.xml? You will have to declare verification_status along with the expected type for Magento\Customer\Api\Data\...
1
vote
Accepted
Magento 2 passing parameter from observer to itself
You can use the "normal" php Session.
// SET PARAMETER VALUE
$_SESSION['PARAMETER_NAME'] = SOME OBJECT
// GET PARAMETER VALUE
$value = isset($_SESSION['PARAMETER_NAME']) ? $_SESSION['...
0
votes
Magento2.4 - stock quantity deducted twice in observer
you should not use sales_order_place_after event for quantity update, that event will fire on every save statements Ex. $order->save().
try with "checkout_submit_all_after" or
"...
0
votes
Magento2.4 - stock quantity deducted twice in observer
Are you using Multi Source Inventory feature in magento?
If yes, it would automatically reduce the saleable quantity of an item when the order is placed.
Magento uses reservations to calculate and ...
0
votes
Magento2.4 - stock quantity deducted twice in observer
Go to Admin Panel's Configuration and disable Decrease Stock When Order Is Placed in the Stock Options
Stores->Configuration->Catalog->Inventory->Stock Options->Decrease Stock When ...
Top 50 recent answers are included
Related Tags
event-observer × 2102magento2 × 783
magento-1.9 × 471
module × 123
magento-1 × 105
orders × 102
product × 98
cart × 95
checkout × 92
sales-order × 91
customer × 85
magento-1.7 × 82
magento-1.8 × 72
magento-2.1 × 63
magento2.3 × 62
php × 60
quote × 56
addtocart × 53
plugin × 52
redirect × 48
layout × 46
adminhtml × 42
admin × 41
price × 38
product-attribute × 34