1

Custom made android & ios application has been created by using our Magento source code & database.

Since we are getting orders from different environments such as Magento website, Andriod & iOS app, we would like the differentiate the source of the order.

Please let me know the best way to differentiate the source of the order.

Thaks in advance!

3
  • have you created same store view for website, Andriod app & iOS app?
    – Abdul
    Commented Mar 2, 2017 at 13:25
  • Yes. Website, Andriod app & iOS app uses the same store view Commented Mar 2, 2017 at 13:52
  • @MuthukumarSivasamy - How you have created custom made android & ios application has been created by using our Magento source code & database. Using any third party app or by own. If third party means then you can the developer to get the different environments details.
    – Vinayagam
    Commented Nov 10, 2018 at 6:25

4 Answers 4

0

To get the different source with order you have to create different store for each device.

And with the help of .htaccess file you have to redirect user on different store based on user agent. It will add the store information with order.

Like your main store is abc.com and for mobile device you have to create a new store and pointed on m.abc.com.

When user comes from mobile device you have to redirect the user on m.abc.com with the help of .htaccess.

1
  • We would like to differentiate the orders based on .apk & .ipa files. Commented Mar 2, 2017 at 14:04
0

You can do the following way:

  1. First add a custom field device_type in quote and order table.
  2. Then You save the value for device_type in quote before placing the order as web or android or ios accordingly.
  3. Then after placing the you can easily identify the platform by the help of that field.
0

You are talking about user agent, so magento by default does not provide this feature.

You can do it via php in $_SERVER ['HTTP_USER_AGENT']; variable you can get detail of user agent ,

so with the help of this $_SERVER ['HTTP_USER_AGENT']; variable you come to know weather this device is android, ios or Desktop.

In the sales_order_place_after event get user agent and save in your database.

just google how to addcutomfield in order in magento you get very good tutorial about that.

6
  • Will $_SERVER ['HTTP_USER_AGENT']; differentiates .apk and browser in andriod device (such as chrome, firebox & etc ) ? Commented Mar 2, 2017 at 13:57
  • I have try with browsers and it gives me firefox and chrome and all that you can try for apk as well. Commented Mar 2, 2017 at 13:59
  • As you suggested, let me try to differentiate the orders $_SERVER ['HTTP_USER_AGENT']; method for .apk & .ipa files. Commented Mar 2, 2017 at 14:07
  • We tried $_SERVER ['HTTP_USER_AGENT']; to get the source of the order. Can you please tell me, how to extract the accurate source of the order like Desktop browsers, Android browsers, iOS Broswers, .apk & .ipa? Commented Mar 8, 2017 at 8:20
  • @MuthukumarSivasamy h3xed.com/programming/… Commented Mar 8, 2017 at 10:35
0

What I normally do is create a separate store view to get the different locations. There won't be much difference, except that you can see from which platform the order is placed and the order numbers will start with a different number.

Stuff like stock, accounts and customer/order data can be shared between them, so you'll be fine.

All you need to do in the app, is make it "listen" to a different store ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.