![]() |
Show $$ value for BCSE's Reward Points Mod
To display the $$ value anywhere, make sure that you have installed the reward points mod to display the points in the location of which you want to show the dollar value. Then:
Open auth.php and before ?> put: Code:
// WCM - Pass the points payment rate to the template for $$ display In your template file: Code:
{math x=$points.total y=$wcmPaymentRate equation="x / y" format="%.2f" assign="wcmPointsDollars"} Voila. |
Re: Show $$ value for BCSE's Reward Points Mod
nice :)
|
Re: Show $$ value for BCSE's Reward Points Mod
You Champion
Ok, so here is the modified code a side bar menu item reward_points.tpl for the Customer rewards mod to show Line 1 - link to Points System Explanation ( your static page ) Line 2 - Link to Customer Referral programme ( the crp_referral.php ) Line 3 - if logged in show current points balance Line 4 - if logged in show current points equivilent $ Value {capture name=menu} <table border="0" cellpadding="3" cellspacing="0" width="100%"> <tr><td>Earn Points</td><td><a href="/store/pages.php?pageid=30" title="Coffee Shrine's Customer Reward Points Programme">{include file="buttons/search_head.tpl"}</a> </td></tr> <tr><td colspan="2"><hr class="VertMenuHr" size="1"/></td></tr> <tr><td>Refer a Friend</td><td><a href="/store/crp_referral.php" title="Refer a Friend and receive Bonus Points">{include file="buttons/search_head.tpl"}</a></td></tr> {if $login eq "" } <tr><td colspan="2"><hr class="VertMenuHr" size="1"/></td></tr> <tr><td colspan="2>">(User must be logged in)</td></tr> {else} {* Points Added*} <tr><td colspan="2"><hr class="VertMenuHr" size="1"/></td></tr> <tr> <td>Points Balance:</td> <td><b>{$points.total}</b></td> </tr> <tr> <td>Points Value:</td> <td>{math x=$points.total y=$wcmPaymentRate equation="x / y" format="%.2f" assign="wcmPointsDollars"} {include file="currency.tpl" value=$wcmPointsDollars}</td> </tr> {/if} {* End Points added*}</table> {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_reward_points menu_content=$smarty.capture.menu } Enjoy - comments welcome |
Re: Show $$ value for BCSE's Reward Points Mod
Hi there-
Great mod, however I notice a bug on my end. Everything seems to be working great when a user is logged in, but when a user registers from the first time on the register page the "point value" script give me this error... Points Value:FPRIVATE "TYPE=PICT;ALT=" Warning: Smarty error: math ``x / y'' in ``modules/Special_Offers/customer/new_offers_short_list.tpl'': parameter ``x'' is empty in /home/professi/public_html/upgrade/Smarty-2.6.19/Smarty.class.php on line 1092 $ It seems the error comes from the Special Offers module, but is present where the points value mod is. anybody have any ideas? |
Re: Show $$ value for BCSE's Reward Points Mod
Hmmm, I do not get the same error but I also do not use the special offers module...
It may be a version thing. Way out of my leauge - I am just an agregator of other peoples code... |
Re: Show $$ value for BCSE's Reward Points Mod
Quote:
Maybe try an if else statement. if points =0 then 0 otherwise use the formula... |
Re: Show $$ value for BCSE's Reward Points Mod
Try this - it includes an if else statement that doesnt seem to break anything
{capture name=menu} <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td colspan="2"><a href="/reward-points.html" title="Coffee Shrine's Customer Reward Points Programme"><b> Earn Points</b></a></td></tr> <tr><td colspan="2"><hr class="VertMenuHr" size="1"/></td></tr> <tr><td colspan="2"><a href="/crp_referral.php" title="Refer a Friend and receive Bonus Points"><b> Refer a Friend</b></a></td></tr> {if $login eq "" } <tr><td colspan="2"><hr class="VertMenuHr" size="1"/></td></tr> <tr><td colspan="2>">(User must be logged in)</td></tr> {else} {* Points Added*} <tr><td colspan="2"><hr class="VertMenuHr" size="1"/></td></tr> <tr> <td>Points Balance:</td> <td><b>{$points.total}</b></td> </tr> <tr> <td>Points Value:</td> <td>{if $points.total ne ""}{math x=$points.total y=$wcmPaymentRate equation="x / y" format="%.2f" assign="wcmPointsDollars"} {include file="currency.tpl" value=$wcmPointsDollars}{else}0{/if}</td> </tr> {/if} {* End Points added*}</table> {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_reward_points menu_content=$smarty.capture.menu } regards |
Re: Show $$ value for BCSE's Reward Points Mod
Paul-
That seems to work. Thanks for your help. |
Re: Show $$ value for BCSE's Reward Points Mod
Has anyone figured out a way to get a customer's point count to show on a static page?
|
Re: Show $$ value for BCSE's Reward Points Mod
I have a hunch that {$points.total} has become {$points} in vers 2 of this mod.
Confirmed by Carrie. Vers 2 is slightly different, and uses {$points} instead of {$points.total} |
All times are GMT -8. The time now is 03:22 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.