• Hi there,

    I’m getting an error on my checkout page that is causing orders to fail.

    Notice: Undefined offset: 0 in /www/wp-content/plugins/wc-fields-factory/includes/wcff-checkout-fields.php on line 178

    Notice: Trying to get property ‘ID’ of non-object in /www/wp-content/plugins/wc-fields-factory/includes/wcff-checkout-fields.php on line 178

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Saravana Kumar K

    (@mycholan)

    Hi, thankls for posting this, it is an issue.

    Here is a quick fix.

    /www/wp-content/plugins/wc-fields-factory/includes/wcff-checkout-fields.php on line 177

    replace the following function

    private function get_fields_meta( $_type ){
        $res = get_post_meta( get_posts( array( 'post_type' => 'wcccf', 'name' => $_type ) )[0]->ID );
        $return = !empty( $res ) && is_array( $res ) ? $res : array();
        return $return;
    }

    with the below snippet

    private function get_fields_meta( $_type ) {            
        $posts = get_posts(array('post_type' => 'wcccf', 'name' => $_type));
        if ($posts && is_array($posts) && count($posts) > 0) {
            $res = get_post_meta($posts[0]->ID);
            return (!empty($res) && is_array($res)) ? $res : array();
        }            
        return array();
    }

    The fix will be available with our upcoming release

Viewing 1 replies (of 1 total)
  • The topic ‘Errors on checkout page’ is closed to new replies.