Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differentiating Backend vs. Frontend Purchases in Magento

Is there a way to tell if an order was placed through the frontend of the web site or entered through the administrative panel?

like image 616
Chris Avatar asked Dec 31 '10 15:12

Chris


People also ask

Is Magento front end or back end?

Overview. The Magento frontend is designed to optimize storefront customization, with highly extensible themes being the central customization mechanism. Merchants are encouraged to use Magento components and themes to extend and transform the appearance of their storefronts.

What is backend model Magento 2?

Backend Model performs the loading, saving, deleting, validation of the attribute value. Source Model provides a list of attribute values, which is used for the dropdown/multiselect attributes. Frontend Model performs attribute mapping on the frontend.


1 Answers

By default, Magento only stores the remote_ip in table sales_flat_order for an order that is place by customer (while admin order is set to null).

So try this:

if(!empty($order->getRemoteIp()){
  //place online
}
else{
  // place by admin
}

See Programmatically differentiate between admin & customer-placed orders

like image 84
Renon Stewart Avatar answered Sep 23 '22 23:09

Renon Stewart