Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Reward points V1.50 Invoice and Orders Help


sz473

Recommended Posts

To refresh My dilemma,

 

I am trying to make it so my staff can easily charge the customers the correct amount, minus the redeemed points.

For example the orders page shows:

 

Sub-Total: $ 75.00

Table Rate (Best Way): $ 5.00

Total: $ 80.00

 

What I want for the orders page is that when points have been confirmed for it to show

 

Sub-Total: $ 75.00

Redeemed Points: - $20.00

Table Rate (Best Way): $ 5.00

Total: $ 60.00

 

I have made the following Modifications:

admin\includes\classes\order.php

 

class order {

var $info, $totals, $products, $customer, $delivery, $points;

 

function order($order_id) {

$this->info = array();

$this->totals = array();

$this->products = array();

$this->customer = array();

$this->delivery = array();

$this->points = array();

 

$this->query($order_id);

}

 

function query($order_id) {

$order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

$order = tep_db_fetch_array($order_query);

 

$points_query = tep_db_query("select points_pending from ". TABLE_CUSTOMERS_POINTS_PENDING ." where orders_id = '" . (int)$oID . "'");

while ($points = tep_db_fetch_array($points_query)) {

$this->points[] = array('value' => $points['points_pending']);

}

 

In admin\orders.php I have done the following:

 

<?php

for ($i = 0, $n = sizeof($order->points); $i < $n; $i++) {

echo ' <tr>' . "\n" .

' <td align="right" class="smallText">' . $order->points[$i]['value'] . '</td>' . "\n" .

' <td align="right" class="smallText">Test</td>' . "\n" .

' </tr>' . "\n";

}

?>

In my CUSTOMERS_POINTS_PENDING table, my customer has 35 points bit I keep wrong numbers.

 

WHat can I do?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...