• Resolved Wayne

    (@waynep16)


    I have my woo currency set to Bitcoin and then to 5 decimal places. (in the default woo settings planel)

    But when I save your fields Minimum Price (?) and Recommended Price (?) to something like 0.001 and press save on the woo product, your plugin always saves the prices as 0 and doesn’t use the decimal places chosen in woocomerce settings.

    This needs to be fixed asap !

Viewing 1 replies (of 1 total)
  • FahimMurshed

    (@fahimmurshed)

    Hello,
    Here is the solution:
    Campaign Backend: /wp-content/plugins/wp-crowdfunding/includes/woocommerce/class-wpneo-crowdfunding.php
    Line#452-465

    
                // _nf_funding_goal
                $_nf_funding_goal = intval( sanitize_text_field($_POST['_nf_funding_goal']) );
                wpneo_crowdfunding_update_post_meta_text($post_id, '_nf_funding_goal', $_nf_funding_goal);
    
                // wpneo_funding_minimum_price
                $wpneo_funding_minimum_price = intval( sanitize_text_field($_POST['wpneo_funding_minimum_price']) );
                wpneo_crowdfunding_update_post_meta_text($post_id, 'wpneo_funding_minimum_price', $wpneo_funding_minimum_price);
    
                // wpneo_funding_maximum_price
                $wpneo_funding_maximum_price = intval( sanitize_text_field($_POST['wpneo_funding_maximum_price']) );
                wpneo_crowdfunding_update_post_meta_text($post_id, 'wpneo_funding_maximum_price', $wpneo_funding_maximum_price);
    
                // wpneo_funding_recommended_price
                $wpneo_funding_recommended_price = intval( sanitize_text_field($_POST['wpneo_funding_recommended_price']) );
                wpneo_crowdfunding_update_post_meta_text($post_id, 'wpneo_funding_recommended_price', $wpneo_funding_recommended_price);
    

    to

    
                // _nf_funding_goal
                $_nf_funding_goal =  sanitize_text_field($_POST['_nf_funding_goal']) ;
                wpneo_crowdfunding_update_post_meta_text($post_id, '_nf_funding_goal', $_nf_funding_goal);
    
                // wpneo_funding_minimum_price
                $wpneo_funding_minimum_price =  sanitize_text_field($_POST['wpneo_funding_minimum_price']) ;
                wpneo_crowdfunding_update_post_meta_text($post_id, 'wpneo_funding_minimum_price', $wpneo_funding_minimum_price);
    
                // wpneo_funding_maximum_price
                $wpneo_funding_maximum_price =  sanitize_text_field($_POST['wpneo_funding_maximum_price']) ;
                wpneo_crowdfunding_update_post_meta_text($post_id, 'wpneo_funding_maximum_price', $wpneo_funding_maximum_price);
    
                // wpneo_funding_recommended_price
                $wpneo_funding_recommended_price =  sanitize_text_field($_POST['wpneo_funding_recommended_price']) ;
                wpneo_crowdfunding_update_post_meta_text($post_id, 'wpneo_funding_recommended_price', $wpneo_funding_recommended_price);
    

    Fronpage/Campaign Submission Form

    Replace this code on the /wp-content/plugins/wp-crowdfunding/includes/woocommerce/class-wpneo-frontend-campaign-submit-form.php
    Line# 79-83

    
                if( $_POST['wpneo-form-min-price'] ){           $min_price = intval(sanitize_text_field($_POST['wpneo-form-min-price'])); }
                if( $_POST['wpneo-form-max-price'] ){           $max_price = intval(sanitize_text_field($_POST['wpneo-form-max-price'])); }
                if( $_POST['wpneo-form-recommended-price'] ){   $recommended_price = intval(sanitize_text_field($_POST['wpneo-form-recommended-price'])); }
                if( $_POST['wpneo-form-funding-goal'] ){        $funding_goal = intval(sanitize_text_field($_POST['wpneo-form-funding-goal'])); }
    

    to

    
    if( $_POST['wpneo-form-min-price'] ){           $min_price = sanitize_text_field($_POST['wpneo-form-min-price']); }
                if( $_POST['wpneo-form-max-price'] ){           $max_price = sanitize_text_field($_POST['wpneo-form-max-price']); }
                if( $_POST['wpneo-form-recommended-price'] ){   $recommended_price = sanitize_text_field($_POST['wpneo-form-recommended-price']); }
                if( $_POST['wpneo-form-funding-goal'] ){        $funding_goal = sanitize_text_field($_POST['wpneo-form-funding-goal']); }
    

    Screenshot: https://i.imgur.com/IwqsBpM.png
    WP CF

    Let me know if you have any other questions.

Viewing 1 replies (of 1 total)
  • The topic ‘5 decimal places doesn’t save’ is closed to new replies.