Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > eCommerce save basket View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
adam - 7/5/2012 9:48:09 AM
   
eCommerce save basket
Hi

is there away of saving a whole shopping/multiple baskets for later?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 7/13/2012 5:03:32 AM
   
RE:eCommerce save basket
Hi,

Please see the E-commerce guide article on purchase process / Shopping cart content (at the bottom).

The abandoned shopping cart is automatically saved and then retrieved according to
Shopping cart retrieval scheme

You can control the time of the cart expiration by setting the

CMSShoppingCartExpirationPeriod key in the web.config. It represents

Number of days after which E-commerce shopping cart content is deleted from the database. It's used for deleting unused shopping carts of anonymous users that are stored in the database with ID stored in the browser cookie.

The default value is 30.

usage example (in AppSettings section):
<add key="CMSShoppingCartExpirationPeriod" value="60" />

That's for the anonymous shopping cart. If you are logged as existing customer, the cart will be preserved for any time.

However, it's currently not possible to have multiple shopping carts saved for a single customer. Also, the "save cart" action is not in the default controls, although it could be implemented using API (http://devnet.kentico.com/downloads/kenticocms_api.zip) / ShoppingCartInfoProvider class methods.

How would you imagine such functionality to be managed? Do you have some examples / existing E-commerce solutions?

Thanks in advance for your feedback.

Regards,
Zdenek

User avatar
Certified Developer v7
Certified  Developer v7
ianwright - 11/12/2013 3:05:17 AM
   
RE:eCommerce save basket
Hi Zdenek,

I actually have a similar need for this sort of functionality. What I need to be able to do is allow the user to add some items to their cart and then 'Save' a quote for the required materials which they can then later come back to.

This would require having multiple carts so they can have multiple quotes, which will expire after a period and allow checkout on any one of them.

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 12/4/2013 9:04:16 AM
   
RE:eCommerce save basket
Hi Ian,

I can see you have replied to a rather old thread. Do you need this functionality for v5, or are you using some a newer version?

Regards,
Josef

User avatar
Certified Developer v7
Certified  Developer v7
ianwright - 12/4/2013 9:40:01 AM
   
RE:eCommerce save basket
No - it was a version 7 solution that I was implementing that it would have been really useful for...

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 12/5/2013 12:33:50 PM
   
RE:eCommerce save basket
Hi Ian,

You can assign any shopping cart object you want to to the EcommerceContext.CurrentShoppingCart property. For example like this:

ShoppingCartInfo cart = ShoppingCartInfoProvider.GetShoppingCartInfo(<CartID>);
ECommerceContext.CurrentShoppingCart = cart;


All web parts that work with this value will need a full page refresh to reload the new cart object.

You can create a blank shopping cart like this:

// Context cart
ShoppingCartInfo conCart = ECommerceContext.CurrentShoppingCart;

// New cart
ShoppingCartInfo newCart = ShoppingCartInfo.CreateShoppingCartInfo(CurrentSite.SiteID);

// Copy basic information
newCart.SetValue("ShoppingCartUserID", conCart.ShoppingCartUserID);
newCart.SetValue("ShoppingCartCustomerID", conCart.ShoppingCartCustomerID);
newCart.SetValue("ShoppingCartCurrencyID", conCart.ShoppingCartCurrencyID);

// Insert into database
newCart.Insert();


Please note there are no checks which would stop you from assigning an incorrect cart (for example other user's cart), as this feature is not officially supported.

Let me know if you need any more help.

Regards,
Josef