Home Forums WC Vendors Pro Support Adding a Custom Field for Products – Fields in Back End Part Deux

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37520
    Daniel
    Participant

    Ok, so now that we have custom fields appearing in the back end / product editor, on closer inspection we’re seeing another issue… some of our custom fields are storing arrays of information. Namely, we’ve got a few fields using the select2 input type, which are using the multiple custom attribute:

    'custom_attributes' => array( 'multiple' => 'multiple' )

    These fields are still not appearing in the back end editor; additionally, when we use the recommended code in the functions.php file:

    add_action('woocommerce_product_meta_start', 'wcv_food_type', 2);
    function wcv_food_type() {
        $food_type = get_post_meta( get_the_ID(), 'wcv_custom_product_food_type', true ); // Set the meta key
        echo 'Food Type: ' . $food_type . '<br>';
    }

    The field value appears on the front end Product page simply as the text “Array,” rather than the values of that array which are obviously what we’re hoping to see.

    Any suggestions here? Might this be a place where we’d need to integrate ACF to get additional functionality? We’re trying to avoid that if possible.

    Thanks again!

    #37611
    WC Vendors Support
    Participant

    $food_type = get_post_meta( get_the_ID(), 'wcv_custom_product_food_type', true ); // Set the meta key

    Set that to false, not true. Then, your array will be a real array, and you can call it accordingly! 🙂

    ACF should never be needed with WC Vendors Pro. Some people use it, totally unnecessary though.

    #38039
    Daniel
    Participant

    Ok, thanks.

    We’re experiencing a host of other issues, somewhat related to this, but not entirely, so going to start a new thread.

    Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.