Skip to main content

Events, plugins and extension points

Overview​

This page lists the places where your module can hook into EasyQuote 1.7.5: the events it dispatches, the admin editor slots your admin pages must respect, the HidePrice Pro exemption registry and the Create Order policy. The full list of EasyQuote's own observers and plugins is in the module's etc/events.xml and etc/di.xml files and in their copies under etc/adminhtml, etc/frontend, etc/graphql and etc/webapi_rest.

Events EasyQuote dispatches​

Event Dispatched by Payload Notes
mm_easyquote_quote_prepare_save Admin quote save (Controller/Adminhtml/Quote/Save) quote (the EasyQuote quote), request (the HTTP request) Before the editor saves a quote
mm_easyquote_quote_prepare_save RequestToQuoteInterface::convert() model (the new quote), request (the EasyQuote quote request) Before a request becomes a quote. Same event name, different keys.
mm_calculate_product_price_options Price and convert helpers, admin quote save product, qty, base_price, new_price_name; the admin quote save adds mm_quote Write the price with custom options to the product under new_price_name
eq_request_message_file_delete Request message file resource model file While an attachment of a request message is being deleted: the file is already removed from disk, the database row isn't yet
eq_request_message_file_tmp_delete Temporary upload resource model file While a temporary upload is being deleted: the file is already removed from disk, the database row isn't yet

etc/events.xml also observes easyquote_cart_add_items_after, but nothing in 1.7.5 dispatches it. Don't rely on it. EasyQuote also dispatches some Magento events itself: customer_register_success and customer_login when a request creates a customer account, and sales_quote_collect_totals_before and sales_quote_address_collect_totals_before while it totals a quote.

Editor slots​

Every quote editor page in the admin has its own working cart, so several quotes can be edited at once in different browser tabs. The working carts live in slots in the backend session. Three admin observers manage them:

Event Observer What it does
controller_action_predispatch Observer\Adminhtml\ActivateEditorSlot Editor pages open a slot. Editor actions resume the slot named by the eq_editor_token parameter, or by the token in the Referer URL. A slot action with no slot gets a detached empty cart. Every other admin action gets Magento's own order session back.
controller_action_postdispatch Observer\Adminhtml\CaptureEditorSlot Stores the working state of the request in its slot
controller_front_send_response_before Observer\Adminhtml\FinishEditorSlot After the response is rendered, stores the slot and restores the session that Magento's order pages and other modules left

Editor pages are easyquote_quote_edit, easyquote_quote_newaction and easyquote_quote_create_index. Editor actions are easyquote_quote_save, easyquote_quote_savesession, easyquote_quote_create_loadblock, easyquote_quote_create_configureproducttoadd, easyquote_quote_create_configurequoteitems and easyquote_quote_cancel.

What this means for your code:

  • A third-party admin order editor works on Magento's own order session as usual. Outside the actions above, EasyQuote leaves that session alone.
  • If you add an AJAX action to the quote editor, send eq_editor_token with it. An action that isn't on the list above runs on the native session, not on the editor's cart.
  • etc/di.xml gives the backend quote session its own storage namespace, adminhtml_mm_easyquote.

HidePrice exemption registry​

HidePrice Pro 3.1.5 and later keeps products with a hidden Add to Cart out of the cart. Its registry MageMe\HidePricePro\Model\QuoteItemExemption lets other modules vouch for a cart line. EasyQuote registers its checker in etc/di.xml:

<type name="MageMe\HidePricePro\Model\QuoteItemExemption">
<arguments>
<argument name="checkers" xsi:type="array">
<item name="easyquote" xsi:type="object">MageMe\EasyQuote\Model\Quote\HidePriceProExemption</item>
</argument>
</arguments>
</type>

A checker is any object with this method:

public function isExempt(DataObject $buyRequest, CartInterface $cart, int $productId, ?CartItemInterface $item = null): bool;

$item is null while the product is being added, and the cart line when a cart is checked. EasyQuote returns true only for a line that comes from an Approved, unexpired quote of the cart's customer, and only for a product that is a line of that quote. Add your own checker under another item name; any checker that returns true exempts the line. The storefront effect is described on Buy products with a hidden Add to Cart through an approved quote.

Order creation policy​

MageMe\EasyQuote\Model\Quote\CreateOrderPolicy::getMode(QuoteInterface $quote): ?string decides whether the admin may create an order from a quote. The Create Order button and the Create Order action both ask it.

Returns For
direct (MODE_DIRECT) Approved and Proposal Accepted quotes that aren't internal
override (MODE_OVERRIDE) Expired and Proposal Expired quotes. Internal quotes in Approved, Proposal Accepted, Expired, Proposal Expired, Draft or Pending. The admin must confirm the override.
null Every other status: no order

The class is not an @api interface. To change the rules, add an afterGetMode plugin. The order placement observer checks the mode again, so the plugin applies to the button and to the order itself. Which statuses allow an order, and what the admin sees, is on Create Order from the admin.

What's next​

Applies to EasyQuote 1Last reviewed November 28, 2026