WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[resolved] Zeros add to price when product is saved (5 posts)

  1. sysamurai
    Member
    Posted 1 year ago #

    Updating any product, I enter a price without decimals. (1000)

    After saving the changes decimals are added in the display (1000.00)

    Saving again adds the decimals to the integer part (100000.00)

    Saving again adds the decimals to the integeer part again (10000000.00)

    I use WP 3.5 with TwentyTwelve and Swedish language pack. In Sweden a comma is used as decimal delimiter (1000,00). Probably hence the problem.

    http://wordpress.org/extend/plugins/wp-e-commerce/

  2. Jan9292
    Member
    Posted 1 year ago #

    I have the same problem!

  3. mpol
    Member
    Posted 1 year ago #

    I think a small bug slipped through. What I did was change one line in wpsc-include/currency.helpers.php
    In the function wpsc_string_to_float() change this line:
    $string = preg_replace( '/[^0-9\\' . $decimal_separator . ']/', '', $string );
    To this line:
    $string = preg_replace( '/[^0-9\\' . $decimal_separator . ']/', '.', $string );
    It should not remove the "," but replace it with a "."

    This seems to work for me.

  4. Justin Sainton
    Member
    Plugin Author

    Posted 1 year ago #

    This seems legitimate, if you wouldn't mind posting this to our GitHub issues repo, that would be helpful.

    https://github.com/wp-e-commerce/WP-e-Commerce/issues/new

  5. mpol
    Member
    Posted 1 year ago #

    Thanks.
    I didn't add a patch, but it might be too simple for that :).

    https://github.com/wp-e-commerce/WP-e-Commerce/issues/363

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.