[ic] [perl] And Place order button ...

David Bordas interchange-users@icdevgroup.org
Thu Dec 12 08:54:00 2002


Hi all,

I've got an other problem and i need some help.
In fact, i'm in checkout.html and i want not to display the "Place Order"
button if a ship_message is displayed.

Quite easy to explain but not to do :(

I try something like
[if value ship_message]
....

or
[if session ship_message]
...

But don't work :(.

One thing surprising is that the [if session ship_message] is working in the
middle of the page with code like this :
[if session ship_message]
   <tr>
    <td class="contentbar1" > </td>
  <td colspan="3" class="contentbar1">
   [data session ship_message]
   <br>
</td>
  </tr>
  [/if]

But something like that :
[if !session ship_message]

[button
   name="mv_click"
   src="__THEME__/placeorder.gif"
   text="Place Order"
   hidetext=1
   form=checkout
  ]
   mv_todo=submit
   mv_successpage=../special_pages/paybox
 [/button]

[else]
<b>Error !</b>
[/else]
[/if]

don't work :(
It always display the error message even if i remove the "!" before session.

So i try some perl code:
[perl failure="Perl code error <BR>"]
  if($bool == 0)
  {
     return("<td>
<INPUT TYPE=\"submit\" NAME=\"mv_click\" VALUE=\"Place Order\">
</td>
<td>
<INPUT TYPE=hidden NAME=\"mv_click_map\" VALUE=\"Recalculate\"><INPUT
TYPE=hidden NAME=\"mv_click_Recalculate\" VALUE=\"\"><A
HREF=\"javascript:void 0\" onMouseOver=\"window.status=\'Recalculer\'\"
onClick=\" (checkout.mv_click_Recalculate.value=\'Recalculate\') &&
checkout.submit(); return(false);\"  ALT=\"Recalculer\"><IMG
ALT=\"Recalculer\" SRC=\"/teddy/images/foundation/recalculate_button.gif\"
border=0 align=top></A>
</td>");
     }
     else
     {
    return("<b>Error</b>");
    }
[/perl]

I set the $bool to 1 if a shipping message is displayed.

The html tag input ... is what's generate the [button] ...

Now i can see the button, but if i click on it, nothing is done :(

I take several hours to find a way to do that but don't find any for the
moment :(

PS : i'm using ic 4.8.2

Thanks in advance
David