douglaswalker Posted August 8, 2017 Share Posted August 8, 2017 Hi there Interesting issue I use the symbol right in currencies to show the currency $0.00 AUD. If you dont place before the AUD when it is inputted into the box in Admin you get this $0.00AUD However if you do use then it shows up in admin on the PayPal balance with the new APP... no where else though.. emails work fine etc. The other question is this The AUD is the same text size as the price I would like it to be <small></small> How could i go about this without breaking anything. Doug Link to comment Share on other sites More sharing options...
♥raiwa Posted August 8, 2017 Share Posted August 8, 2017 Hello Doug @douglaswalker, You can do this in the currencies class within the format function. Use a normal space and it will show well on all places. rgds Rainer About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
douglaswalker Posted August 8, 2017 Author Share Posted August 8, 2017 if ($calculate_currency_value == true) { $rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value']; $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' <small>'. $this->currencies[$currency_type]['symbol_right'].'</small>'; } else { $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) .' <small>'. $this->currencies[$currency_type]['symbol_right'].'</small>'; } return $format_string; } So like the above? I added .' <small>'. and .'</small>' at the end. It works on the site i was just concerned it may case issues somewhere I don't know about. i don't want to pass the space and <small> to any payment gateways. Link to comment Share on other sites More sharing options...
♥raiwa Posted August 8, 2017 Share Posted August 8, 2017 Yes, this does work, I use it also on a live shop. The payment modules do not use the formatted output to pass to gateways. The formatted output is only used for display purposes. About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
douglaswalker Posted August 8, 2017 Author Share Posted August 8, 2017 Thank You and what about emails any issues? Link to comment Share on other sites More sharing options...
♥raiwa Posted August 8, 2017 Share Posted August 8, 2017 Should work too, html tags are stripped off for non html mails, just try. About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
douglaswalker Posted August 8, 2017 Author Share Posted August 8, 2017 ty Link to comment Share on other sites More sharing options...
MrPhil Posted August 8, 2017 Share Posted August 8, 2017 Be careful about replacing with a regular space. If your price is near the end of a line, the browser might try to word wrap and end up splitting the price between the number and the "AUD". The whole point of a is to always keep all the text together. Regarding non-HTML emails and payment gateways, someone will need to experiment (and read the docs) to see if additional processing is needed to remove or change entities (like ) and strip HTML tags (like <small>) before sending it off. A payment gateway might be expecting a very specific format for currencies. Link to comment Share on other sites More sharing options...
♥raiwa Posted August 8, 2017 Share Posted August 8, 2017 @MrPhil, for , ok as he already uses another html tag, he can also use it here, it doesn't matter then. I just thought if it's the only mod then it will be sure, using normal space will avoid to appear any undesired html tag anywhere. It's unlike that just the currency symbol will break into a new line. For the payment gateways: I did a fast search through the actual core payment modules and any of them uses neither the format nor the display_price function. They all use the display_raw or format_raw functions to pass prices to the gateway. The display_price function is only used to create the e-mail order confirmation. However as we can not exclude that an older or third party payment module may use them, as always, before to apply a sensitive mod like this, it should be tested. About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
MrPhil Posted August 9, 2017 Share Posted August 9, 2017 HTML entities and HTML tags (elements) are two different things. The mechanisms for stripping them out or removing them are different, and both may or may not be implemented in osC code. So just use caution if you have anything other than plain text, and test to make sure your non-plain-text is properly handled. Link to comment Share on other sites More sharing options...
♥raiwa Posted August 9, 2017 Share Posted August 9, 2017 @MrPhil, yep, you are right. I mixed up something. In the "tep_mail function", "strip_tags" is used for plain text mails, so the html entities will not be converted. A reason to use normal space instead of . I know that I remembered something that it can produce problems using html entities. rgds Rainer About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
douglaswalker Posted August 12, 2017 Author Share Posted August 12, 2017 Hi there had a few interesting issues with this using space<small>AUD</small> does cause the line to break sometimes so you get AUD below the price. i just went with <small>AUD</small> no space... which to me looks fine with no space and the smaller AUD. i had no issue with email either HTML or Plain. The only issue i had was where something had been coded incorrectly and the display method had been used but that was not stock Oscommerce. There was also an issue in account_history with the price squashed up in a <td> that was to small for it with the AUD added but i expect that is a bug that must effect all shops that show AUD or similar. So all in all it works. Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted August 12, 2017 Share Posted August 12, 2017 What about currency symbol left: <span style="white-space: no-wrap;"> and symbol right: <small style="padding-left: 5px;">AUD</small></span> , osCommerce Link to comment Share on other sites More sharing options...
douglaswalker Posted August 12, 2017 Author Share Posted August 12, 2017 I will try this.. thanks @Harald Ponce de Leon Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted August 12, 2017 Share Posted August 12, 2017 That should work with html, however when the html is is stripped (eg, in emails), the spacing will be removed and the price will display as 12.34AUD instead of 12.34 AUD. , osCommerce Link to comment Share on other sites More sharing options...
douglaswalker Posted August 12, 2017 Author Share Posted August 12, 2017 awesome Link to comment Share on other sites More sharing options...
douglaswalker Posted August 12, 2017 Author Share Posted August 12, 2017 i get a white-space: no-wrap; is an invalid property when i look in developer tools It does however all work fine. Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted August 12, 2017 Share Posted August 12, 2017 Ah sorry, it should be white-space: nowrap , osCommerce Link to comment Share on other sites More sharing options...
douglaswalker Posted August 12, 2017 Author Share Posted August 12, 2017 if ($calculate_currency_value == true) { $rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value']; $format_string = $this->currencies[$currency_type]['symbol_left'] .'<span style="white-space: nowrap;">'. number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) .'<small style="padding-left: 5px;">'. $this->currencies[$currency_type]['symbol_right'].'</small>'; } else { $format_string = $this->currencies[$currency_type]['symbol_left'] .'<span style="white-space: nowrap;">'. number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) .'<small style="padding-left: 5px;">'. $this->currencies[$currency_type]['symbol_right'].'</small>'; } return $format_string; } So for anyone reading this. This is what I have perfect thank-you Link to comment Share on other sites More sharing options...
♥raiwa Posted September 2, 2017 Share Posted September 2, 2017 The following works for me nice for symbol left and symbol right currencies and maintaining the original size: $format_string = '<span style="padding-right: 5px;">' . $this->currencies[$currency_type]['symbol_left'] . '</span>' . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . '<span style="padding-left: 5px;">' . $this->currencies[$currency_type]['symbol_right'] . '<span>'; } else { $format_string = '<span style="padding-right: 5px;">' . $this->currencies[$currency_type]['symbol_left'] . '</span>' . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . '<span style="padding-left: 5px;">' . $this->currencies[$currency_type]['symbol_right'] . '<span>'; About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.