Forum Replies Created

Viewing 6 Topics - 1 through 6 (of 6 total)
Author Posts
April 17, 2014 at 7:11 am in reply to: Paid Memberships Pro 18913
David David

*BUMP* Support team, any help you can provide here?

April 16, 2014 at 4:06 am in reply to: Displaying Hidden field in post 18835
David David

Kira, can you post the code you’re using to display the “Array” that should help so that we can provide a bit better help to you!

March 15, 2014 at 5:04 am in reply to: woo_files not updating / showing in back end 16639
David David

acav, That’s right! The value isn’t required so you could set it to null or something else useful to you! Let me know if it works or if I can be of further help.

March 11, 2014 at 10:22 pm in reply to: woo_files not updating / showing in back end 16457
David David

Found the fix!
Essentially the issue is WooCommerce 2.1+ updated the field storing Downloadable Files. My guess is so that more than one file can be supported per product.

1. As Tareq mentioned, the new Meta Field Name is _downlodable_files

2. The storage method is also slightly updated to use a multi-dimensional array. The following code will work, however you will need to update “File Name” to be a field or some valid variable storing the file name for the particular row. Or if you don’t care about it, just leave it null.

function wpufe_woo_file_paths( $post_id ) {
    if (isset( $_POST['wpuf_files']['woo_files'])) {

        $files = $_POST['wpuf_files']['woo_files'];
        $fileName = 'Some File Name';
        $woo_files = array();
 
        foreach ($files as $file_id) {
            $file_url = wp_get_attachment_url( $file_id );
            $woo_files[md5( $file_url )] = array(
				'name' => $fileName,
				'file' => $file_url
			);
        }
        update_post_meta( $post_id, '_downloadable_files', $woo_files );
    }
}
add_action( 'wpuf_add_post_after_insert', 'wpufe_woo_file_paths' );
add_action( 'wpuf_edit_post_after_update', 'wpufe_woo_file_paths' );

And if you’re curious, we’re using WPUF on our soon releasing http://slowroasted.co

March 11, 2014 at 8:55 pm in reply to: woo_files not updating / showing in back end 16448
David David

Tareq, I still think what you have in the docs is incorrect though. Because after inspecting the DB for the array storage, since 2.1 I think the array storing the files is structured different from what you have in the docs? Any insight?

March 11, 2014 at 10:27 am in reply to: woo_files not updating / showing in back end 16408
David David

I’m having the same issue as well… the file uploads and shows under the WPUF Custom Fields but not showing in the Woo Commerce downloadable files field. Any ideas?

Viewing 6 Topics - 1 through 6 (of 6 total)