Set Price based on Location of customer

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
FmaAlbee
Lieutenant (LT)
Lieutenant (LT)
Posts: 51
Joined: Fri Sep 12, 2008 2:12 pm

Set Price based on Location of customer

Post by FmaAlbee » Fri Mar 06, 2009 3:51 pm

Is there anyway in the store to set pricing for a product based on where a customer is located? We want to charge $98 for US and $118 everywhere else.

kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Re: Set Price based on Location of customer

Post by kastnerd » Sat Mar 07, 2009 7:04 pm

That is hard, You don't know where your customer is located until they register and enter there address.

If you could get around this, it could be done.

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Set Price based on Location of customer

Post by Carolharry » Wed Apr 01, 2009 1:55 pm

We can read IP address and find out from where the request is coming.

After knowing the user request is from US how do we display US users price?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Set Price based on Location of customer

Post by mazhar » Thu Apr 02, 2009 3:49 am

If you have registered users then you can do this by creating special prices on product dependent on user groups. Secondly if you have unregistered users and you are categorizing them on the basis of IP then either you can modify ConLib/Utility/ProductPrice control you show the calculated price for each user or to place another price value in product custom fields to be shown to respective user.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Set Price based on Location of customer

Post by Logan Rhodehamel » Mon Apr 13, 2009 11:21 am

The way I have seen this done in the past is to combine our ability to have group based pricing with some custom code.

For the out of the box part, what you probably want to do is create two user groups. One would be "US Customers" and one would be "Non US Customers". (Or choose equivalent group names that make sense to you.)

Then when you are adding or editing products, you can create a pricing rule. The price on the add/edit product page is the default price. You can provide a lower price to a particular group of users.

Then you get to the custom part. This is usually a modification to the global.asax file, to create a session_start method. In this code, you check the IP and determine the location of the customer. Then you look at the AbleCommerce user object (Token.Instance.User) and determine if they are a member of the correct user group. If they are not, you can add them to the group.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Set Price based on Location of customer

Post by Carolharry » Fri Apr 17, 2009 8:04 pm

Can we change the product price in the conlib/utility/productprice.ascx page with the price which is stored in ac_Customfields table. What will happen when the product is added to the cart? Does the basketitem API take this ac_Customfield price of that product.

We were able to change currency of the user dynamically by reading his IP address and setting his currency.
We used our exchange rate for Australia instead of auto update in Admin Currency settings. for example in Australia currency rate we set up as $1USA=.20$ in Australia. The problem is this conversion rate is being applied to all products. We have royalty to be paid on some products which cannot be sold for less in Australia and pay more royalty on that product.

How can we work around it. If we can change product price in productprice.ascx page and that price will be carried over through out the shopping cart then we are saved. If not we are in trouble :(

The consideration of price changes should take into account for unregistered users. We cannot ask them to register first to see our products.

Any help please....

Thanks a lot in advance,
Carol

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Set Price based on Location of customer

Post by Carolharry » Sat Apr 18, 2009 9:36 pm

Looks like there is no one place to change the price of the Product with custom field value and carry over that price throughout the shopping cart. I had to change product price in ProductPrice.ascx,OrderTotalSummary.ascx,basket.aspx,onepagecheckout.ascx still at the end when "Pay with card" is clicked to process checkout, order is charged the original amount which is in the Products table.

May be I am doing it wrong. Can anyone please let me know if there is a one time update place to change product price with customfield value instead of price in Products table.

Thank you,
Carol

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Set Price based on Location of customer

Post by jmestep » Sun Apr 19, 2009 9:00 am

I was able to do that using a price that I had set in the dropdown box for a template for the product. In my case, it was a different price for media on CD, Cassette, or MP3 download.
I set the product to us a variable price in the product edit page.
Then I put code in on the product page to add the product to the basket at that price.
Here is a snippet from the code behind of the product display page. I also had to put code in the wishlist when the product was moved to the basket because it didn't keep the variable price.

Code: Select all

else if (MediaType.ToUpper() == "MP3 DOWNLOAD")
        {
            userLocalPrice = AlwaysConvert.ToDecimal(MP3Price);
            basketItem.Price = userLocalPrice;
            basketItem.ShippableId = 0;
            basketItem.BasketShipmentId = 0;
            basketItem.Weight = 0;
            return basketItem;
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Set Price based on Location of customer

Post by Carolharry » Mon Apr 20, 2009 6:53 am

Hi jmstep,

Is setting variable price for the product only way to work around. It might work but literally all products in our catalog should be marked to use variable price. Does this mean in AbleCommerce custom price in product custom fields cannot be used. I am kind of hesitant to mark all products prices to variable price.

Does AbleCommerce business rules doesn't allow to use product price from custom field?

Please let me know.

Thanks a lot,
Carol

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Set Price based on Location of customer

Post by jmestep » Mon Apr 20, 2009 10:29 am

The reason I selected the variable price was because it decreased the amount of code I would have had to write if I had set the basket item price by the template price with no variable pricing checked. In that case, every transaction with the basket would have to be coded to not calculate a new price for the item based on the product price. Every time the basket is called, it looks for the product price from the product table in case there are merchant changes. (I've seen some bug posts that Able 7 doesn't do that in every instance, but haven't checked them all out. In Able 5, prices were checked with everything that affected the basket)
With a variable price, the price stays with the basket item. (Some merchants use it for donation amounts).
You could code to use a custom field rather than a template field. I'm using a template field because the same pricing will apply to thousands of media products. If I had used a custom field, then I would have had to make a custom field for every product. This way, I can set the products to use the special template via the dataport utility csv product upload.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Set Price based on Location of customer

Post by Carolharry » Mon Apr 20, 2009 11:05 am

But the problem with variable price is might have different rules. Just now I changed a kit product to use variable price. Now the whole kit functionality of changing the price dynamically depending on the users selection is lost.
We don't know if there is going to be any security breach because the intension of variable price on product is to take user input.

But what you have said is also true of changing custom field price through out the shopping cart.

At this point of time I am not able to decide which solution will be the right one, or can there be any other solution.

Thanks a lot for replying back.

Appreciate it.

Carol

Post Reply