Forums / All Other Contributions/Addons / Reward Points Module for ZC v13x

Reward Points Module for ZC v13x

Locked

Views: 472,226

Results 2,321 to 2,340 of 2,476
This thread is locked. New replies are disabled.
15 Nov 2013, 4:49 AM
#2321
nesum18 avatar

nesum18

New Zenner

Join Date:
Jun 2012
Posts:
50
Plugin Contributions:
0

Reward Points Module for ZC v13x

quick question here: how can i NOT display the points on the product info page and only have the points calculate during the checkout?

Thank you in advance.

15 Nov 2013, 3:12 PM
#2322
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

nesum18:

quick question here: how can i NOT display the points on the product info page and only have the points calculate during the checkout?

Thank you in advance.

Remove this chunk of code from the /includes/templates/your_template/templates/tpl_product_info_display.php.
Around line number 147

  <!--bof Product Reward Points block -->

<h2 id="productRewardPoints" class="productRewardPoints">

<?php

/**

 * display the product reward points

 */

   include($template->get_template_dir('/tpl_product_reward_points.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_product_reward_points.php');

   ?>

</h2>

<!--eof Product Reward Points block -->

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

15 Nov 2013, 5:44 PM
#2323
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Reward Points Module for ZC v13x

countrycharm:

Remove this chunk of code from the /includes/templates/your_template/templates/tpl_product_info_display.php.
Around line number 147

<!--bof Product Reward Points block --> <h2 id="productRewardPoints" class="productRewardPoints"> <?php /** * display the product reward points */ include($template->get_template_dir('/tpl_product_reward_points.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_product_reward_points.php'); ?> </h2> <!--eof Product Reward Points block -->

I don't use this mod, but do have a suggestion for a future enhancement, perhaps adding some admin on/off switches for this code block so that one can control it from the admin makes sense.. this way folks don't have to do code edits..

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.

15 Nov 2013, 6:08 PM
#2324
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

DivaVocals:

I don't use this mod, but do have a suggestion for a future enhancement, perhaps adding some admin on/off switches for this code block so that one can control it from the admin makes sense.. this way folks don't have to do code edits..

That feature would be nice. I really don't have the time but anyone can update the module or share the code which adds this feature, then it will be include.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

15 Nov 2013, 7:48 PM
#2325
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Reward Points Module for ZC v13x

countrycharm:

anyone can update the module or share the code which adds this feature, then it will be include.
Yes I know.. was making a general suggestion for an enhancement, not to be construed as request to anyone in particular...:smile:

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.

15 Nov 2013, 8:43 PM
#2326
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

DivaVocals:

Yes I know.. was making a general suggestion for an enhancement, not to be construed as request to anyone in particular...:smile:

I know that, I also know you are always out to help and suggest how to make things better. You are one of the nicest people I know. Thank you for been there when we need help and don't know what to do.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

15 Nov 2013, 10:32 PM
#2327
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Reward Points Module for ZC v13x

countrycharm:

I know that, I also know you are always out to help and suggest how to make things better. You are one of the nicest people I know. Thank you for been there when we need help and don't know what to do.

HA!! that goes double back at ya..:smile:

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.

16 Nov 2013, 3:33 AM
#2328
nesum18 avatar

nesum18

New Zenner

Join Date:
Jun 2012
Posts:
50
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

AWESOMEEEEEEEEEE :)

Thank you :D

countrycharm:

Remove this chunk of code from the /includes/templates/your_template/templates/tpl_product_info_display.php.
Around line number 147

<!--bof Product Reward Points block --> <h2 id="productRewardPoints" class="productRewardPoints"> <?php /** * display the product reward points */ include($template->get_template_dir('/tpl_product_reward_points.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_product_reward_points.php'); ?> </h2> <!--eof Product Reward Points block -->
16 Nov 2013, 4:11 AM
#2329
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

nesum18:

AWESOMEEEEEEEEEE :)

Thank you :D

Glad I could help.:smile:

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

16 Nov 2013, 10:06 AM
#2330
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

For the option to show rewards points or not in the product pages a solution could be this:

in includes/templates/YOUR_TEMPLATES/tpl_product_info_display.php find:

* display the product reward points
 */
    include($template->get_template_dir('/tpl_product_reward_points.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_product_reward_points.php');
    ?>
</h2>
<!--eof Product Reward Points block -->

Modify in:

  • display the product reward points
    */
    if (SHOW_REWARD_POINTS_PRODUCT == '1')
    {

    include($template->get_template_dir('/tpl_product_reward_points.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_product_reward_points.php');
    }
    ?>
</h2> <!--eof Product Reward Points block -->

Then using Phpmyadmin or the zencart admin patch add the following:

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 rewards point in Product Page', 'SHOW_REWARD_POINTS_PRODUCT', '0', 'Display Reward Points in the product page?<br />0= No<br />1= Yes', @cgi, '1', NULL, now(), NULL , 'zen_cfg_select_option(array(''0'', ''1''), ');

Setting to 0 the new option will not show the points in the product pages, else if you set to 1 it will show points.

NOTE: Please check if it's all correct and there is not errors of any kind. If You think ity could be useful please add it to the modules ;-)

18 Nov 2013, 9:26 AM
#2331
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Hi again,

hard work bring issues as long as solutions ;-)

First the issue: I found that when i was going to the details of an order the Rewards point shown were always 0, but if you go on the invoice module the Rewards point magically appeared. Simply in the order details the point were not shown.

it seems that the problem could be with this line in /admin/order.php around line 666

<td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .

If replaced with:

<td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .

all seems fine. Someone else got this error?

Zencart 1.51
Reward Point 2.1b

18 Nov 2013, 9:36 PM
#2332
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

izar74:

Hi again,

hard work bring issues as long as solutions ;-)

First the issue: I found that when i was going to the details of an order the Rewards point shown were always 0, but if you go on the invoice module the Rewards point magically appeared. Simply in the order details the point were not shown.

it seems that the problem could be with this line in /admin/order.php around line 666

<td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" . ``` > > If replaced with: > ```php <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" . ``` > > all seems fine. Someone else got this error? > > Zencart 1.51 > Reward Point 2.1b

The only problem is this module doesn't show any points when using edit orders. Admin/customer/orders/edit. It has been like this ever since Andrew left the scene. Points show everywhere else, invoice, details.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

18 Nov 2013, 10:37 PM
#2333
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Agree, i just find that solution but i'm yet testing it. If someone would like to try itand post a feedback i'll appreciate. :-)

18 Nov 2013, 11:10 PM
#2334
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Reward Points Module for ZC v13x

countrycharm:

The only problem is this module doesn't show any points when using edit orders. Admin/customer/orders/edit. It has been like this ever since Andrew left the scene. Points show everywhere else, invoice, details.
Order Total Modules were designed to show prices added or subtracted from an order... While the changes mentioned earlier "may" work... They may also break pricing calculation for stores accepting more than one currency... The stock Zen Cart "/admin/order.php" uses the database entry for "value" (with any currency conversion and formatting) instead of "text".

Instead of removing the currency calculations from EVERY order total module, one should probably add a modification to "/admin/order.php" specifically targeting the "Reward Points display" order total module (and using "text" when this module is encountered)... If going this route, one would also need to add an exemption to cause "Edit Orders" to NOT load the "Reward Points display" module (so it does not edit this line)... Or add "special" handling to address the non-standard use of the "value" and "text" but the "Reward Points display" order total module.

The alternative is to stop using (and remove) the "Reward Points Display" order total module and add the reward points earned information directly to the various templates / pages involved. This avoids the issues caused by using the "orders_total" database table in a way not expected by the Zen Cart core code.

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

19 Nov 2013, 3:36 AM
#2335
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

izar74:

Agree, i just find that solution but i'm yet testing it. If someone would like to try itand post a feedback i'll appreciate. :-)

lhungil is right. They may also break pricing calculation for stores accepting more than one currency

I don't use more than one currency so it wouldn't affect me but it might somebody else.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

19 Nov 2013, 3:47 AM
#2336
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

lhungil:

Order Total Modules were designed to show prices added or subtracted from an order... While the changes mentioned earlier "may" work... They may also break pricing calculation for stores accepting more than one currency... The stock Zen Cart "/admin/order.php" uses the database entry for "value" (with any currency conversion and formatting) instead of "text".

Instead of removing the currency calculations from EVERY order total module, one should probably add a modification to "/admin/order.php" specifically targeting the "Reward Points display" order total module (and using "text" when this module is encountered)... If going this route, one would also need to add an exemption to cause "Edit Orders" to NOT load the "Reward Points display" module (so it does not edit this line)... Or add "special" handling to address the non-standard use of the "value" and "text" but the "Reward Points display" order total module.

The alternative is to stop using (and remove) the "Reward Points Display" order total module and add the reward points earned information directly to the various templates / pages involved. This avoids the issues caused by using the "orders_total" database table in a way not expected by the Zen Cart core code.

lhungil feel free to take a stab at this if you would. I feel like that would be and excellent idea in what should to be done in handling this problem.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

19 Nov 2013, 9:11 AM
#2337
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

countrycharm:

lhungil is right. They may also break pricing calculation for stores accepting more than one currency

I don't use more than one currency so it wouldn't affect me but it might somebody else.

lhungil is right, the only thing is that the line i modified is not touched in the Edit Orders module. Actually i've tryed a few order switching currencies and it seem no problem arise.. still testing.

19 Nov 2013, 11:56 AM
#2338
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

izar74:

lhungil is right, the only thing is that the line i modified is not touched in the Edit Orders module. Actually i've tryed a few order switching currencies and it seem no problem arise.. still testing.

I did some testing too and found no problems switching currency but this needs more testing to see if it will break pricing calculation, if not one solution solved.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

19 Nov 2013, 5:11 PM
#2339
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Reward Points Module for ZC v13x

countrycharm:

I did some testing too and found no problems switching currency but this needs more testing to see if it will break pricing calculation, if not one solution solved.
Alright, dug into this the subject a little deeper today. Looks like Zen Cart 1.5.x out of box does not allow one to view orders in the admin with a currency other than the store default... I remember a discussion of this somewhere on the forums in the past, but do not remember what was decided...

So your change should not make a difference for the majority of users of Zen Cart 1.5.x (only those who may have for some reason wanted to see localized pricing for a different country in the admin and made changes)... I still believe it would be even better to at least add some conditional code to check which "order total" module (in "/admin/orders.php") is being displayed and ONLY skip the format function on the "Reward Points display" order total module... Or replace the "Reward Points display" order total module completely.

countrycharm:

lhungil feel free to take a stab at this if you would. I feel like that would be and excellent idea in what should to be done in handling this problem.
I currently have many other ongoing projects, so will not be able to spend any time on this project. Just was browsing this thread (have poked in here from time to time since it crossed my path) and decided to share some thoughts.

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

19 Nov 2013, 5:55 PM
#2340
prettyeyes1 avatar

prettyeyes1

New Zenner

Join Date:
Mar 2010
Posts:
19
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

I just installed this awesome plugin last night and it is working great except for one thing. I have changed it so that customers are going to get 5 points for each $1 spent. So under Catalog>Reward Points I have set the Global Rewards Point Settings to 5.0000. The problem is that customers are only getting 5 points per order. For example, one customer has spent $3 and only received 5 points. It should have been 15 points. When you are shopping though it shows in the sidebox how many points you have in your cart and it adds up all the points you have in your cart. If you have $3 in your cart is shows 15 points. I hope I'm explaining this right and you all understand me. I'm sure it's just a setting that I need to change but I just don't know which setting. Any help would be greatly appreciated.