Automatically set cross sell products
Posted: Tue May 26, 2009 8:46 am
This small mod attempts to automate the product cross sell(similar products) maintenance.
Every time a customer places an order, all products that are in the shopping cart are linked as cross sell(similar products) products.
In order to install the mod, download and extract CrossSellHelper.zip file and then follow following instructions.
1:- Place CrossSellHelper.cs file into your websites App_Code folder.
2:- Now edit you ConLib/OnePageCheckout.ascx.cs file and locate following code block
and make it look like
3:- Now locate following code in CheckedOut method
and change it as below
4:- Finally in order to enable auto cross sell, edit your checkout scriptlet and then set EnableAutoCrossSell to true as below
Every time a customer places an order, all products that are in the shopping cart are linked as cross sell(similar products) products.
In order to install the mod, download and extract CrossSellHelper.zip file and then follow following instructions.
1:- Place CrossSellHelper.cs file into your websites App_Code folder.
2:- Now edit you ConLib/OnePageCheckout.ascx.cs file and locate following code block
Code: Select all
private bool _AllowAnonymousCheckout = false;
public bool AllowAnonymousCheckout
{
get { return _AllowAnonymousCheckout; }
set { _AllowAnonymousCheckout = value; }
}
Code: Select all
private bool _AllowAnonymousCheckout = false;
public bool AllowAnonymousCheckout
{
get { return _AllowAnonymousCheckout; }
set { _AllowAnonymousCheckout = value; }
}
private bool _EnableAutoCrossSell = false;
public bool EnableAutoCrossSell
{
get { return _EnableAutoCrossSell; }
set { _EnableAutoCrossSell = value; }
}
Code: Select all
else
{
CheckoutMessagePanel.Visible = true;
CheckoutMessage.Text = string.Join("<br /><br />", response.WarningMessages.ToArray());
}
Code: Select all
else
{
CheckoutMessagePanel.Visible = true;
CheckoutMessage.Text = string.Join("<br /><br />", response.WarningMessages.ToArray());
}
if (EnableAutoCrossSell)
{
Order order = OrderDataSource.Load(e.OrderId, false);
if (order != null)
CrossSellHelper.MarkCrossSells(order.Items);
}
Code: Select all
[[ConLib:OnePageCheckout EnableAutoCrossSell="true"]]