WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: FoxyShop] Resetting Sale Price gives error on product update

[Resolved] [Plugin: FoxyShop] Resetting Sale Price gives error on product update

  • Hi guys,

    Found a small bug – on WP Admin > Products > Edit Product page. When entering a Sale Price the product updates correctly, however when removing it (or resetting it back to zero) an error is thrown after ‘Update’ is clicked:

    Warning: number_format() expects parameter 1 to be double, string given in /wp-content/plugins/foxyshop/customposttype.php on line 1009
    
    Warning: Cannot modify header information - headers already sent by (output started at /wp-content/plugins/foxyshop/customposttype.php:1009) in /wp-includes/pluggable.php on line 897

    I’ve tried putting 0, 0.0 and leaving the field blank but nothing works. (actually I think the field is wiped if a value equal to 0 is left in it)

    The product does still update with the sale price removed despite the error.

    Using WP 3.1.2 & FoxyShop 2.6.1

    PS- great work on 2.6.1 release 🙂

    Cheers, Leon

    http://wordpress.org/extend/plugins/foxyshop/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author sparkweb

    @sparkweb

    Thanks Leon for the bug report. I think I might know what’s going on here, but for some reason my server isn’t stopping the page execution at this point. Can you try replacing line 1009 of customposttype.php with this:

    foxyshop_save_meta_data('_saleprice',number_format((double)str_replace(",","",$_POST['_saleprice']),2,".",""));

    to see if that solves it? Thank you!

    Plugin Author sparkweb

    @sparkweb

    Leon, I got this figured out and have corrected this in version 2.7.

    2.7 is actually done, but the WordPress plugin repository is down right now. I’ll post 2.7 when it comes up.

    Thanks for the error report!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: FoxyShop] Resetting Sale Price gives error on product update’ is closed to new replies.