Basket Transferrance?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Basket Transferrance?

Post by William_firefold » Fri Sep 26, 2008 7:23 am

We want to implement a function to help create quotes for customers through the website.
What we want is to be able to create an order in the admin panel and pass the cart along to a user.
This may not be possible, Im not sure how the access restrictions are built into able.

If the basket is created and filled in admin, is it possible to access it from a regular user account, or maybe attach it to their account?

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

Re: Basket Transferrance?

Post by jmestep » Fri Sep 26, 2008 7:57 am

Are you going to make price adjustments? If not, I think you can just find the user in the admin and login as that user and start the process.
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

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Basket Transferrance?

Post by William_firefold » Fri Sep 26, 2008 8:12 am

We will need to make price adjustments.
And those price adjustments would have to carry over.
Can it be done?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Basket Transferrance?

Post by AbleMods » Fri Sep 26, 2008 8:19 pm

You can modify the customer cart directly without actually creating an order.

This would allow you to populate their basket for them, allowing them to just log in and go straight to checkout. Would that work for you?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

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

Re: Basket Transferrance?

Post by mazhar » Mon Sep 29, 2008 12:16 am

Well I have tried something, I think it may help you. In order to transfer basket which is created by the admin to some one else, first of all we create a user for example we say it temp@temp.com. Now on the admin side we put the following code

Code: Select all

User user = new User()
Basket basket = user.Basket;
BasketItem basketItem = BasketItemDataSource.CreateForProduct(5, 1); // Where 5 is product id being added

basket.Items.Add(basketItem);
basket.Save();
When executed this code will create a basket with one item in it. Create a link for the website login page like
http://localhost/mystore/Login.aspx?buser=13
Where 13 is the user id of anonymous user created for basket from admin side

Now on the client side we modify the ConLib/LoginDialog.ascx control and locate the following lines of code

Code: Select all

if ((oldUserId != newUserId) && (newUserId != 0))
{
User.Migrate(Token.Instance.User, UserDataSource.Load(newUserId));
Token.Instance.UserId = newUserId;
}
and made it look like

Code: Select all

if ((oldUserId != newUserId) && (newUserId != 0))
                        {
                            User.Migrate(Token.Instance.User, UserDataSource.Load(newUserId));
                            Token.Instance.UserId = newUserId;
                            int buserid = AlwaysConvert.ToInt(Request.QueryString["buser"]);
if(buserid>0)
{
                            Basket.Transfer(buserid, newUserId);
                            Token.Instance.User.Basket.Recalculate();
}
                        }
That's it. Now when some user visits the site through the link discussed above then when he logs on the basket created from the admin side will be shifted to him.

Post Reply