Field value not saving

Support General Field value not savingResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #22461
    calpaqcalpaq
    Participant

    Hi Support,
    Can you please help me with my problem using metabox plugin with woocommerce product post type, I followed the article present on the site to create a field. Actually the scenario is I am creating a field with Woocommerce CPT product to add floor plan field so our client want to upload the related floor plant to the property (product) so I have created a following code

    
    function samo_register_meta_boxes( $meta_boxes ) {
        $meta_boxes[] = array(
            "id" => "property-floor-plan",
            "title" => "Floor Plan",
            "context" => "side",
            "post_types" => array("product"),
            "fields" => array(
                array(
                    "type"  => "image_advanced",
                    "force_delete" => true,
                    "max_file_uploads" => 1,
                ),
            )
        );
    
    return $meta_boxes;
    }
    add_filter( "rwmb_meta_boxes", "samo_register_meta_boxes" );
    

    This is showing field in the product editor and let me select the image or upload but after that when I update the product in the refreshed screen to edit the product I do not see that image again, it is not saving it. How can I solve it or am I missing something.

    Thanks & Regards,
    Calpaq

    #22464
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The field ID is required to save the field value, please add the setting id to the field and save it again.

    "fields" => array(
        array(
            "id" => "my_image_advanced"
            "type"  => "image_advanced",
            "force_delete" => true,
            "max_file_uploads" => 1,
        ),
    )
    #22498
    calpaqcalpaq
    Participant

    Hi Long
    Thanks for your help it worked.
    Regards

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.