Portal Engine
Version 3.x > Portal Engine > custom ecommerce checkout process View modes: 
User avatar
Member
Member
nsmith-sedonatek - 12/4/2008 3:13:54 PM
   
custom ecommerce checkout process
I have created a custom checkout process for a client and am stuck on a few requirements they want. They would like the cart to have default products already in the shopping cart and they would like the option to select zero units for a product BUT have the product stay on the page & not disappear.

I have found a way to put default products in the shopping cart when the page is loaded:
if (!IsPostBack)
{
ShoppingCartInfo cartx = CMSContext.CurrentShoppingCart;
cartx.AddSKUUnitsToShoppingCart(1, 1);
cartx.AddSKUUnitsToShoppingCart(2, 1);
cartx.AddSKUUnitsToShoppingCart(3, 1);
cartx.AddSKUUnitsToShoppingCart(4, 1);
cartx.AddSKUUnitsToShoppingCart(5, 1);
cartx.AddSKUUnitsToShoppingCart(6, 1);
cartx.AddSKUUnitsToShoppingCart(7, 1);
CMSContext.CurrentShoppingCart = cartx;
}

But need help and/or advise figuring out the rest of my clients requirements.

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/5/2008 8:26:56 AM
   
RE:custom ecommerce checkout process
Hi,

You need to modify in this file - \CMSEcommerce\ShoppingCart\ShoppingCartContent.ascx.cs this piece of code in method btnUpdate_Click1:

// Get number of units
int itemUnits = ValidationHelper.GetInteger(((TextBox)(row.Cells[6].Controls[1])).Text.Trim(), 0);
if ((itemUnits >= 0) && (cartItem.CartItemUnits != itemUnits))
{...

Then the ucser will be able to add zero to the units box.

Note for other users: To achieve this also in the Order editation in CMS Desk -> Tools section, you need to have source code license.

Best Regards,
Juraj Ondrus