[ic] Shipmode display, little help needed

David Bordas bordas at testadaz.com
Sun Jul 16 06:40:54 EDT 2006


Hi list,

I'm using IC 5.2.0 for quite a year, it's a great software.
But sometimes, littles changes took me a long time.
I know, i need to learn more about IC, but i'm trying to learn :)

For the moment, i'm fighting with [shipping] and [mv_shipmode] on 
shipmode.html (like this one 
http://demo.icdevgroup.org/i/demo4/ord/shipmode.html).

I'm trying to add ship method and i got problems with "€" html code.

General code pour shipmodes
[tmp tmp_shipmodes][shipping possible=1][/tmp]
[seti ship_options][filter op="strip line2options" interpolate=1]
[loop list="[scratch tmp_shipmodes]"]
[set num][loop-increment][/set]
[loop-code]=[shipping-desc mode="[loop-code]"] ([shipping 
mode="[loop-code]"])
[/loop]
[/filter][/seti]


Solution 1 :
Here's the tag used for the display part :
[shipping widget=radio_left_1 mode="[scratch tmp_shipmodes]"]

Here's the produced html code :

<TABLE>
<TR><td><input type="radio" name="mv_shipmode" value="ColissimoSuivi"></td><td>Colissimo Suivi (7,00 &amp;euro;)</td></TR>
<TR><td><input type="radio" name="mv_shipmode" value="Chronopost" CHECKED></td><td>Chronopost 24h (20,00 &amp;euro;)</td></TR>
</TABLE>

You can see that '&' is replaced by '&amp;', so currency (&euro;) isn't 
displayed correctly.
I've tried to put tmp_shipmodes trought [filter] tags without success.
In perl, i can do that with '$string =~ s/\&amp;/\&/g', but i can't 
figure how to tell IC to do this.
Perhaps with a perl tag, but should i use this on tmp_shipmodes in the 
loop ? elsewhere ?


Solution 2 :
As i can't find a solution with this code, i'm trying a new one :
[loop list="[scratch tmp_shipmodes]"]
<TR><td><input type="radio" name="mv_shipmode" value="[loop-code]"
[if  [value mv_shipmode] eq [loop-code]
CHECKED
[/if]
 ></td><td>[shipping-desc mode="[loop-code]"] ([shipping 
mode="[loop-code]"])</td></TR>
[/loop]
</TABLE>

This seems to look better, but all methods are Checked, i think my 'IF' 
is wrong.
But i don't know why.

So, did i find a way to use a [filter] to rewrite '&amp;' to '&' and 
continue using solution 1 or should i correct my 'if' syntax (and how ?) 
and use solution 2 ?

Thank you.
David


More information about the interchange-users mailing list