Reinstalling this as part of a v1.5.4 upgrade for a client.. Can someone explain WHY the upgrade SQL contains the admin page delete statements only to RE-INSERT the same entries again later in the script??
As far as I can see the only REAL "upgrade/change" is the addition of one more configuration option.. Am I missing something here?????Code:/* zencart 1.5 mods */ DELETE FROM admin_pages WHERE page_key='configRewardPoints'; DELETE FROM admin_pages WHERE page_key='GroupRewardRedeem'; DELETE FROM admin_pages WHERE page_key='RewardPoints'; DELETE FROM admin_pages WHERE page_key='CustomerRewardPoints'; SELECT @cgi:=configuration_group_id FROM configuration_group WHERE configuration_group_title = 'Reward Points'; INSERT INTO configuration (configuration_id ,configuration_title ,configuration_key ,configuration_value ,configuration_description ,configuration_group_id ,sort_order ,last_modified ,date_added ,use_function ,set_function) VALUES (NULL , 'Show Reward Points on Product Info Display Page', 'SHOW_REWARD_POINTS_PRODUCT', '0', 'Display Reward Points on product info display page?<br />0= No<br />1= Yes', @cgi, '1', NULL, now(), NULL , 'zen_cfg_select_option(array(''0'', ''1''), '); INSERT INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order) VALUES ('configRewardPoints','BOX_CONFIGURATION_REWARD_POINTS','FILENAME_CONFIGURATION',CONCAT('gID=',@cgi), 'configuration', 'Y', @cgi); INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('GroupRewardRedeem', 'BOX_GROUP_REWARD_POINTS_REDEEM', 'FILENAME_ADMIN_GROUP_REWARD_POINTS_REDEEM', '', 'customers', 'Y', 35); INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('RewardPoints', 'BOX_REWARD_POINTS', 'FILENAME_ADMIN_REWARD_POINTS', '', 'catalog', 'Y', 36); INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('CustomerRewardPoints', 'BOX_CUSTOMER_REWARD_POINTS', 'FILENAME_ADMIN_CUSTOMER_REWARD_POINTS', '', 'customers', 'Y', 37);
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
more upgrade questions..
regarding the admin/orders.php file
on line 607 I see this change:
the default code is this:Code:' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .
Is this a Rewards points change?? (there are no code comments to help clarify this if it is) If it is a Rewards Points modification, I need some clarification as to what EXACTLY this change does???Code:' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .
Also because the orders.php file bundled in the Rewards Points module is from the last v1.5.4RC version and NOT the final release, it is MISSING a language file change that went into the last release v1.5.4RC version and eventually into the final release code.
line 978 reads:
It should be:Code:$contents[] = array('text' => 'Products Ordered: ' . sizeof($order->products) );
Code:$contents[] = array('text' => TABLE_HEADING_PRODUCTS . ': ' . sizeof($order->products) );
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
I believe the change is to show the "text" field from the order_total database table directly instead of reading from the "value" and displaying based upon currency rules.
It has been a long time since I have looked at this module, But If I remeber correctly the order total module for reward points uses the "text" field to display the "points" and leaves the value at 0 for earned (and a monetary value if redeemed).
Last edited by lhungil; 19 Jan 2015 at 05:05 AM.
Okay that makes sense.. I get the WHAT it does.. Now the question is WHY.. I am starting to suspect that this is some legacy thing that is still in this code.. because I left this change out and cannot see it making any difference.. Now I am have NEVER used this module before, so it could be I am just not getting it here, but I cannot see how this change is needed..
so is the change to the admin/orders.php required for this to work??
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Regarding my previous post..
Now I see what happened and when this code was introduced into the base module.. Thanks to a little birdie, I found these posts from the old support thread:
Now at the risk of offending anyone, IMHO this code should have NEVER found it's way into the base module.. I am not a fan of modules which include incomplete solutions which IMHO this code change is.. I think lhungil was on the right track on what the RIGHT solution SHOULD be. Perhaps the change to the orders.php file would have been better served as an instruction included in the readme as opposed to being made part of the code base. This way for those who are okay with this solution knowing the pros and cons of it can implement if they wish.. Or make this "bandaid" solution an admin on/off option..
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Okay so after thinking about this I think I know what solution I would prefer to implement to achieve the objective of showing the actual points earned (the results of the order_total table's "text" column) on the order detail page..
Been messing around with stuff, and I think what would work while still keeping the currency support is the following:
Show ALL order totals from the order_total table where the class is not = to "ot_reward_points_display" display the "title" and the "value" columns
BUT...<?php
for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
echo ' <tr>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .
' </tr>' . "\n";
}
?>
If there are order totals from the order_total table where the class is = to "ot_reward_points_display", show those totals JUST below the other orders totals, but display the values in the "title" and the "text" columns.
Now I've been messing around but I'm not sure how to do this..Code:<?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { echo ' <tr>' . "\n" . ' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?>
I tried this:
No dice..Code:<?php if ($order->totals['class'] !== 'ot_reward_points_display') { code for showing default order totals code which supports currencies goes here. Will exclude Reward Points } if ($order->totals['class'] == 'ot_reward_points_display') { code for showing default order totals code which supports currencies goes here. Will include Reward Points } ?>
I tried this:
Again no dice..Code:<?php if ($order->totals['class'] !== 'ot_reward_points_display') { code for showing order totals code which supports currencies goes here. Will exclude Reward Points } ?> <?php if ($order->totals['class'] == 'ot_reward_points_display') { code for showing default order totals code which supports currencies goes here. Will include Reward Points } ?>
Hoping a kind community member will jump in here..
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Hi Diva you can redo and submit any changes you see fix. Was just trying to keep things simple from all the it you want to do this replace this with this. Want hurt my felling at all.....![]()
Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
I am having an issue with the Rewards Points Full Suite that is driving me nuts:
Basically it has to do with Redeeming the points.
Situation is this:
When I a customer redeems points on their purchase to things happen;
1/ the points on their purchase is always incorrect
2/ the tax figure showing is incorrect not updating
The attached images will give you an idea what I mean
The points earned on this order should be 153 (not 150)
GST (tax) content of the order should be $19.89 (not $22.50)
I have worked out the the missing 3 points relates to the GST figure not updating collectly
If points aren't redeemed all works well as per attached:
I'm setting up on my test site which I have configured for NZ Tax's (GST) of 15% & have stripped all other Discount Modules of the site in case there was a conflict with them.
At the present time the development site which will become the live site has been set up with no tax's & it works with no problem at all EG
The Rewards Module is set up out of the box so to speak, but I have set the "Global Reward Point ratio:" at 1.1500 to account for the tax rate that we need to charge on Goods & Services & I quickly figured out that the points are calculated on the Net Product Price (ex tax)
Is there something that I need to do on the mod or is it a tax related issue that I should explore on the tax thread??
I would appreciate any help in sorting this out - Driving me insane - all works well except this issue.
Bookmarks