Page 1 of 1
Custom Shipping Methods User input
Posted: Tue Sep 22, 2009 11:26 am
by Willie
I am Trying to create custom shipping methods that when selected from the select method drop down list on the Checkout/Default.aspx page, the user provides data in text fields and/or input boxes that possibly identifies the name of their alternative shipping method and the account number of that shipping method.
Are there any customizations that may have this type of function already, or are there any suggestions on what may be the easiest way to accomplish this?
Thank you. By the way I am using the latest ablecommerce 7.0.3.
Re: Custom Shipping Methods User input
Posted: Wed Sep 30, 2009 12:05 pm
by jsmits
I am currently using the demo, and this is a must for our operations. I was able to make a panel appear based on the selection from the shipping method dropdown, and I am sure I can add the necessary textboxes to that panel.
My plan is to commit the carrier, account number and method to a table in the database that references the order number, but can't seem to figure out how to do so. It doesn't help that I am a VB guy (I guess I have some reading to do

). If anybody knows where I should start looking, or has done something similar, I'd love to hear about it.
Re: Custom Shipping Methods User input
Posted: Wed Sep 30, 2009 1:21 pm
by jsmits
Okay, the code as how I would do this would be to add something like:
Code: Select all
int OrderId = response.OrderId;
System.Data.SqlClient.SqlCommand myCommand = new System.Data.SqlClient.SqlCommand();
System.Data.SqlClient.SqlDataAdapter myAdapter = new System.Data.SqlClient.SqlDataAdapter();
System.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection();
myConnection.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings.Get("Foo").ToString();
myCommand.CommandText = "INSERT INTO jsmits.js_FreightCollect(OrderId,Method,Carrier,AccountNumber) VALUES(" + OrderId + ",'foo','bar','blat')";
myCommand.Connection = myConnection;
myConnection.Open();
myAdapter.InsertCommand = myCommand;
myAdapter.InsertCommand.ExecuteNonQuery();
myConnection.Close();
To the checkedOut section of the OnePageCheckout control (or at least my custom version of it) but obviously this opens a new connection when there should be an open one already in use. How do I access that connection?
Re: Custom Shipping Methods User input
Posted: Thu Oct 08, 2009 2:05 pm
by thaas
Did you add fields on the check out page for the customer to enter their account number? I was planning on setting up a custom ship method that will charge no shipping amount but present a field for the customer to enter their account number (probably will need a couple of custom ship methods - one for UPS, one for Fed Ex etc - that say use my shipper account). And then do I store that field within one of the already established tables or do I create a new table? I keep reading about custom fields but I'm pretty new to ASP.Net and I'm just not sure which pages need to be edited and how. Any help anyone could provide would be greatly appreciated.
Thanks!
Re: Custom Shipping Methods User input
Posted: Mon Oct 12, 2009 9:43 am
by jsmits
Hi Thaas,
You can add an asp panel to the repeater control where the methods live, add your text boxes or dropdowns to that panel, then toggle it to visible if the user selects your custom ship method. I would store the values in a new table, and marry them up to the order id as in the code sample above. I don't think there is a custom field for an order and I don't know if there would be unintended consequences if you added fields to the table.