Home Forums WC Vendors Pro Support Media Upload with Form Helper?

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 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #27812
    cric
    Participant

    Hi
    Short question: is there a media upload form helper function? I try to add a custom field for a ticket logo in the WCEvent Pro Dashboard (frontend). Before I write my own javascript to handle this, I thought I ask, if there already is such a helper available.

    #27813
    cric
    Participant

    note: if I should have posted this in the support forum and not in the feature requests forum, pleas feel free to move it (and tell me).

    #27816
    WC Vendors Support
    Participant

    /public/class-wcvendors-pro-form-helper.php Line #604! Although ours is JavaScript too. 🙂

    #27817
    cric
    Participant

    Thanks ben. So, the general form is:

    WCVendors_Pro_Form_helper::product_media_uploader( $object_id )

    Any insights how I can access the uploaded image after I selected it? Or do I have to “extend” this function to handle “ticket_logo_image”s?

    btw: I love javascript – I just don’t want to reinvent the wheel 😉

    #27818
    WC Vendors Support
    Participant

    That’s a good question! I don’t know the answer. I’ll ask Jamie to hop on and see if he can give you any better advice. 🙂

    If ticket_logo_image is a meta key, you could copy the featured image meta value to that meta key though! And then no reinvent is necessary, featured image = ticket logo image.

    #27819
    cric
    Participant

    Hm, not quiet sure if I understand what you mean. The meta key is actually ‘WooCommerceEventsTicketLogo’ but as I also need the featured image too (a different image), it isn’t possible to just copy the values here.

    #27983
    Jamie
    Keymaster

    Hello,

    Yes we actually do have a file uploader but so do to what you want, just fill in the values in this gist to match what you need.

    https://gist.github.com/digitalchild/86e3b64cbad92dc16e15

    cheers,

    Jamie.

    #27985
    WC Vendors Support
    Participant

    https://gist.github.com/bentasm1/2bc3491d51d2d7c5689a

    Better notes and better meta key example. 🙂

    #27994
    cric
    Participant

    That’s great, thanks. I have a file uploader working by copying the javascript and html from the plugin itself, but the code above looks much better. Maybe I will exchange it.

    #31839
    mihai
    Participant

    The line

    $value = get_user_meta( get_current_user_id(), 'wcv_custom_product_file1', true );

    will take the URL of the uploaded(selected) file?

    #35538
    Tate
    Participant

    How about if I want to upload different media type files such as 3D files which has extensions .stl and .obj ?

    #35547
    WC Vendors Support
    Participant

    You can upload whatever you want, we dont care. Its your site. 🙂

    #35559
    Tate
    Participant

    But file_uploader function only allows image it seems

    The code is in class-wcvendors-pro-form-helper.php. line #683

    #35564
    WC Vendors Support
    Participant

    Did you try it? I dont see any code in there that restricts based on file extension….

    #35577
    Tate
    Participant

    My file type stl and obj and they are not images!

    #35779
    WC Vendors Support
    Participant

    https://codex.wordpress.org/Uploading_Files are the supported types that the media uploader allows. It’s all WordPress, not WC Vendors. You might find this plugin useful: https://wordpress.org/plugins/wp-extra-file-types/

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