Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Show $$ value for BCSE's Reward Points Mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-22-2008, 12:33 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default 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 $payment_rate = func_query_first_cell("select value from points_config where name='payment_rate'"); $smarty->assign("wcmPaymentRate",$payment_rate);


In your template file:

Code:
{math x=$points.total y=$wcmPaymentRate equation="x / y" format="%.2f" assign="wcmPointsDollars"} {include file="currency.tpl" value=$wcmPointsDollars}

Voila.
Reply With Quote

The following user thanks Jon for this useful post:
Phoenix Tech (09-18-2009)
  #2  
Old 05-22-2008, 05:12 PM
 
Nadeem Nadeem is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 56
 

Default Re: Show $$ value for BCSE's Reward Points Mod

nice
__________________
X-Cart 4.4.5 | Linux/Apache | PHP 5.2.17 | MySQL 5.0.77 | FireFox
Reply With Quote
  #3  
Old 05-22-2008, 06:00 PM
 
paul@dimoda.com.au paul@dimoda.com.au is offline
 

Senior Member
  
Join Date: Aug 2007
Location: Perth, Australia
Posts: 148
 

Default 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
__________________
X-Cart Gold 4.1.10, 4.1.18, 4.4.4, 4.4.5
Reply With Quote
  #4  
Old 06-11-2008, 07:56 PM
 
pcarcare pcarcare is offline
 

eXpert
  
Join Date: Jun 2004
Location: Salt Lake City, Utah
Posts: 230
 

Default 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?
__________________
X-cart gold 4.5.2 (live)
X-payments 1.0.5

http://www.professionalcarcare.com
Your online source for all your car care needs
Reply With Quote
  #5  
Old 06-11-2008, 08:10 PM
 
paul@dimoda.com.au paul@dimoda.com.au is offline
 

Senior Member
  
Join Date: Aug 2007
Location: Perth, Australia
Posts: 148
 

Default 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...
__________________
X-Cart Gold 4.1.10, 4.1.18, 4.4.4, 4.4.5
Reply With Quote
  #6  
Old 06-11-2008, 08:18 PM
 
paul@dimoda.com.au paul@dimoda.com.au is offline
 

Senior Member
  
Join Date: Aug 2007
Location: Perth, Australia
Posts: 148
 

Default Re: Show $$ value for BCSE's Reward Points Mod

Quote:
Originally Posted by pcarcare
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?


Maybe try an if else statement. if points =0 then 0 otherwise use the formula...
__________________
X-Cart Gold 4.1.10, 4.1.18, 4.4.4, 4.4.5
Reply With Quote
  #7  
Old 06-11-2008, 08:23 PM
 
paul@dimoda.com.au paul@dimoda.com.au is offline
 

Senior Member
  
Join Date: Aug 2007
Location: Perth, Australia
Posts: 148
 

Default 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>&nbsp;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>&nbsp;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
__________________
X-Cart Gold 4.1.10, 4.1.18, 4.4.4, 4.4.5
Reply With Quote

The following user thanks paul@dimoda.com.au for this useful post:
Phoenix Tech (09-18-2009)
  #8  
Old 06-13-2008, 03:15 PM
 
pcarcare pcarcare is offline
 

eXpert
  
Join Date: Jun 2004
Location: Salt Lake City, Utah
Posts: 230
 

Default Re: Show $$ value for BCSE's Reward Points Mod

Paul-

That seems to work. Thanks for your help.
__________________
X-cart gold 4.5.2 (live)
X-payments 1.0.5

http://www.professionalcarcare.com
Your online source for all your car care needs
Reply With Quote
  #9  
Old 02-20-2009, 01:04 AM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default 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?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #10  
Old 03-13-2009, 10:37 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default 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}
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote

The following user thanks carpeperdiem for this useful post:
Phoenix Tech (09-18-2009)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:20 AM.

   

 
X-Cart forums © 2001-2020