BV Commerce Forum
»
BV Commerce Support
»
General Support
»
Adding Cost to show on BVAdmin/Orders/ViewOrder.vbx
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
Hello all --- :cool: Hot a heck today in the North East. Good day to stay inside working!
I have set out to show cost on the BVAdmin/Orders/ViewOrder.aspx View for our customer service rep who is processing orders. This added field would be very helpful. To start I [2]tryed to modify the BVAdmin/Orders/ViewOrder.vbx with the following code.... However lineItem.SiteCost does not exist.. [/2]
[2][/2]
[color=#0000ff></FONT>
[/color][/2][/color][2]String[/2][2]"{0:c}"[/2][2]nd[/2][2]If[/2]
[2][/2]
[2][/2]
[2]How can I grab the SiteCost Field for an item? [/2]
[color=#0000ff>
<FONT][2]Any help would be greatly appreicated. [/2][/color][2] [/2]
|
|
|
|
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
|
|
|
|
Rank: Member
Joined: 9/20/2006(UTC) Posts: 92
|
SiteCost is not a member of the lineItem class. You would need to access the sitecost property using Catalog.Product. Feel free to contact us via phone or email if you need assistance. Wallace Miller -- Narrowpath DesignProviding installation, custom development, and design services for BVC5 sites 24/7 tech support and consultation service available for BVSoftware E-Commerce 760.728.8679 (phone) [email protected]
|
|
|
|
Rank: Member
Joined: 8/1/2007(UTC) Posts: 310
|
The following should ideally work:
Dim ourcost As Label = e.Row.FindControl("SiteCostField") If ourcost IsNot Nothing Then ' Retrieve the product corresponding to the specific line item Dim item As Catalog.Product = Catalog.InternalProduct.FindByBvin(lineItem.ProductId)
' Determine the product's SiteCost depending on the site's current culture Dim itemCost As String = item.SiteCost.ToString("C", WebAppSettings.SiteCulture)
ourcost.Text = itemCost End If
Let me know how it goes.
Thanks! |
Thanks, Satya support @ bayquel.net Work: +1 803 883 3226 |
|
|
|
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
This worked great! Thank you so much for taking the time to type that out.
I added the following to ViewOrder.aspx <asp:TemplateField HeaderText="Cost"> <ItemTemplate> <asp:Label ID="SiteCostField" runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField>
I added the following to ViewOrder.aspx.vb
'Added the following -- Goal - Wanted to show cost. Dim ourcost As Label = e.Row.FindControl("SiteCostField") If ourcost IsNot Nothing Then ' Retrieve the product corresponding to the specific line item Dim item As Catalog.Product = Catalog.InternalProduct.FindByBvin(lineItem.ProductId)
' Determine the product's SiteCost depending on the site's current culture Dim itemCost As String = item.SiteCost.ToString("C", WebAppSettings.SiteCulture)
ourcost.Text = itemCost End If ' End Added Material
Off and running! Thank you, Thank you, Thank you.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.