tester
tester

Reputation: 3987

How to know if user is in checkout?

In Magento I have an observer which listens to the sales_order_save_before event. This event is called before the order is saved. This happens in the checkout before the success site AND in the backend if you save the order there.

I only want the logic to run in the checkout not in the backend. So, how can I check in my observer if the user is in the checkout?

Upvotes: 1

Views: 966

Answers (2)

Fabian Blechschmidt
Fabian Blechschmidt

Reputation: 4141

You defined your observer in

<config>
    <global></global>
<config>

If you define it in

<config>
    <frontend></frontend>
<config>

is only runs in frontend.

Upvotes: 3

Related Questions