Negative options displayed incorrectly

Posted By Tiggywiggler Tue 12 Aug 2014
Add to Favorites0
Author Message
Tiggywiggler
 Posted Tue 12 Aug 2014
Supreme Being

Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)

Group: Forum Members
Last Active: Mon 6 Dec 2021
Posts: 235, Visits: 750
If you have set a negative offset option (e.g. having an option that has a value adjustment below zero such as -10.00) the options drop down on the product page will show the option in a strange way. It will show a positive change (increased cost) as:

+ £10.00

But it would show a negative change (discounted cost) as:

+ £-10.00

The code below fixes this and is found in [Options.ascx] within the [NewItem()] routine found on line 131.


Public Sub NewItem(ByVal pItemText As String, ByVal pItemValue As String, _
Optional ByVal pItemPriceChange As Single = 0, Optional ByVal pIsSelected As Boolean = False, _
Optional ByVal pChangePriceOnSelection As Boolean = True)

Dim itemListOptions As New ListItem(pItemText, pItemValue)
Dim itemListOptionsPrice As New ListItem(pItemText & "-" & CStr(pItemPriceChange), pItemPriceChange)
Dim strPriceFormatted As String = ""
Dim strPriceToFormat As String = ""

_ChangePricesOnSelection = pChangePriceOnSelection

'' The next -IF Statement- will change the price amount regarding the current Currency.
If pItemPriceChange <> 0 Then

'' Convert the Price Amount to the current Currency,
'' and then Rounding to 2 digits after the decimal point.
itemListOptionsPrice.Value = CurrenciesBLL.ConvertCurrency(Session("CUR_ID"), pItemPriceChange)

strPriceToFormat = itemListOptionsPrice.Value

If _ChangePricesOnSelection Then
' If the price changes on selection we will be adding a prefix to the displayed text and so we do not want
' the sign in the number that will be passed into CurrenciesBLL.FormatCurrencyPrice() so remove it here.
strPriceToFormat = CurrenciesBLL.ConvertCurrency(Session("CUR_ID"), Math.Abs(pItemPriceChange))
End If

strPriceFormatted = CurrenciesBLL.FormatCurrencyPrice( _
Session("CUR_ID"), strPriceToFormat, , _OptionType <> "DropDown")

'' Changing the display text to the user with the amount increased if this option is selected.
If _ChangePricesOnSelection Then itemListOptions.Text += Space(3) & "(" & IIf(pItemPriceChange < 0, "-", "+") & " " & strPriceFormatted & ")"
End If
If pIsSelected Then
_Control.ClearSelection()
itemListOptions.Selected = pIsSelected
End If

'itemListOptions.Selected = pIsSelected

_Control.Items.Add(itemListOptions)

'If only one option, then we will see a checkbox. In v1.3
'and earlier, this would effectively make the 'optional'
'setting for this option irrelevant, as a checkbox input
'can be left unchecked to indicate a selection of 'no'.
'From 1.4 onwards, we interpret a single option which is
'not optional (i.e. required) as the option being selected.
'This way, you can set up a product as an options product
'even if this is only one option to begin with (e.g. size)
'but make this single size selection required. Or you can
'use it to emphasize something that is included with a
'product and cannot be removed.
If _Mandatory And _OptionType = "Check" Then
_Control.Items(0).Selected = True
_Control.Items(0).Enabled = False
End If

_ControlPrice.Items.Add(itemListOptionsPrice)

If pIsSelected Then indxChanged(Me, New EventArgs)

End Sub


We are always willing to help out the community or pitch in to help you fix a problem. However, if you want a complete solution made such as a code module or new feature added you have two options. Either
1) Reach out to the Kartris internal development team at http://www.kartris.com/Contact.aspx.
2) Contact one of the Kartris approved partners at http://www.kartris.com/t-Worldwide-Developers.aspx.

Have fun and good luck coding.
Tiggywiggler Marked As Answer
 Posted Fri 15 Aug 2014
Supreme Being

Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)Supreme Being - (124,074 reputation)

Group: Forum Members
Last Active: Mon 6 Dec 2021
Posts: 235, Visits: 750
Main post is its own answer. this post is to mark as complete

We are always willing to help out the community or pitch in to help you fix a problem. However, if you want a complete solution made such as a code module or new feature added you have two options. Either
1) Reach out to the Kartris internal development team at http://www.kartris.com/Contact.aspx.
2) Contact one of the Kartris approved partners at http://www.kartris.com/t-Worldwide-Developers.aspx.

Have fun and good luck coding.
Paul
 Posted Sat 16 Aug 2014
große Käse

große Käse - (522,418 reputation)große Käse - (522,418 reputation)große Käse - (522,418 reputation)große Käse - (522,418 reputation)große Käse - (522,418 reputation)große Käse - (522,418 reputation)große Käse - (522,418 reputation)große Käse - (522,418 reputation)große Käse - (522,418 reputation)

Group: Administrators
Last Active: Tue 10 Sep 2024
Posts: 807, Visits: 2,748
Thanks, we should have this in the next release too.

--
If my post solves your issue, can you 'Mark as Answer' so it's easier for other users to find in future.

If you would like to be informed of new features, new releases, developments and occasional special bonuses, please sign up to our mailing list: http://bit.ly/19sKMZb

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top