Thanks Alfred but no matter what I try, I get the price from the ProductVariant table in the Orders_ShoppingCart table
I even went as far as commenting out this entire block
Code:
'' now set extended pricing info in the order cart to take into account all levels, quantities, etc...so the order object doesn't have to recompute cart stuff
'For Each c As CartItem In cart.CartItems
' If (Not c.m_CustomerEntersPrice) AndAlso (Not AppLogic.IsAKit(c.m_ProductID)) AndAlso (Not AppLogic.IsAPack(c.m_ProductID)) Then
' Dim Q As Integer = c.m_Quantity
' Dim IsOnSale As Boolean = False
' Dim pr As Decimal = 0D
' If cart.CartType = CartTypeEnum.RecurringCart Then
' pr = c.m_Price ' price is grandfathered
' Else
' pr = AppLogic.DetermineLevelPrice(c.m_VariantID, cart.ThisCustomer.CustomerLevelID, IsOnSale)
' End If
' pr = pr * Q
' Dim ActiveDID As Integer = 0
' Dim DIDPercent As Decimal = 0D
' If AppLogic.CustomerLevelAllowsQuantityDiscounts(cart.ThisCustomer.CustomerLevelID) Then
' ActiveDID = AppLogic.LookupActiveVariantQuantityDiscountID(cart.EntityHelpers, c.m_VariantID)
' DIDPercent = AppLogic.GetDIDPercent(ActiveDID, Q)
' If ActiveDID <> 0 AndAlso DIDPercent <> 0D Then
' pr = (1D - (DIDPercent / 100D)) * pr
' End If
' End If
' Dim regular_pr As Decimal = System.Decimal.Zero
' Dim sale_pr As Decimal = System.Decimal.Zero
' Dim extended_pr As Decimal = System.Decimal.Zero
' If cart.CartType <> CartTypeEnum.RecurringCart Then
' regular_pr = AppLogic.GetVariantPrice(c.m_VariantID)
' sale_pr = AppLogic.GetVariantSalePrice(c.m_VariantID)
' extended_pr = AppLogic.GetVariantExtendedPrice(c.m_VariantID, cart.ThisCustomer.CustomerLevelID)
' ' adjust for color & size price modifirers:
' Dim PrMod As Decimal = AppLogic.GetColorAndSizePriceDelta(c.m_ChosenColor, c.m_ChosenSize)
' If PrMod <> System.Decimal.Zero Then
' pr += (PrMod * Q)
' End If
' If pr < System.Decimal.Zero Then
' pr = System.Decimal.Zero ' never know what people will put in the modifiers :)
' End If
' Else
' regular_pr = c.m_Price
' sale_pr = System.Decimal.Zero
' extended_pr = System.Decimal.Zero
' End If
' DB.ExecuteSQL("update orders_ShoppingCart set OrderedProductPrice=" & Localization.CurrencyStringForDBWithoutExchangeRate(pr) & ", OrderedProductRegularPrice=" & Localization.CurrencyStringForDBWithoutExchangeRate(regular_pr) & ", OrderedProductSalePrice=" & Localization.CurrencyStringForDBWithoutExchangeRate(sale_pr) & ", OrderedProductExtendedPrice=" & Localization.CurrencyStringForDBWithoutExchangeRate(extended_pr) & " where OrderNumber=" & OrderNumber.ToString() & " and ShoppingCartRecID=" & c.m_ShoppingCartRecordID.ToString())
' Else
' Dim Q As Integer = c.m_Quantity
' Dim pr As Decimal = c.m_Price * Q
' DB.ExecuteSQL("update orders_ShoppingCart set OrderedProductPrice=" & Localization.CurrencyStringForDBWithoutExchangeRate(pr) & " where OrderNumber=" & OrderNumber.ToString() & " and ShoppingCartRecID=" & c.m_ShoppingCartRecordID.ToString())
' End If
'Next c
and replacing it with this
Code:
Dim sql7 As String = "select ProductPrice, ShoppingCartRecID from ShoppingCart " & String.Format(" where CustomerID={0} ", cart.ThisCustomer.CustomerID)
Dim myRS As IDataReader = DB.GetRS(sql7)
Do While myRS.Read()
Dim pr As Decimal = DB.RSFieldDecimal(myRS, "ProductPrice")
Dim cartID As Integer = DB.RSFieldInt(myRS, "ShoppingCartRecID")
DB.ExecuteSQL("update orders_ShoppingCart set OrderedProductPrice=" & Localization.CurrencyStringForDBWithoutExchangeRate(pr) & " where OrderNumber=" & OrderNumber.ToString() & " and ShoppingCartRecID=" & cartID.ToString())
Loop
myRS.Close()
and my ShoppingCart table prices of
1.9900
1.1300
1.9900
1.1300
1.9900
1.9900
1.9900
still end up as these in the Orders_ShoppingCart table
1.9900
1.4900
1.9900
1.4900
1.9900
1.9900
1.9900
There aren't getting updated after that block because if I hard code 2D into
Code:
Dim sql7 As String = "select ProductPrice, ShoppingCartRecID from ShoppingCart " & String.Format(" where CustomerID={0} ", cart.ThisCustomer.CustomerID)
Dim myRS As IDataReader = DB.GetRS(sql7)
Do While myRS.Read()
Dim pr As Decimal = DB.RSFieldDecimal(myRS, "ProductPrice")
Dim cartID As Integer = DB.RSFieldInt(myRS, "ShoppingCartRecID")
DB.ExecuteSQL("update orders_ShoppingCart set OrderedProductPrice=" & Localization.CurrencyStringForDBWithoutExchangeRate(2D) & " where OrderNumber=" & OrderNumber.ToString() & " and ShoppingCartRecID=" & cartID.ToString())
Loop
myRS.Close()
I get these values in the Orders_ShoppingCart table
2.0000
2.0000
2.0000
2.0000
2.0000
2.0000
2.0000
I'm thoroughly confused.
Thanks