Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello Expertisers..!!!

I'm Tarun, working as a core programmer.

I've an e-book portal which is running on vb.net platform. Here, I need to show different price of book for some specific countries. Like: Latin American countries and caribbean countries.

I've 242 countries list in my database with thier country's short name and continent code.

So, here i need to show different prices for them(country names mentioned in above paragraph) countries.

For an example: A book has price in dollars 40$ for all over the world. But when a user is trying to buy that book from "MEXICO" then the price will be visible to the user with the amount of 35$.

So, how do i show that price for the book?
Posted
Updated 21-Sep-15 0:53am
v2

We can't give you specifics, because we have no idea how your system works.
For example, you could be applying a discount value as a percentage in each country, so Mexico would need a discount value associated with it of 13.5%
But if each country needs a separate price for each book, then you need a much bigger system with lookup codes for each book, for each country - and with 242 countries, that's getting complex to administer in terms of data entry alone!

But basically the process is the same:
1) Identify which country the user is in. You can do this from the IP address, but it's not very accurate: Using IP based Geolocation - and why it's pretty much useless.[^] - it's better to identify the country from the user shipping address, ratehr thna rely on electronic identification.
2) Get the book price for the country and book. This will depend on how you work out teh price!
3) Don't forget to allow for different shipping costs / methods - some countries are harder to ship to and that means more cost. Remember local import duties may be applied.
 
Share this answer
 
to do it efficiently you can create one more table with relation with country, book and price
PriceId Country BookId Price
1 India 1234 30$
2 USA 1234 50$
3 Mexico 1234 35$

then you can join this table before displaying the price, Do not forget to index bookid.

for identifying country of a user i would rater suggest to use globlization rater then relying on IP address since slimier IP address can be found all over the world

https://msdn.microsoft.com/en-us/library/system.globalization.regioninfo(vs.71).aspx
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900