• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Hoffa25 · Mar 10, 2016 at 11:25 AM · in-app purchase

Unity in app purchase - Is there a way to localize price on products?

I have got everything to work well with the unity 5.3 in app purchase system, however I cant find a way to localize the price of my in app products in my store. On my button "buy sword" I want the price to be showed in the local currency. As it is now, the user has to click the button to see that (the android/apple pawment UI pops up with the localized price). Thats not very good user experience... So, how do I fix this? Do I have to buy a plugin? Wich one is best? // Erik

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image alonsoGarrote · Apr 01, 2016 at 10:09 PM 0
Share

Hi Hoffa25, could you make this work?, Im having the same problem, I tried using product.metadata.localizedPriceString but it doesnt show up anything on mobile, on PC it shows fake title, fake prices only.

avatar image alonsoGarrote · Apr 01, 2016 at 10:26 PM 0
Share

Ok, I made it work, it seams I was calling for prices before those were available, I tried calling prices in a FixeUpdate() and it worked...., now im trying to optimize or see where and when exactly I can call once for price data.

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by phil_me_up · Mar 10, 2016 at 01:40 PM

I've not used the Unity IAP system but it looks like this is what you're after: http://docs.unity3d.com/Manual/UnityIAPBrowsingMetadata.html

All you need to do is update the text on the button at an appropriate time (i.e. don't hard-code it).

Keep in mind that this probably won't work in the editor as the prices actually rely on the information being returned from Apple / Google, and this may not be possible within the editor. Basically, build to a device to test.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hoffa25 · Mar 10, 2016 at 03:33 PM 0
Share

Thanks for a very quick answer!

avatar image
4

Answer by Projekt-Krieg · Sep 22, 2019 at 08:36 PM

copy paste solution for everyone that finds this

add this to your IAPPurchauser.cs

 public string GetPrice(string productID)
     {
         if (m_StoreController == null) InitializePurchasing();
         return m_StoreController.products.WithID(productID).metadata.localizedPriceString;
     }

in the editor it will show "$0.01" but on a device it will show up.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TortoRacoon · Dec 03, 2019 at 02:33 PM 0
Share

Not all heroes wear capes (perhaps you do... I don-t know)

avatar image
1

Answer by getconnect2ali · Oct 27, 2020 at 09:36 AM

//For localisation currency according to the country.

     public static string GetProductPriceFromStore(string id)
     {
         if (m_StoreController != null && m_StoreController.products != null)
             return m_StoreController.products.WithID(id).metadata.localizedPriceString;
         else
             return "";
     }


Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

40 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to implement Mac App Store in-app purchase and receipt verfication? 1 Answer

What is the best way of handling an in-app purchase to unlock more scenes (Android)? 0 Answers

IAP dialogs don't display in fullscreen mode in OS X 1 Answer

iTunes store login popup shows every time I start the app. Suspecting Unity IAP. 0 Answers

Amazon New Coin - Did anyone try it? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges