[ic] sql-param foo returning HASH(0x9e1f804) ?? any ideas??

Tim Good draco at edsd.com
Wed May 19 12:41:49 EDT 2004


Good day,

I have the following code in order_view page:

[query list=1 table=orderline sql="select * from orderline where
order_number = '[loop-code]'"]
            <tr class="[sql-alternate
2]rowalt[else]rownorm[/else][/sql-alternate]" valign=top>
               <td>
                   [delitem curo="[loop-code]" delitem="[sql-param
sku]"]
                   <form name="deleteitem" action="[process]"
method=post>
                   <input type=hidden name=mv_session_id value="[data
session id]">
                   <input type=hidden name=mv_action value=back>
                   <input type=hidden name=order value="[loop-data
transactions order_number]">
                   <input type=hidden name=mv_nextpage
value="@@MV_PAGE@@">

                   [button text='delete' src='delsm.gif' hidetext=1
confirm="Are you sure you want to delete item [sql-code] ?"
form='deleteitem']
                     mv_click=[delitem curo="[loop-code]"
delitem="[sql-param sku]"]
                   [/button]
                   </form>
               </td>
               <td style="padding: 5px">[page href="admin/order_status"
 
form="order=[loop-code]"
 
]
                [display    table=orderline
                            column=status
                            key="[sql-code]"
                            type=display
                ]</A>
[calc]
        $total_weight += ([field field=weight key="[sql-param sku]"] + 0
|| 0) * [sql-data orderline quantity];
        return;
[/calc]
               <td style="padding: 5px">[sql-param sku]</td>
               <td style="padding: 5px">
[sql-filter 30.][sql-param description][/sql-filter]
[if-sql-param size]
<br>[L]Size[/L]: [sql-param size]
[/if-sql-param]
[if-sql-param color]
<BR>
[L]Color[/L]: [sql-param color]
[/if-sql-param]

[if-sql-param options]
<BR>
[L]Options[/L]: [sql-param options]
[/if-sql-param]
                           </td>
               <td align=right style="padding: 5px">[sql-param
quantity]</td>
               <td align=right style="padding: 5px">[currency][sql-param
price][/currency]</td>
               <td align=right style="padding: 5px">[currency][sql-param
subtotal][/currency]</td>
            </tr>
[/query]

within this code I have a custom usertag named delitem. The tag code is:

UserTag delitem Order curo
UserTag delitem PosNumber 2
UserTag delitem addAttr
UserTag delitem Routine <<EOR
sub {
        my ($curo,$delitem) = @_;
        return "order=$curo and item=$delitem";

        my ($sql, $results, $deliteminfo, $itemsub, $iteminstall,
$totcst);

        $sql = "select * from orderline where order-number = $curo and
sku = $delitem";
        $deliteminfo = $Tag->query({ table=>'orderline', sql=>$sql,
wantarray=>1 });

        $sql = "delete from orderline where order_number = $curo and sku
= $delitem";
        $results = $Tag->query({ table=>'orderline', sql=>$sql });

        $totcst = 0;
        $itemsub = $deliteminfo->[0]->[10];
        $iteminstall = $deliteminfo->[0]->[24];
        $totcst -= $itemsub + $iteminstall;
        $sql = "update tranactions set total_cost = $totcst where
order_number = $curo";
        $results = $Tag->query({ table=>'transactions', sql=>$sql });

        return "order=$curo item=$delitem";

}
EOR

I have the first return line for debugging. I wanted to see what is
passed to tag. 
Why is [sql-param sku] returning order=00015 and item=HASH(0x9e1f804) ?
How can I 
get the sku for a paticular item passed to my usertag?

Thanks,

Tim




More information about the interchange-users mailing list