Advertisement:

Author Topic: Price & Currency when posting new ad  (Read 1313 times)

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Price & Currency when posting new ad
« on: September 19, 2015, 02:32:23 am »
Hi,

We have in default Bender theme the option to select a locale for price ie. dollar, euro etc. They all have their own locale decimals thousands seperator and some have the same. Anyway, these are available for use BUT when posting a new ad the current core code only looks at the current locale which is not making sens if someone has the option to post a price in another valuta.

According to my logic Osclass needs helper functions that accomodate this option of chosing a valuta when posting a new ad. At this moment the Item.form.php is taking care of the price using this code:
Code: [Select]
        static public function price_input_text($item = null)
        {
            if($item==null) { $item = osc_item(); };
            if( Session::newInstance()->_getForm('price') != "" ) {
                $item['i_price'] = Session::newInstance()->_getForm('price');
            }
            parent::generic_input_text('price', (isset($item['i_price'])) ? osc_prepare_price($item['i_price']) : null);
        }

The function "osc_prepare_price" takes care of the locale using the function:
Code: [Select]
function osc_prepare_price($price) {
    return number_format($price/1000000, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep());
}

The functions used in this function are all focused on the function "osc_current_user_locale()" meaning price format occurs always in user's current locale while website visitors are offered to post a new ad using an other locale/valuta but the price format stays the same.

We need helper functions that use price formatting based on chosen valuta, NOT the current user locale!
Hope I'm making sense, let's hear your comments on this matter please.


Regards,
Eric

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: Price & Currency when posting new ad
« Reply #1 on: September 19, 2015, 05:23:13 am »
Hi,
i don't think that a function will be enough, the currency thousands separator, decimal point etc., are in language settings and not currency settings.
By the way, i think is ok as it is, i mean, the thousands separator, decimal point etc., are more based on language

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Price & Currency when posting new ad
« Reply #2 on: September 19, 2015, 05:20:12 pm »
Hi cartagena68,

you are right, the currency settings, they contain the decimal and thousands seperator so I would like to see these taken into account when a new ad is posted looking at the chosen valuta for the price ie. dollar/euro/danish krone/etc. instead of always the current user one which is simply wrong if you ask me :)

Hi,
i don't think that a function will be enough, the currency thousands separator, decimal point etc., are in language settings and not currency settings.
By the way, i think is ok as it is, i mean, the thousands separator, decimal point etc., are more based on language