Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Displaying order subtotal Rate Topic   - - - - -

 
  • ogia
  • Senior Member
  • Members
  • Join Date: 09-Aug 09
  • 503 posts

Posted 30 January 2011 - 08:56 PM #1

I am using the $order_info.subtotal variable to display the total in the subject line of order emails. This works fine except when the subtotal ends in a 0. For instance...

$7.90 becomes $7.9
$5.00 becomes $5

Does anyone know what I need to do to get this to go out 2 decimal places when there is a zero?
CS-Cart 2.1.3 | Selling downloads
I recommend Newsletter Integration with Mailchimp

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 31 January 2011 - 02:16 AM #2

Example:
Your order {$order_info.order_id} in the amount of ${$order_info.subtotal|fn_format_price}

Should do the trick. Sends the value of order_info.subtotal as the first arguement to fn_format_price() which should force it to 2 decimal places.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • ogia
  • Senior Member
  • Members
  • Join Date: 09-Aug 09
  • 503 posts

Posted 31 January 2011 - 03:18 PM #3

I changed the code as suggested but it's still dropping the zeros. ????
CS-Cart 2.1.3 | Selling downloads
I recommend Newsletter Integration with Mailchimp

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 01 February 2011 - 01:53 AM #4

Hmm.... It should return NN.nn.. You did clear your cache, right?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • ogia
  • Senior Member
  • Members
  • Join Date: 09-Aug 09
  • 503 posts

Posted 01 February 2011 - 02:26 AM #5

I'm pretty sure I have more than once, but I just did so we'll see what happens.
CS-Cart 2.1.3 | Selling downloads
I recommend Newsletter Integration with Mailchimp

 
  • ogia
  • Senior Member
  • Members
  • Join Date: 09-Aug 09
  • 503 posts

Posted 01 February 2011 - 03:44 AM #6

I've gotten two more since... $0 and $11.8 instead of $0.00 and $11.80

This is what I have in order_notification_subj.tpl

{$lang.order} #{$order_info.order_id} (${$order_info.subtotal|fn_format_price})
CS-Cart 2.1.3 | Selling downloads
I recommend Newsletter Integration with Mailchimp

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 01 February 2011 - 05:32 AM #7

That should work.... Sorry, that's all I know.
You could stick a very small font line at the bottom to make sure you're messing with the right template.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • ogia
  • Senior Member
  • Members
  • Join Date: 09-Aug 09
  • 503 posts

Posted 01 February 2011 - 05:53 AM #8

Yeah, it's the correct template. I changed the subject lines a couple of days ago and added the subtotal so I could better keep track of sales. However, my concern is that since it goes to customers too it looks unprofessional.
CS-Cart 2.1.3 | Selling downloads
I recommend Newsletter Integration with Mailchimp

 
  • cscartrocks
  • Member
  • Members
  • Join Date: 24-Jan 11
  • 1850 posts

Posted 01 February 2011 - 06:08 AM #9

Yeah, it's the correct template. I changed the subject lines a couple of days ago and added the subtotal so I could better keep track of sales. However, my concern is that since it goes to customers too it looks unprofessional.


You can try this:
{include file="common_templates/price.tpl" value=$$order_info.subtotal}

One Step Checkout Addon - The ultimate checkout experience
Best CS-Cart SEO addon - CS-Cart SEO Ultimate Addon
PM for 365-day support and custom development service


 
  • ogia
  • Senior Member
  • Members
  • Join Date: 09-Aug 09
  • 503 posts

Posted 01 February 2011 - 06:26 AM #10

You can try this:

{include file="common_templates/price.tpl" value=$$order_info.subtotal}


IT WORKS!! :D

Thanks for all the help!
CS-Cart 2.1.3 | Selling downloads
I recommend Newsletter Integration with Mailchimp

 
  • cscartrocks
  • Member
  • Members
  • Join Date: 24-Jan 11
  • 1850 posts

Posted 01 February 2011 - 06:34 AM #11

IT WORKS!! :D

Thanks for all the help!

You're welcome. :)

One Step Checkout Addon - The ultimate checkout experience
Best CS-Cart SEO addon - CS-Cart SEO Ultimate Addon
PM for 365-day support and custom development service


 
  • ogia
  • Senior Member
  • Members
  • Join Date: 09-Aug 09
  • 503 posts

Posted 01 February 2011 - 07:12 PM #12

I spoke too soon... I had tested it on a free order and got $0.00. It turns out it is now showing $0.00 for EVERY order!

I guess I'll go back to no total. Having that in the order notification subject line was something I had in my other carts and I missed it.
CS-Cart 2.1.3 | Selling downloads
I recommend Newsletter Integration with Mailchimp

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 01 February 2011 - 08:47 PM #13

That would imply that there is no $order_info.subtotal value in the view's template variables. Suggest you add a {debug} and see what is actually being passed in.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • denny
  • Newbie
  • Trial users
  • Join Date: 09-Apr 13
  • 5 posts

Posted 20 September 2022 - 08:17 AM #14

In order summary products shows dual currency but total, shipping and other things under the "table" does not show dual currency. Any Idea?