Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

PHP Programming Question... Need Help


Recommended Posts

Hi Guys, I'm trying to do a mod on the "Loyalty Discount" Contribution but I'm not good with PHP at all, can some one help me with the Programming please... Thanks. Here it goes...


This file contains the define :



define('MODULE_LOYALTY_DISCOUNT_TITLE', 'Customer Loyalty Discount');



and the rest... you get the idea. B)



This file contains the processing codes:



and I think this is the line I'm looking for :


function process() {

global $order, $ot_subtotal, $currencies;

$od_amount = $this->calculate_credit($this->get_order_total(), $this->get_cum_order_total());


if ($od_amount>0) {

$this->deduction = $od_amount;

$this->output[] = array('title' => $this->title . ':<br>' . MODULE_LOYALTY_DISCOUNT_SPENT . $currencies->format($this->cum_order_total) . $this->period_string . MODULE_LOYALTY_DISCOUNT_QUALIFY . $this->od_pc . '%:',

'text' => '<b>' . $currencies->format($od_amount) . '</b>',

'value' => $od_amount);

$order->info['total'] = $order->info['total'] - $od_amount;

if ($this->sort_order < $ot_subtotal->sort_order) {

$order->info['subtotal'] = $order->info['subtotal'] - $od_amount;




Which should out put something like this when check out:




as like you see on the picture, I would like to be able to write the total amount that the cutomer has purchased, and the discount percentage they qualify for in the customer's "My Account" section in catalog/admin.php like here :





However, I've been trying this for the pass I don't know how many hours and counldn't get it to work..... Please help me out on this if you know how,



If you need the full codes, here it is :



Thanks in advance.

Link to comment
Share on other sites


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

  • Create New...