If anyone is wanting to display a different message for COWOA custmers, here's how I did it...as for having a negative impact, I haven't noticed.
In fact, I have had customers sign up for a full account and ask if they can have their points from their COWOA order, which I'm always glad to do!
The good thing about this mod is the points do get stored against the COWOA order so you can see how many points to transfer across to the full account.
Add the following defines to file includes/languages/english/modules/order_total/ot_reward_points_display.php
Add the code below shown in red to function process() in file includes/modules/order_total/ot_reward_points_display.phpCode:define('MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TITLE', 'With a full account, you could have earned'); define('MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TAG', 'points!'); define('FONT_RED','<font color="red">'); define('UNFONT','</font>');
Code:function process() { global $order; $reward_points=GetRewardPoints($order->products); $GlobalRewardPointRatio=GetGlobalRewardPointRatio(); $AdjustValue=GetRewardPointAdvancedCalculateValue(); $reward_points+=$AdjustValue*$GlobalRewardPointRatio; if(isset($_SESSION['redeem_value'])) { /* $redeem_ratio=GetRedeemRatio($_SESSION['customer_id']); $reward_points=$reward_points/$redeem_ratio; $reward_points=$reward_points-$_SESSION['redeem_value']; $reward_points=$reward_points*$redeem_ratio; */ $reward_points=$reward_points-($GlobalRewardPointRatio*$_SESSION['redeem_value']); } if($reward_points<0) $reward_points=0; $reward_points=zen_round($reward_points,0); $_SESSION['REWARD_POINTS_EARNED']=$reward_points; if ($_SESSION['COWOA']) { $this->output[] = array('title' => FONT_RED . MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TITLE . ' ' . $reward_points . ' ' . MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TAG . UNFONT, 'text' => '', 'value' => 0); } else { $this->output[] = array('title' => $this->title . ':', 'text' => $reward_points, 'value' => 0); } }
Hi Andrew,
You can use that code, no problem.
Unicorn,
Are you using the latest version of the mod? If memory serves correctly I have 1.33a.
Does your original process() function look like this:
A blank page usually means a php syntax error or an undefined field.Code:function process() { global $order; $reward_points=GetRewardPoints($order->products); $GlobalRewardPointRatio=GetGlobalRewardPointRatio(); $AdjustValue=GetRewardPointAdvancedCalculateValue(); $reward_points+=$AdjustValue*$GlobalRewardPointRatio; if(isset($_SESSION['redeem_value'])) { /* $redeem_ratio=GetRedeemRatio($_SESSION['customer_id']); $reward_points=$reward_points/$redeem_ratio; $reward_points=$reward_points-$_SESSION['redeem_value']; $reward_points=$reward_points*$redeem_ratio; */ $reward_points=$reward_points-($GlobalRewardPointRatio*$_SESSION['redeem_value']); } if($reward_points<0) $reward_points=0; $reward_points=zen_round($reward_points,0); $_SESSION['REWARD_POINTS_EARNED']=$reward_points; $this->output[] = array('title' => $this->title . ':', 'text' => $reward_points, 'value' => 0); }
try commenting out the bit of added code, so the function would look like this:
If that works, I think it must be one of the defines that hasn't been defined:Code:function process() { global $order; $reward_points=GetRewardPoints($order->products); $GlobalRewardPointRatio=GetGlobalRewardPointRatio(); $AdjustValue=GetRewardPointAdvancedCalculateValue(); $reward_points+=$AdjustValue*$GlobalRewardPointRatio; if(isset($_SESSION['redeem_value'])) { /* $redeem_ratio=GetRedeemRatio($_SESSION['customer_id']); $reward_points=$reward_points/$redeem_ratio; $reward_points=$reward_points-$_SESSION['redeem_value']; $reward_points=$reward_points*$redeem_ratio; */ $reward_points=$reward_points-($GlobalRewardPointRatio*$_SESSION['redeem_value']); } if($reward_points<0) $reward_points=0; $reward_points=zen_round($reward_points,0); $_SESSION['REWARD_POINTS_EARNED']=$reward_points; /* if ($_SESSION['COWOA']) { $this->output[] = array('title' => FONT_RED . MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TITLE . ' ' . $reward_points . ' ' . MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TAG . UNFONT, 'text' => '', 'value' => 0); } else { */ $this->output[] = array('title' => $this->title . ':', 'text' => $reward_points, 'value' => 0); // } }
Code:FONT_RED MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TITLE MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_COWOA_TAG UNFONT
I updated my order status using super orders batch update and none of the orders have had their points moved from pending to earned.
I'm using Advanced which state Pend: [Order Processing] Earn: [Order Completed]
Why haven't the points updated.
Hi i was wondering if anybody had an answer to this problem.
I am trying to change the message for reward points shown in the product page. at the moment it says "33 reward points"
However i would like it to display as "Worth 33 Reward Points"
How can i move the Number of points?
So far i have tried changing the tpl_products_reward_points.php code to this;
and added 'PRODUCT_REWARD_POINT_TAG_1.; into the reward_points.php in the extra definitions directory.Code:echo PRODUCT_REWARD_POINT_TAG.' '.$reward_points' 'PRODUCT_REWARD_POINT_TAG_1.;
But this doesn't seem to work. I just blanks my page. If i remove the last 'PRODUCT_REWARD_POINT_TAG_1.; from the line in tpl it works again. What am i missing?
Bookmarks