Radio Button List for Shipping Methods on One Page Checkout
Radio Button List for Shipping Methods on One Page Checkout
Has anyone setup a Radio Button List for Shipping Methods on One Page Checkout on the Gold version yet. I know someone came up with one on the 7xx version.
Thanks in advance
Richard
www.somethingmorestore.com
Thanks in advance
Richard
www.somethingmorestore.com
Re: Radio Button List for Shipping Methods on One Page Checkout
Able Gold no longer has a 'One Page Checkout'. The checkout in Gold is now broken up into separate pages, so it's much easier to make changes such as this one.
First, find the /Checkout/ folder in your site and edit the ShipMethod.aspx file. Find this line of code:
and change it to look like this:
Now save the file. The next step is to change the programming code for this page. Find the ShipMethod.aspx.cs file in the same /Checkout/ folder. Edit the file and find this code:
Now replace that code with this code:
Once that is done, we have one more change to make in the same file. Find this code:
and replace it with this code:
Now save the file and test your page. You should be all set!
First, find the /Checkout/ folder in your site and edit the ShipMethod.aspx file. Find this line of code:
Code: Select all
<asp:DropDownList ID="ShipMethodsList" runat="server" DataValueField="Key" DataTextField="Value"></asp:DropDownList>
Code: Select all
<asp:RadioButtonList ID="ShipMethodsList" runat="server" DataValueField="Key" DataTextField="Value"></asp:RadioButtonList>
Code: Select all
protected void ShipmentRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
//CAST DATA ITEM
BasketShipment shipment = (BasketShipment)e.Item.DataItem;
//UPDATE SHIPPING WEIGHT
Literal shipWeight = (Literal)e.Item.FindControl("ShipWeight");
if (shipWeight != null)
{
shipWeight.Text = string.Format(weightFormat, shipment.Items.TotalWeight());
}
//SHOW SHIPPING METHODS
DropDownList ShipMethodsList = (DropDownList)e.Item.FindControl("ShipMethodsList");
Code: Select all
protected void ShipmentRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
//CAST DATA ITEM
BasketShipment shipment = (BasketShipment)e.Item.DataItem;
//UPDATE SHIPPING WEIGHT
Literal shipWeight = (Literal)e.Item.FindControl("ShipWeight");
if (shipWeight != null)
{
shipWeight.Text = string.Format(weightFormat, shipment.Items.TotalWeight());
}
//SHOW SHIPPING METHODS
// BEGIN MOD: AbleMods.com
// 12/13/2012
// use radio buttons for ship methods
RadioButtonList ShipMethodsList = (RadioButtonList)e.Item.FindControl("ShipMethodsList");
// END MOD: AbleMods.com
Code: Select all
protected void ContinueButton_Click(object sender, EventArgs e)
{
//LOOP SHIPMENTS, GET SHIPPING METHODS
Basket basket = AbleContext.Current.User.Basket;
IList<BasketShipment> shipments = basket.Shipments;
_ShipmentIndex = 0;
bool allMethodsValid = true;
foreach (BasketShipment shipment in shipments)
{
// shipment.ShipMethod = ShipMethodDataSource.Load(AlwaysConvert.ToInt(Request.Form["ShipMethod" + _ShipmentIndex]));
DropDownList ShipMethodsList = ShipmentRepeater.Items[_ShipmentIndex].FindControl("ShipMethodsList") as DropDownList;
Code: Select all
protected void ContinueButton_Click(object sender, EventArgs e)
{
//LOOP SHIPMENTS, GET SHIPPING METHODS
Basket basket = AbleContext.Current.User.Basket;
IList<BasketShipment> shipments = basket.Shipments;
_ShipmentIndex = 0;
bool allMethodsValid = true;
foreach (BasketShipment shipment in shipments)
{
// shipment.ShipMethod = ShipMethodDataSource.Load(AlwaysConvert.ToInt(Request.Form["ShipMethod" + _ShipmentIndex]));
// BEGIN MOD: AbleMods.com
// 12/13/2012
// Use radio buttons for ship methods
RadioButtonList ShipMethodsList = ShipmentRepeater.Items[_ShipmentIndex].FindControl("ShipMethodsList") as RadioButtonList;
// END MOD: AbleMods.com
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
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
Re: Radio Button List for Shipping Methods on One Page Checkout
Glad to be of help.
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
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
- compunerdy
- Admiral (ADM)
- Posts: 1283
- Joined: Sun Nov 18, 2007 3:55 pm
Re: Radio Button List for Shipping Methods on One Page Checkout
There is one issue with this..
If no shipping method is selected and you click continue the order item images, etc get all messed up on the page. This is not noticeable on the drop down because a shipping method is always selected.
If no shipping method is selected and you click continue the order item images, etc get all messed up on the page. This is not noticeable on the drop down because a shipping method is always selected.
Re: Radio Button List for Shipping Methods on One Page Checkout
hmm you are correct. Hope there is a better fix than setting a default as this kinda defeats the whole purpose of the radio button.
People just do not read.
Richard
People just do not read.
Richard
Re: Radio Button List for Shipping Methods on One Page Checkout
When Joe set this up for me in our 7.06 store, we had the default set to the cheapest valid method. If the customer flew through the checkout process without reading, they would get the cheapest method. If they paid attention, and preferred a different method, it was opt in to pay for a more expensive method. This has work well for us over the past year and a half that we've been using it.
I have requested this as a feature or improvement in AC Gold to be the default display for shipping. If you'd like this feature add your vote on this thread:
viewtopic.php?f=45&t=16951
Thanks
Chip
http://www.OVISonline.com
I have requested this as a feature or improvement in AC Gold to be the default display for shipping. If you'd like this feature add your vote on this thread:
viewtopic.php?f=45&t=16951
Thanks
Chip
http://www.OVISonline.com