Re: Reward Points Module- Live Release now available.
Quote:
Originally Posted by
Defkon1
I have the following problem: in the product page the points are calculated on base price (wrong) and when I add it to the cart they are calculated on the subtotal (base price+taxes - right).
how to fix the points amount shown in product page?
thanks in advance
Actually I temporarily fixed adding to reward_points_function.php:90 the following code:
PHP Code:
//DFK - add taxes to reward_price
$taxrate = zen_get_tax_rate($result->fields['products_tax_class_id']);
$reward_price+= $reward_price*$taxrate/100;
and adding "p.products_tax_class_id" field in the select query...
there's any cleaner way to fix this?
Re: Reward Points Module- Live Release now available.
In my log files I have the following myDEBUG files going on...
PHP Warning: Invalid argument supplied for foreach() in ..../includes/functions/extra_functions/reward_points_functions.php on line 314
I found a couple of others mentioning the problem far back long ago in this forum, but couldn't spot any solution if one was found.
Can anyone suggest how to trouble shoot or what the error means?
Line 314 reads: foreach($module_list as $module)
Line 315 if($module['action']=="Subtract")
Re: Reward Points Module- Live Release now available.
Hi there,
Looking for a "best practice" piece of advice please :)
I want to update a bulk load of reward points, something like: Customers who purchased X get bonus points.
I was thinking about doing this in SQL or something similar:
Code:
update reward_customer_points
set pending_points = 10000
where products_id = 3
Then letting the system allocate them overnight.
Unless I can ADD them (not rewrite the value) to existing earned (reward_points) (so 300, 500, 725 becomes 10300, 10500, 10725 as I'm adding 10000).
What is the best way of doing this as I don't want to manually allocate 300 orders :) Thank you.
Re: Reward Points Module- Live Release now available.
Just a gentle bump.
I'm looking at either "add to pending" then wait (if SQL modified points added to pending will update overnight), or a way to combine existing points to a new value.
Which is the best way of doing this (as per my previous post, and this one).
Cheers.
Re: Reward Points Module- Live Release now available.
Originally Posted by southshorepizza
Okay so I have done all of these things. I also have gone back in and found post 441-451 in this thread about my last attempt at the upgrade. I have the same results!
Log says
[28-Mar-2014 14:24:44] PHP Fatal error: Call to undefined function getrewardpoints() in /home4/w57dsjmm/public_html/order/includes/modules/order_total/ot_reward_points_display.php on line 40
however line 40 of said file is $reward_points=GetRewardPoints($order->products);
I feel as if this is ground hog day all over again!
And do you have a GetRewardPoints function in \admin\includes\functions\extra_functions\reward_points_functions.php. (case sensitivity counts..) You would copy over the one from the store side function file.. Saying you did what was suggested and still got an error doesn't provide enough info to determine why.. POST the changes you made to the admin functions file.. The error says you DON'T have the function in admin functions file.. might be best if you not only post the part you added but a couple of lines above and below it to make sure you didn't add e character that isn't supposed to be there.. (on the Rewards Points support thread of course )
Diva Vocals or anyone else,
I don't have anything here:
\admin\includes\functions\extra_functions\reward_points_functions.php.
I do have the file indicated in the log at:
/order/includes/modules/order_total/ot_reward_points_display.php
As indicated in the log the error is:
Call to undefined function getrewardpoints()
As Ilhungil indicated that it should be a call to function GetRewardPoints() but for some reason the log shows it all in lower case.
My file at /order/includes/modules/order_total/ot_reward_points_display.php I will put line 40 in red text but the file looks like this:
Code:
class ot_reward_points_display
{
var $title, $output;
function ot_reward_points_display()
{
$this->code = 'ot_reward_points_display';
$this->title = MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_TITLE;
$this->description = MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_DESCRIPTION;
$this->sort_order = MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_SORT_ORDER;
$this->output = array();
}
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);
}
function check()
{
global $db;
if (!isset($this->_check))
{
$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_STATUS'");
$this->_check = $check_query->RecordCount();
}
return $this->_check;
}
function keys()
{
return array('MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_STATUS', 'MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_SORT_ORDER');
}
function install()
{
global $db;
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('This module is installed', 'MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_STATUS', 'true', '', '6', '1','zen_cfg_select_option(array(\'true\',\'false\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_REWARD_POINTS_DISPLAY_SORT_ORDER', '1000', 'Sort order of display.', '6', '2', now())");
}
function remove()
{
global $db;
$db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
}
?>
If I am supposed to have this file in the Admin root as well that could be my problem. But I don't think I'm missing a file there or the log would have given me that address wouldn't it?
Re: Reward Points Module- Live Release now available.
Quote:
Originally Posted by
southshorepizza
... I don't have anything here:
\admin\includes\functions\extra_functions\reward_points_functions.php. ...
If you are indeed using Reward Point Full Suite (and the file you mentioned does not exist), it sounds like the module is not installed correctly. Adding the file "/admin/includes/functions/extra_functions/reward_points_functions.php" is part of the installation of Reward Point Full Suite. If files are missing, best to re-install (after making a backup of course).
Once everything is installed correctly there will be a file in that location and one can follow the instructions in this post.
Note: When people refer to file paths starting with "admin" they are referring to the physical name of the folder where the administrative files for Zen Cart are located. In Zen Cart 1.5+ this will what one renamed the admin folder to during the installation. For example, if you access the Zen Cart administrative interface using "https://mysite.com/my_secret_admin_xYe5Ade/"... Then the above mentioned file should be located at "/my_secret_admin_xYe5Ade/includes/functions/extra_functions/reward_points_functions.php".
Re: Reward Points Module- Live Release now available.
Thank you. It is a little after 5pm here on a Friday. I guess tonight after dinner rush(I'm in a pizza restaurant) I'll reinstall the rewards module. I don't know how I have a partial install. I swear I have uninstalled and reinstalled this thing several times. But I'll try it again. :frusty:
I'll post back my results. I'm renaming the admin folder and then using filezilla to upload these files. So I would assume they are going into the right directories!
Thanks again for your help. I hope I can get this sorted out. E.O 4.1 looks awesome! Rewards Points is a great add on for my customers as well. They love it!
Re: Reward Points Module- Live Release now available.
Quote:
Originally Posted by
southshorepizza
Thank you. It is a little after 5pm here on a Friday. I guess tonight after dinner rush(I'm in a pizza restaurant) I'll reinstall the rewards module. I don't know how I have a partial install. I swear I have uninstalled and reinstalled this thing several times. But I'll try it again. :frusty:
I'll post back my results. I'm renaming the admin folder and then using filezilla to upload these files. So I would assume they are going into the right directories!
Thanks again for your help. I hope I can get this sorted out. E.O 4.1 looks awesome! Rewards Points is a great add on for my customers as well. They love it!
It's as lhungil said. You have not installed Reward Points correctly. You simply have not named the admin folder correctly.
Re: Reward Points Module- Live Release now available.
I looked at the upgrade folder for v1.5.0 it doesn't have a functions or extra functions folder. That is where part of my error is.
Okay so I renamed the admin folder. Filezilla uploaded the new installation files. Tried to load the new install SQL and received the white page error message. The error log showed:
28-Mar-2014 23:47:33] PHP Fatal error: 1062:Duplicate entry '0-0' for key 'unique_id' :: INSERT INTO zen_reward_master (rewards_products_id ,scope ,scope_id ,point_ratio ,bonus_points, redeem_ratio, redeem_points) VALUES (NULL , '0', '0', '1.0000', NULL, 0.01, NULL); in /home4/w57dsjmm/public_html/order/includes/classes/db/mysql/query_factory.php on line 120
So I went back to the instal sql patch page and uploaded the upgrade sql file and ran it. 9 statements processed so every thing looked good.
Now when giving out points I get the following error log:
[28-Mar-2014 23:48:11] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND status=0 ORDER BY date DESC LIMIT 12' at line 1 :: SELECT rewards_id, orders_id, date, reward_points, status FROM zen_reward_status_track WHERE customers_id= AND status=0 ORDER BY date DESC LIMIT 12; in /home4/w57dsjmm/public_html/order/includes/classes/db/mysql/query_factory.php on line 120
I had the problem before and never received an answer. Diva Vocals said she could see the problem by the log but not where or how to fix it which left me with no answer. Shortly thereafter I went ahead and uploaded my backup files to my earlier version. I'd really like to get this fixed!
The error log was generated when I transferred points from pending to earned.
Please help me
Thank you,
David
Re: Reward Points Module- Live Release now available.
I am wondering if this area of admin/customer_reward_points.php is what is causing me an issue when I transfer all pending points to earned points. I have no idea how to read this or modify it if it is the area. But the wording does look like it matches the error log and I am transferring all to earned.
Code:
case 'update':
if(isset($_GET['id']))
{
$id=$_GET['id'];
if(isset($_REQUEST['customers_reward_group']))
$db->Execute("UPDATE ".TABLE_CUSTOMERS." SET customers_group_pricing=".$_REQUEST['customers_reward_group']." WHERE customers_id=".$id.";");
$pending_delta=0;
$earned_delta=0;
if(($current_reward_points=GetCustomerRewardPointsRecord($id))!=null && isset($_REQUEST['total_points_action']))
switch($_REQUEST['total_points_action'])
{
case 'TransferAllToEarned':
$earned_delta+=$current_reward_points->fields['pending_points'];
$pending_delta-=$current_reward_points->fields['pending_points'];
$db->Execute("UPDATE IGNORE ".TABLE_REWARD_STATUS_TRACK." SET status=".STATUS_PROCESSED." WHERE customers_id=".$id." AND status=".STATUS_PENDING.";");
break;