Home Forums WC Vendors Pro Support Add Another Upload File Option Into Add Product Form

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 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #77322
    Samia
    Participant

    Hi,
    I am trying to add another file upload option for product thumbnail image. For this purpose I am using your given form helper for File Uploader WCVendors_Pro_Form_Helper::file_uploader. But the below code didn’t work for me.
    Our field id is “wcv_custom_product_small_image”.

    <?php
    do_action( ‘wcv_form_file_uploader_before_’. $object_id );
    WCVendors_Pro_Form_Helper::file_uploader( array(
    ‘header_text’ => __(‘Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘add_text’ => __(‘Add Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘remove_text’ => __(‘Remove Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘image_meta_key’ => ‘wcv_custom_product_small_image’,
    ‘save_button’ => __(‘Add Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘window_title’ => __(‘Select an Image’, ‘wcvendors-pro’ ),
    ‘value’ => $value
    ) );
    do_action( ‘wcv_form_file_uploader_after_’. $object_id);
    ?>

    I have also tried this

    <?php
    do_action( ‘wcv_form_file_uploader_before_’. $object_id );
    WCVendors_Pro_Form_Helper::file_uploader( array(
    ‘post_id’ => $object_id,
    ‘id’ => ‘wcv_custom_product_small_image’,
    ‘header_text’ => __(‘Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘add_text’ => __(‘Add Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘remove_text’ => __(‘Remove Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘image_meta_key’ => ‘wcv_custom_product_small_image’,
    ‘save_button’ => __(‘Add Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘window_title’ => __(‘Select an Image’, ‘wcvendors-pro’ ),
    ‘value’ => $value
    ) );
    do_action( ‘wcv_form_file_uploader_after_’. $object_id);
    ?>

    Kindly let me know why this is not working for me?

    #77328
    Samia
    Participant

    Hi,
    When I added the same image from admin panel it’s working fine and also showing on edit product page for vendor but when but when vendor tries to remove or want to add new from front-end then this is not working.
    Here is the updated code:
    <?php
    $thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(‘product’, ‘wcv_custom_product_small_image’, $object_id);
    WCVendors_Pro_Form_Helper::file_uploader( array(
    ‘header_text’ => __(‘Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘add_text’ => __(‘Add Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘remove_text’ => __(‘Remove Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘image_meta_key’ => ‘wcv_custom_product_small_image’,
    ‘save_button’ => __(‘Add Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘window_title’ => __(‘Select Thumbnail Image’, ‘wcvendors-pro’ ),
    ‘value’ => $thumbnail_id
    ) );
    ?>

    This is working only when image added from admin panel and when vendor tries to add or edit using edit product page then file is saving into media liberary but don’t get back and not going to front where we want to show the image.

    #77378
    Samia
    Participant

    Please have a look and pay some attention to my problems.

    #77482
    Anna
    Member

    Hello,
    Upon review I am not certain why your custom code is not working as you had intended.
    Please look for an outside developer to assist with further custom code work for WC Vendors, as we only provide guidelines and our docs site for outlining the available hooks & filters for custom development with WC Vendors and WC Vendors Pro.

    #77512
    Samia
    Participant

    Hi,
    Here is WC Vendors reply for someone. I have seen that @Ben and @Jami replied about custom code issues but @fervous always replies such kind of answers for me. I don’t know why you can’t forward my problem to @Ben or @Jami.
    I always saw that @ben and @jami answer such kind of questions on your support channel. For clarification have a look at following links:

    Many other examples I have seen on the support channel.

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