I had to do the exact same thing. I modified the list of shipping options. Please note the following change logs:
RTShipping.vb
Code:
@@ -768,6 +768,16 @@
SM.Sort(rtsComparer)
End If
+ 'LTL/Other Shipping Method add-on
+ Dim otherShipMethod As New ShipMethod
+ otherShipMethod.Carrier = "Other"
+ otherShipMethod.FreeItemsRate = 0
+ otherShipMethod.ServiceName = "Other Carrier - Call For Price"
+ otherShipMethod.ShippingMethodID = 999
+ otherShipMethod.ServiceRate = 0
+ otherShipMethod.VatRate = 0
+ SM.AddMethod(otherShipMethod)
+
' Check list format type, and setup appropriate
Dim output As New StringBuilder(1024)
Dim returnObject As Object = Nothing
RTShipping.vb
Code:
@@ -772,7 +772,7 @@
Dim otherShipMethod As New ShipMethod
otherShipMethod.Carrier = "Other"
otherShipMethod.FreeItemsRate = 0
- otherShipMethod.ServiceName = "Other Carrier - Call For Price"
+ otherShipMethod.ServiceName = "Other Carrier - Please Provide Account Number:"
otherShipMethod.ShippingMethodID = 999
otherShipMethod.ServiceRate = 0
otherShipMethod.VatRate = 0
@@ -864,9 +864,9 @@
Case ResultType.CollectionList
returnObject = CObj(SM)
Exit Select
- End Select
-
- Return returnObject
+ End Select
+
+ Return returnObject
End Function
'had to leave for google checkout...google checkout does not support shipping by multiple distributors
ShoppingCart.vb
Code:
@@ -5220,7 +5220,7 @@
tmpS.Append("<table width=""100%"" cellpadding=""4"" cellspacing=""0"" border=""0"" style=""" & AppLogic.AppConfig("BoxFrameStyle") & """>" & vbLf)
tmpS.Append("<tr><td align=""left"" valign=""top"">" & vbLf)
- tmpS.Append(OrderNotes)
+ tmpS.Append(OrderNotes.Replace(Environment.NewLine, "<br />"))
tmpS.Append("</td></tr>" & vbLf)
tmpS.Append("</table>" & vbLf)
@@ -8457,7 +8457,7 @@
''' <value>The order notes.</value>
Public ReadOnly Property OrderNotes() As String
Get
- Return m_OrderNotes
+ Return m_OrderNotes
End Get
End Property
checkoutshipping.aspx
Code:
@@ -167,6 +167,7 @@
<tr>
<td>
<aspdnsfc:ShippingMethodControl ID="ctrlShippingMethods" runat="server"/>
+ <asp:TextBox ID="txtOtherShippingNotes" runat="server" Visible="false"></asp:TextBox>
</td>
<td style="width:250px;">
<aspdnsf:BuySafeKicker ID="buySAFEKicker" WrapperClass="shippingKicker" runat="server" />
@@ -202,7 +203,7 @@
/>
</aspdnsfc:ShoppingCartControl>
- <asp:Literal ID="CartSummary" runat="server"></asp:Literal>
+ <asp:Literal ID="CartSummary" Mode="PassThrough" runat="server"></asp:Literal>
<br />
<aspdnsf:OrderOption id="ctrlOrderOption" runat="server" EditMode="false" />
checkoutshipping.aspx.vb
Code:
@@ -233,9 +233,17 @@
ctrlShoppingCart.HeaderTabImageURL = AppLogic.SkinImage("OrderInfo.gif")
ctrlShoppingCart.HeaderTabEditOderLink = String.Format(" {0}<a href=""ShoppingCart.aspx""> {1}</a>", AppLogic.GetString("checkoutcard.aspx.9", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("checkoutcard.aspx.10", SkinID, ThisCustomer.LocaleSetting))
- AppLogic.eventHandler("CheckoutShipping").CallEvent("&CheckoutShipping=true")
+ AppLogic.eventHandler("CheckoutShipping").CallEvent("&CheckoutShipping=true")
- End Sub
+ 'mod for Other shipping method
+ Dim shippingMethods As ShippingMethodCollection = CType(ctrlShippingMethods.DataSource, ShippingMethodCollection)
+ For Each ShippingMethod In shippingMethods
+ If ShippingMethod.Name.ToLowerInvariant.Contains("carrier") Then
+ txtOtherShippingNotes.Visible = True
+ End If
+ Next
+
+ End Sub
Public Sub ShippingCountry_Change(ByVal sender As Object, ByVal e As EventArgs)
@@ -556,38 +564,45 @@
ShippingMethod = String.Format(AppLogic.GetString("shoppingcart.aspx.16", ThisCustomer.SkinID, ThisCustomer.LocaleSetting) & " : {0}", cartFreeShippingReason)
End If
- Dim sql As String = String.Empty
- If (Not cart.IsAllFreeShippingComponents()) AndAlso (Not cart.ContainsRecurring()) Then
- sql = String.Format("update dbo.ShoppingCart set ShippingMethodID={0}, ShippingMethod={1}, ShippingAddressID={4} where CustomerID={2} and CartType={3}", ShippingMethodID.ToString(), DB.SQuote(ShippingMethod), ThisCustomer.CustomerID.ToString(), CInt(Fix(CartTypeEnum.ShoppingCart)).ToString(), ddlChooseShippingAddr.SelectedValue)
- DB.ExecuteSQL(sql)
- Else
- For i As Integer = 0 To cart.CartItems.Count-1
- Dim _CartItem As CartItem = CType(cart.CartItems(i), CartItem)
- Dim _CartRecID As Integer = DB.GetSqlN(String.Format("select ShoppingCartRecID N from ShoppingCart where CustomerID={0} and ProductID={1} and VariantID={2} and CartType={3}", ThisCustomer.CustomerID.ToString(), _CartItem.ProductID, _CartItem.VariantID, CInt(Fix(_CartItem.CartType)).ToString()))
+ Dim sql As String = String.Empty
- If (Not _CartItem.FreeShipping) OrElse AppLogic.AppConfigBool("FreeShippingAllowsRateSelection") Then
- sql = String.Format("update dbo.ShoppingCart set ShippingMethodID={0}, ShippingMethod={1}, ShippingAddressID={4} where CustomerID={2} and CartType={3} and ShoppingCartRecID={5}", ShippingMethodID.ToString(), DB.SQuote(ShippingMethod), ThisCustomer.CustomerID.ToString(), CInt(Fix(CartTypeEnum.ShoppingCart)).ToString(), ddlChooseShippingAddr.SelectedValue, _CartRecID.ToString())
- Else
- sql = String.Format("update dbo.ShoppingCart set ShippingAddressID={0} where CustomerID={1} and CartType={2} and ShoppingCartRecID={3}", ddlChooseShippingAddr.SelectedValue, ThisCustomer.CustomerID.ToString(), CInt(Fix(_CartItem.CartType)).ToString(), _CartRecID.ToString())
- End If
- DB.ExecuteSQL(sql)
- Next i
- End If
+ 'mod for Other shipping method
+ If ctrlShippingMethods.SelectedItem.Value.Contains("Other") Then
+ sql = String.Format("update dbo.Customer set OrderNotes = (select convert(varchar(max),OrderNotes) + {0} + {0} + 'SHIPPING NOTES: {2}' from Customer where CustomerID={1}) where CustomerID={1}", Environment.NewLine, ThisCustomer.CustomerID.ToString(), txtOtherShippingNotes.Text)
+ DB.ExecuteSQL(sql)
+ End If
- sql = String.Format("update dbo.Customer set ShippingAddressID = {0} where CustomerID={1} ", ddlChooseShippingAddr.SelectedValue, ThisCustomer.CustomerID.ToString())
- DB.ExecuteSQL(sql)
+ If (Not cart.IsAllFreeShippingComponents()) AndAlso (Not cart.ContainsRecurring()) Then
+ sql = String.Format("update dbo.ShoppingCart set ShippingMethodID={0}, ShippingMethod={1}, ShippingAddressID={4} where CustomerID={2} and CartType={3}", ShippingMethodID.ToString(), DB.SQuote(ShippingMethod), ThisCustomer.CustomerID.ToString(), CInt(Fix(CartTypeEnum.ShoppingCart)).ToString(), ddlChooseShippingAddr.SelectedValue)
+ DB.ExecuteSQL(sql)
+ Else
+ For i As Integer = 0 To cart.CartItems.Count - 1
+ Dim _CartItem As CartItem = CType(cart.CartItems(i), CartItem)
+ Dim _CartRecID As Integer = DB.GetSqlN(String.Format("select ShoppingCartRecID N from ShoppingCart where CustomerID={0} and ProductID={1} and VariantID={2} and CartType={3}", ThisCustomer.CustomerID.ToString(), _CartItem.ProductID, _CartItem.VariantID, CInt(Fix(_CartItem.CartType)).ToString()))
- If cart.ContainsGiftCard() Then
- Response.Redirect("checkoutgiftcard.aspx")
- Else
- If ThisCustomer.ThisCustomerSession("PayPalExpressToken") = "" Then
- Response.Redirect("checkoutpayment.aspx")
- Else
- Response.Redirect("checkoutreview.aspx?PaymentMethod=PAYPALEXPRESS")
- End If
- End If
- End If
- End Sub
+ If (Not _CartItem.FreeShipping) OrElse AppLogic.AppConfigBool("FreeShippingAllowsRateSelection") Then
+ sql = String.Format("update dbo.ShoppingCart set ShippingMethodID={0}, ShippingMethod={1}, ShippingAddressID={4} where CustomerID={2} and CartType={3} and ShoppingCartRecID={5}", ShippingMethodID.ToString(), DB.SQuote(ShippingMethod), ThisCustomer.CustomerID.ToString(), CInt(Fix(CartTypeEnum.ShoppingCart)).ToString(), ddlChooseShippingAddr.SelectedValue, _CartRecID.ToString())
+ Else
+ sql = String.Format("update dbo.ShoppingCart set ShippingAddressID={0} where CustomerID={1} and CartType={2} and ShoppingCartRecID={3}", ddlChooseShippingAddr.SelectedValue, ThisCustomer.CustomerID.ToString(), CInt(Fix(_CartItem.CartType)).ToString(), _CartRecID.ToString())
+ End If
+ DB.ExecuteSQL(sql)
+ Next i
+ End If
+
+ sql = String.Format("update dbo.Customer set ShippingAddressID = {0} where CustomerID={1} ", ddlChooseShippingAddr.SelectedValue, ThisCustomer.CustomerID.ToString())
+ DB.ExecuteSQL(sql)
+
+ If cart.ContainsGiftCard() Then
+ Response.Redirect("checkoutgiftcard.aspx")
+ Else
+ If ThisCustomer.ThisCustomerSession("PayPalExpressToken") = "" Then
+ Response.Redirect("checkoutpayment.aspx")
+ Else
+ Response.Redirect("checkoutreview.aspx?PaymentMethod=PAYPALEXPRESS")
+ End If
+ End If
+ End If
+ End Sub
Private Sub CreateShipAddress()
Dim thisAddress As New Address()
notification.receipt.xml.config
Code:
@@ -255,9 +255,9 @@
- <xsl:call-template name="GenerateOrderNotesSummary">
- <xsl:with-param name="OrderInfo" select="/root/Order/OrderInfo" />
- </xsl:call-template>
+ <xsl:call-template name="GenerateOrderNotesSummary">
+ <xsl:with-param name="OrderInfo" select="/root/Order/OrderInfo" />
+ </xsl:call-template>
<!--Line Item Section-->
@@ -1458,7 +1458,9 @@
<xsl:value-of select="aspdnsf:StringResource('order.cs.29', $LocaleSetting)" disable-output-escaping="yes" />
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="$OrderInfo/OrderNotes" />
+ <xsl:call-template name="PreserveLineBreaks">
+ <xsl:with-param name="text" select="$OrderInfo/OrderNotes" />
+ </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</div>
@@ -1752,6 +1754,25 @@
</table>
</xsl:template>
+ <!--http://www.danrigsby.com/blog/index.php/2008/01/03/preserving-line-breaks-in-xml-while-transforming-to-html-with-xslt/-->
+ <xsl:template name="PreserveLineBreaks">
+ <xsl:param name="text"/>
+ <xsl:choose>
+ <xsl:when test="contains($text,'
')">
+ <xsl:value-of select="substring-before($text,'
')"/>
+ <br/>
+ <xsl:call-template name="PreserveLineBreaks">
+ <xsl:with-param name="text">
+ <xsl:value-of select="substring-after($text,'
')"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
</xsl:stylesheet>
</PackageTransform>