WordPress.org

Ready to get started?Download WordPress

Forums

FoxyShop
[resolved] Resetting Sale Price gives error on product update (3 posts)

  1. creativeworldstudio
    Member
    Posted 3 years ago #

    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/

  2. sparkweb
    Member
    Plugin Author

    Posted 3 years ago #

    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!

  3. sparkweb
    Member
    Plugin Author

    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic