Well, not just that. Here's a sample code, but you should take care of the rest. This could be a good start though. First, you'll need to add this AppConfig:
Parameter: ShippingMethodListControl
Value: radio or select
Then modify the AspDotNetStorefrontCore.ShoppingCart.GetShippingMe thodList (add the highlighted parts):
Code:
if (FreeShippingReason == Shipping.FreeShippingReasonEnum.AllDownloadItems || FreeShippingReason == Shipping.FreeShippingReasonEnum.AllOrdersHaveFreeShipping)
{
switch(AppLogic.AppConfig("ShippingMethodListControl"))
{
case "radio":
tmpS.Append(string.Format("<input type=\"radio\" name=\"ShippingMethodID{0}\" id=\"ShippingMethodID{0}0\" value=\"0\" checked > " + String.Format(AppLogic.GetString("shoppingcart.cs.105", ThisCustomer.SkinID, ThisCustomer.LocaleSetting), GetFreeShippingReason()) + "<br />", FieldSuffix));
break;
case "select":
tmpS.Append(string.Format("<select name=\"ShippingMethodID{0}\" id=\"ShippingMethodID{0}0\"> <option value=\"0\" selected /> " + String.Format(AppLogic.GetString("shoppingcart.cs.105", ThisCustomer.SkinID, ThisCustomer.LocaleSetting), GetFreeShippingReason()) + "<br />", FieldSuffix)+ "</select>");
break;
}
AnyShippingMethodsFound = true;
}
For a sample, I'll use the Calculate Shipping By Weight for a start, under its case (pertaining to the SWITCH CASE):
Code:
using (rs)
{
switch (AppLogic.AppConfig("ShippingMethodListControl"))
{
case "select":
tmpS.Append("<select name=\"ShippingMethodList\">");
while (rs.Read())
{
int ThisID = DB.RSFieldInt(rs, "ShippingMethodID");
AnyShippingMethodsFound = true;
if (ShippingIsFree && Shipping.ShippingMethodIsInFreeList(ThisID))
{
tmpS.Append("<option value=\"" + ThisID.ToString() + "\" " + CommonLogic.IIF((FirstItem().m_ShippingMethodID == ThisID), " selected ", "") + "/>");
tmpS.Append(" ");
tmpS.Append(DB.RSFieldByLocale(rs, "Name", ThisCustomer.LocaleSetting));
tmpS.Append(" ");
tmpS.Append(String.Format("({0})", AppLogic.GetString("shoppingcart.aspx.16", SkinID, ThisCustomer.LocaleSetting)));
}
else
{
Decimal ThisShipCost = Shipping.GetShipByWeightCharge(ThisID, WeightTotal());
if (AppLogic.AppConfigBool("ApplyShippingHandlingExtraFeeToFreeShipping"))
{
if (ExtraFee != System.Decimal.Zero && m_ShipCalcID != Shipping.ShippingCalculationEnum.UseRealTimeRates)
{
ThisShipCost += ExtraFee;
}
}
else
{
if (ExtraFee != System.Decimal.Zero && m_ShipCalcID != Shipping.ShippingCalculationEnum.UseRealTimeRates && ThisShipCost != System.Decimal.Zero)
{
ThisShipCost += ExtraFee;
}
}
if (m_VATOn)
{
ThisShipCost += Decimal.Round(ThisShipCost * ShippingTaxRate, 2, MidpointRounding.AwayFromZero);
}
if (ThisShipCost != System.Decimal.Zero || !AppLogic.AppConfigBool("FilterOutShippingMethodsThatHave0Cost"))
{
tmpS.Append("<option value=\"" + ThisID.ToString() + "\" " + CommonLogic.IIF((FirstItem().m_ShippingMethodID == ThisID), " selected ", "") + "/>");
tmpS.Append(" ");
tmpS.Append(DB.RSFieldByLocale(rs, "Name", ThisCustomer.LocaleSetting));
tmpS.Append(" ");
tmpS.Append(String.Format("({0})", m_ThisCustomer.CurrencyString(ThisShipCost)));
}
if (ThisShipCost == decimal.Zero && AppLogic.AppConfigBool("FilterOutShippingMethodsThatHave0Cost"))
{
zeroShipCostCountThatShouldBeFiltered++;
}
}
tmpS.Append("<br/>");
i++;
}
tmpS.Append("</select>");
break;
case "radio":
while (rs.Read())
{
int ThisID = DB.RSFieldInt(rs, "ShippingMethodID");
AnyShippingMethodsFound = true;
if (ShippingIsFree && Shipping.ShippingMethodIsInFreeList(ThisID))
{
tmpS.Append("<input type=\"radio\" name=\"ShippingMethodID" + FieldSuffix + "\" id=\"ShippingMethodID" + FieldSuffix + i.ToString() + "\" value=\"" + ThisID.ToString() + "\" " + CommonLogic.IIF((FirstItem().m_ShippingMethodID == ThisID), " checked ", "") + ">");
tmpS.Append(" ");
tmpS.Append(DB.RSFieldByLocale(rs, "Name", ThisCustomer.LocaleSetting));
tmpS.Append(" ");
tmpS.Append(String.Format("({0})", AppLogic.GetString("shoppingcart.aspx.16", SkinID, ThisCustomer.LocaleSetting)));
}
else
{
Decimal ThisShipCost = Shipping.GetShipByWeightCharge(ThisID, WeightTotal());
if (AppLogic.AppConfigBool("ApplyShippingHandlingExtraFeeToFreeShipping"))
{
if (ExtraFee != System.Decimal.Zero && m_ShipCalcID != Shipping.ShippingCalculationEnum.UseRealTimeRates)
{
ThisShipCost += ExtraFee;
}
}
else
{
if (ExtraFee != System.Decimal.Zero && m_ShipCalcID != Shipping.ShippingCalculationEnum.UseRealTimeRates && ThisShipCost != System.Decimal.Zero)
{
ThisShipCost += ExtraFee;
}
}
if (m_VATOn)
{
ThisShipCost += Decimal.Round(ThisShipCost * ShippingTaxRate, 2, MidpointRounding.AwayFromZero);
}
if (ThisShipCost != System.Decimal.Zero || !AppLogic.AppConfigBool("FilterOutShippingMethodsThatHave0Cost"))
{
tmpS.Append("<input type=\"radio\" name=\"ShippingMethodID" + FieldSuffix + "\" id=\"ShippingMethodID" + FieldSuffix + i.ToString() + "\" value=\"" + ThisID.ToString() + "\" " + CommonLogic.IIF((FirstItem().m_ShippingMethodID == ThisID), " checked ", "") + ">");
tmpS.Append(" ");
tmpS.Append(DB.RSFieldByLocale(rs, "Name", ThisCustomer.LocaleSetting));
tmpS.Append(" ");
tmpS.Append(String.Format("({0})", m_ThisCustomer.CurrencyString(ThisShipCost)));
}
if (ThisShipCost == decimal.Zero && AppLogic.AppConfigBool("FilterOutShippingMethodsThatHave0Cost"))
{
zeroShipCostCountThatShouldBeFiltered++;
}
}
tmpS.Append("<br/>");
i++;
}
break;
}
}