frontend.basket.behaviour error if 'y' or 'n'


https://forum.kartris.com/Topic6637.aspx
Print Topic | Close Window

By Tiggywiggler - Wed 20 Jul 2016
The description for frontend.basket.behaviour says:

"Determines whether basket addition displays message for number of seconds (if numeric), displays no basket (n) or shows the basket (y)"

which means that this value can be a number, it can be 'y', or it can be 'n'.

Unfortunately in line 341 of ProductVersions.ascx.vb there is a check that does not allow for non numeric values in this config setting.

btnAddVersions3.OnClientClick = "ShowAddToBasketPopup(" & KartSettingsManager.GetKartConfig("frontend.basket.behaviour") * 1000 & ")"

I am struggling to understand the intended use of this line of code so not sure personally how to handle 'y' and 'n' values. I am going to put a work around in my code which will just ignore both cases, but could someone who understands the background to this line of code please add the necessary for those two cases please?

For now I will just wrap it for my application:

If IsNumeric(KartSettingsManager.GetKartConfig("frontend.basket.behaviour")) Then
btnAddVersions3.OnClientClick = "ShowAddToBasketPopup(" & KartSettingsManager.GetKartConfig("frontend.basket.behaviour") * 1000 & ")"
End If
By Paul - Thu 21 Jul 2016
The options work as follows... a number means that on clicking an 'add to basket' button, you see a popup for that number of seconds showing 'Item added to basket'.

If 'n', no popup is displayed. The only visible cue that something happened is that the basket total changes.

If 'y', the user is taken to the basket on adding an item to it.

I've tested locally and these seem to work, I don't get errors logged. Will have to look for the line you mention when I get time to see if that actually runs - are you hitting a problem with this?
By Tiggywiggler - Sun 24 Jul 2016
Yes, it is specifically only hitting on this line, elsewhere checks against the config setting do not create an issue.