Get ready for BLACK FRIDAY shopping starting in

HTML5 Data Bindings Formatter Support Product Page

Answered

an if satement with HTML5 Data Bindings Formatter

Asked 12 Mar 2014 02:35:18
1
has this question
12 Mar 2014 02:35:18 Mr. em posted:
I need to write a condition something like this below with HTML5 Data Bindings
I thought when you ASP I can still do it writing ASP Code with your extension, I need some help here please

I thought this might work but not (don't laugh )

<% If {{OnSpecail}} = "1" Then %>
{{rsProductDetail.data[0].UnitPrice.currency( "$", ".", ",", 2 )}}
<% Else %>
{{rsProductDetail.data[0].SpecialPrice.currency( "$", ".", ",", 2 )}}
<% End if %>

This is the ASP Code
<%
If rsProducts("OnSpecial" = "1" Then
rsProducts("SpecailPrices"
Else
rsProducts("UnitPrice"
End IF
%>

Please Help anybody

Replies

Replied 12 Mar 2014 10:28:07
12 Mar 2014 10:28:07 Teodor Kuduschiev replied:
Hello,
You cannot use asp code with the data bindings elements this way.
You can achieve this following these steps:
1. Wrap your
{{rsProductDetail.data[0].UnitPrice.currency( "$", ".", ",", 2 )}}
and
{{rsProductDetail.data[0].SpecialPrice.currency( "$", ".", ",", 2 )}}
in span tags
2. Select the span tag of the normal price, in the Data Bindings Tree select the {{OnSpecail}} element, in the dropdown menu on the left of the bind button select span.data.hide, then click Bind
3. Do the same with the special price span but then select: span.data.show

This way when the onspecial=1 the special price span will be displayed and the normal price span will be hidden.
Replied 12 Mar 2014 19:33:10
12 Mar 2014 19:33:10 Mr. em replied:
You are missing one verifiable rsProducts("onSpecial"
there 3 variables in thersProducts Tabel
1. UnitPrice
2. onSpecial (Yes or No (bit)
3. SpecialPrice

if onSpecial = Yes then
SpecialPrice
else
UnitPrice
Replied 12 Mar 2014 20:20:17
12 Mar 2014 20:20:17 Teodor Kuduschiev replied:
I am actually not missing anything. Please check my explanation once again..

Reply to this topic