No replies
fivepoints's picture
Offline
Getting busy with the Ubercode.
Joined: 09/26/2007
Juice: 258
Was this information Helpful?

hallo,
I want to show a discounted price and the normal price on cart screen.
how can I add this information?
I take the discounted price froma a mysql table, and now I calculate the price with hook_cart_item:

<?php
function uc_cq_discounts_cart_item($op, &$item) {
  switch(
$op) {
   case
'load':
   
$query_temp = 'myquery...';
   
$num_rows = db_result(db_query($query_temp));
    if (
$num_rows > 1) {
     
$query = 'another query...';
     
$result = db_query($query);
      while (
$row = db_fetch_object($result)) {
       
$item->price = $row->list_price-(($row->list_price*$row->discount)/100);
      }
    }
  }
}
?>

I want to show the discount ($row->discount) on the cart screen, below the price (like attribute module: it prints the options on the cart screen). I just want to print something like this:

<?php
echo '<p>'.$item->price.'<br />Discount: $row->discount</p>';
?>

I dont understand how to print my discount.

thanks so much