<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Try this again just in case...<br>
<br>
I have a few line item scripts that all happen on the checkout
page. The one that is giving trouble is a coupon line item.</p>
<ul>
<li>All line items are being saved to the database, as should be
with hook-order.</li>
<li>All line items display, as they should but the tax is
incorrect.</li>
<li>In admin/store/settings/taxes/1/edit I have a tax set up with
a couple of rules.
<ul>
<li>These should have no bearing: one being the state for the
tax and another being a user role (wholesalers are not
taxed) .</li>
<li>Tax is applied to the Coupon line item on this page, as
well as to the products.</li>
<li>I also set the Coupon line item type as taxable.<br>
</li>
</ul>
</li>
</ul>
<p>It is correct on the checkout page(it is written in real time
with line_item_add JS...<br>
</p>
<p>However, when I output the order to screen in the uc_tax
module... my line items aren't in the order yet.<br>
I am using hook order with the $op of "save".<br>
</p>
So I tried playing with line item weights: to try to get the total
line item after my coupon.<br>
If I use the following, it throws a fatal error on the review page
load.<br>
static $lines;<br>
$lines = module_invoke_all('line_item', NULL); // this produces the
names in the next array to which I added weights...<br>
Actually re-ordered them. I think "total" was 2nd or 3rd.<br>
$l_item_ids = array(<br>
'subtotal' => 0,<br>
'generic' =>1,<br>
'coupon' => 2,<br>
'free_offer' => 3,<br>
'shipping' => 4,<br>
'handling' => 5,<br>
'total' => 6<br>
);<br>
foreach( $lines as $i => $line ){<br>
foreach($l_item_ids as $id => $weight){<br>
if( $id === $line['id'] ){<br>
$lines[$i]['weight'] = $weight;<br>
// uc_li_tax_subtotal_weight<br>
// variable_set('uc_line_items_'. $lines[$i]['id']
.'_weight', $weight);<br>
}<br>
}<br>
}<br>
<div class="forum-post-wrapper">
<div class="forum-post-panel-main clear-block">
<div class="content">
<p>
So nothing is working and I have no idea where to turn.<br>
Seems like line item weights would be taken into
consideration. Hints anyone?</p>
</div>
</div>
</div>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<title></title>
<br>
<br>
<table border="0" cellpadding="5">
<tbody>
<tr>
<td scope="col"><em>Kindest regards,</em></td>
<th scope="col"><em><strong>Dayton Perkins</strong></em></th>
<th scope="col"><img
src="cid:part1.01030004.03010900@gmail.com" alt="Dayton
Perkins"
longdesc="http://goodnewsdesign.com/images/signature.gif"
width="208" height="60"></th>
</tr>
</tbody>
</table>
<div style="font-family: "Comic Sans MS"; text-align:
center; display: block; margin-bottom: 20px;">
<p style="color: rgb(0, 153, 0); font-size: 1em; font-weight:
bold; text-align: center;"> Good News Design </p>
<p style="color: rgb(0, 0, 153); font-weight: bold;">
Intelligent Web Programming for Business<br>
Dayton Perkins: Recent American Expat in Hong Kong<br>
</p>
<table style="margin: auto;" border="0" cellpadding="5">
<tbody>
<tr>
<td> <a href="mailto:dayton@goodnewsdesign.com"
title="send mail to dayton@goodnewsdesign.com"> <img
src="cid:part2.07030908.07070306@gmail.com"
alt="dayton@goodnewsdesign.com" border="0"> </a> </td>
<td> <a href="mailto:dayton@goodnewsdesign.com"
title="send mail to dayton@goodnewsdesign.com">
dayton@goodnewsdesign.com</a> </td>
</tr>
<tr>
<td> <img src="cid:part5.05060204.04010402@gmail.com"
alt="Phone Me"> </td>
<td> U.S Phone (rings me in HK) 616-795-9039 </td>
</tr>
</tbody>
</table>
<p style="font-size: 0.85em; text-align: center;"> <a
href="http://goodnewsdesign.com" style="text-decoration:
none;" onmouseover="this.style.color='#006600'"
onmouseout="this.style.color='#CCCCCC'" title="Visit">
http://goodnewsdesign.com<br>
<img moz-do-not-send="false" style="border: 0pt none;"
src="cid:part6.06070707.05060601@gmail.com" alt="GND Logo"></a><a
href="http://goodnewsdesign.com" style="text-decoration:
none;" onmouseover="this.style.color='#006600'"
onmouseout="this.style.color='#CCCCCC'" title="Visit"> </a>
</p>
</div>
<br>
<br>
</div>
</body>
</html>