• Hi! I have a problem. The value of my field is output in the wrong formats. I use the following code to display the field:

    [post_select material value-field-meta-key:price posts-number:-1 id:material class:material publish include_blank search_box post-type:material tax-relation:OR value-field:meta orderby:title order:ASC "%title% - %price%"]

    As a result, I get the name and price, but hundredths are added to the price, which I don’t need. In addition, some values are output as a date
    Example:
    F40-70 – 19.07.2023
    F5-20 – 19.07.2800
    F70-120 – 850,00
    however, the following values should be displayed:
    F40-70 – 1850
    F5-20 – 2800
    F70-120 – 850

    To create a custom post type, I use the pods framework. Usually there are no problems

    • This topic was modified 1 year, 4 months ago by ellengardt.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ellengardt

    (@ellengardt)

    At the moment I have solved the problem by commenting out part of the plugin code in /module.php Commented out lines 280 – 284.:

         // Check if the meta value is a valid date
     //               if(strtotime(str_replace('/', '-', $post_meta_value)) !== false)
    //                {
    //                    $meta_values[] = date_i18n(get_option('date_format'), strtotime(str_replace('/', '-', $post_meta_value)));
    //                }
                    // Check if is an array


    Removed “else” in line 286: It was: else if (is_array($post_meta_value)) became:

    if(is_array($post_meta_value))

    I also commented on lines 290-296

    //                else if(is_numeric($post_meta_value))
    //                {
    //                    $decimals = strlen($post_meta_value) - strrpos($post_meta_value, '.') - 1;
    //
    //                    // Pypass correct number of decimals
    //                    $meta_values[] = number_format_i18n( $post_meta_value, $decimals );
    //                }
    Plugin Author Markus Wiesenhofer

    (@markusfroehlich)

    Hi ellengardt, i will fix this issue in the next version.

    Best regards
    Markus

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Showing custom field value issue’ is closed to new replies.