[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] [total-cost] & [salestax] & manually added items


At 12:10 AM 10/11/2004, you wrote:

Hello list,

for an SAP-OCI-interface implementation I put items (not existing in the
products db) manually into the users basket. Price, taxrate, description
etc. come per item dynamically from the interface (simple http-post
submission...), so I loop through $CGI and put these items into the
active cart:

push (@{$Carts->{main}}, {
                        code=>"$v",
                        description=>$desc,
                        price=>$price,
                        quantity=>$qty,
                        comment => $long,
                        supplier_id => $sup,
                        taxrate => $tax,
                        oci => 1,
                });

In the [item-list] I can access several item properties (e.g. taxrate,
price) only by using [item-modifier ...], that's ok and I can handle
that but how can I make [total-cost] and [salestax] at the end of my
basket page show the correct values including quantity,price and taxrate
of my manually added items?!?! :|
Do I have to add the items otherwise? As onfly-items? Who can help me?
=)

regards,
cj

If you use 'mv_price' instead of 'price' in your cart attributes, the subtotal should tally up automatically in the foundation demo, since the CommonAdjust atom '$' is designed to do this.\

Do you really need to post the taxrate individually with each item? Do your taxrates vary per-item and per-order? If not (or even if so), you should just use one of the built-in methods for calculating tax that are available in interchange. If you really need to do it your way, I guess you could do something like this in Perl:

my $tax;
foreach (@$Items) {
        $tax += $_->{mv_price} * $_->{quantity} * $_->{taxrate};
}
$Tag->assign( { salestax => $tax } );


- Ed

===============================================================
New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          suppressed
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax
===============================================================
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.