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

CHANGING % SAVED TO $ AMOUNT

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-05-2004, 05:28 PM
  daddyroy's Avatar 
daddyroy daddyroy is offline
 

Member
  
Join Date: Apr 2004
Location: Tallahassee, FL
Posts: 19
 

Default CHANGING % SAVED TO $ AMOUNT

I wanted the discounts to show as amount in $'s saved and not percent so I modified the "skin1/customer/main/product.tpl":

#ORIGINAL#

Code:
{math equation="100-(price/lprice)*100" price=$product.price lprice=$product.list_price format="%d" assign=discount} { $discount }%



#MODIFIED#

Code:
{math equation="lprice-price" price=$product.price lprice=$product.list_price format="%d" assign=discount} ${ $discount }

Now it shows "Save $15" as opposed to "Save 60%". Thats it!! Hope this helps someone.
Reply With Quote
  #2  
Old 05-20-2004, 11:30 PM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default

Very Cool!

Just to add, although it may be obvious!
For UK users, change the code from:

Code:
{math equation="lprice-price" price=$product.price lprice=$product.list_price format="%d" assign=discount} ${ $discount }

To this:

Code:
{math equation="lprice-price" price=$product.price lprice=$product.list_price format="%d" assign=discount} бё{ $discount }

Big respect for the mod, all the best!

__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote
  #3  
Old 06-07-2004, 07:31 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

Great mod!

One question though, what would you do to change the code so that it also includes cents. Right now it only shows the discount in whole dollars which isn't very attracting to the customer in a situation like this:

Retail: 13.99
Our Price: 10.65

You save $4!

Thanks
Reply With Quote
  #4  
Old 06-08-2004, 12:13 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

change

Code:
format="%d"

to

Code:
format="%.2f"

Reply With Quote
  #5  
Old 06-18-2004, 12:28 PM
 
Ryano Ryano is offline
 

Senior Member
  
Join Date: Jun 2004
Posts: 192
 

Default

Thanks for the mod. This changed it under the detailed area...is there a way to change it under the featured description as well and also the product description? thanks again
__________________
xcart v3.5.8 (Unix)
and
xcart v4.0.13
Reply With Quote
  #6  
Old 07-08-2004, 12:27 PM
  Jon's Avatar 
Jon Jon is offline
 

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

Default

For dynamic currency use:

Code:
{math equation="lprice-price" price=$product.price lprice=$product.list_price format="%d" assign=discount} {include file="currency.tpl" value=$discount}

Thanks
Reply With Quote
  #7  
Old 08-27-2004, 01:19 PM
 
AnimeJeff AnimeJeff is offline
 

Advanced Member
  
Join Date: Jun 2004
Posts: 30
 

Default

Do you know how to do this in 4.0?

Thanks
__________________
X-cart x-cart-4.0.0pro
MySQL 3.23.58
Linux 2.4.22-1.2188.nptl Fedora Core 1
Apache 2.0.48
Reply With Quote
  #8  
Old 08-27-2004, 02:26 PM
 
TonyD TonyD is offline
 

eXpert
  
Join Date: Mar 2004
Location: Okc
Posts: 288
 

Default

the same code works with 4.02.....
__________________
X-Cart v 4.7.8(live)
Reply With Quote
  #9  
Old 09-01-2004, 01:05 PM
 
AnimeJeff AnimeJeff is offline
 

Advanced Member
  
Join Date: Jun 2004
Posts: 30
 

Default

this works great... but how do you make this new amount show on the featured products part of the home page? can't seem to figure it out.

thanks

rich
__________________
X-cart x-cart-4.0.0pro
MySQL 3.23.58
Linux 2.4.22-1.2188.nptl Fedora Core 1
Apache 2.0.48
Reply With Quote
  #10  
Old 09-03-2004, 06:58 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

You'll need to modify customer/main/products.tpl for it to appear in the featured products section. Or customer/main/products_t.tpl if you use multi-column format.
__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:19 PM.

   

 
X-Cart forums © 2001-2020