Home Forums WC Vendors Pro Support WooCommerce JPlayer Product Sampler Integration

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
  • #32011
    Gabriel
    Participant

    WooCommerce JPlayer Product Sampler (https://www.woothemes.com/products/jplayer-product-sampler/) integrated in 3 steps:
    1. onesocial-child/functions.php

    /* WC Vendors Pro – Sample File Option */
    function jplayer_update_field ( $post_id ) {

    $title = get_post_meta( $post_id, ‘wcv_custom_product_sample_file_title’, true );

    $file_path = get_post_meta( $post_id, ‘wcv_custom_product_sample_file_path’, true );

    $jplayer_data[] = array( ‘title’ => $title, ‘path’ => $file_path );

    update_post_meta( $post_id, ‘_jplayer_sample_file’, $jplayer_data );
    }

    add_action (‘wcv_save_product’,’jplayer_update_field’);

    function wcv_file_uploader( ){
    $value = get_user_meta( get_current_user_id(), ‘test’, true );
    WCVendors_Pro_Form_Helper::file_uploader( array(
    ‘header_text’ => __(‘File uploader’, ‘wcvendors-pro’ ),
    ‘add_text’ => __(‘Add file’, ‘wcvendors-pro’ ),
    ‘remove_text’ => __(‘Remove file’, ‘wcvendors-pro’ ),
    ‘image_meta_key’ => ‘test’,
    ‘save_button’ => __(‘Add file’, ‘wcvendors-pro’ ),
    ‘window_title’ => __(‘Select an Image’, ‘wcvendors-pro’ ),
    ‘value’ => $value
    )
    );

    }

    2. onesocial-child/wc-vendors/dashboard/product-edit.php

    <!– Add Preview File –>
    <?php

    WCVendors_Pro_Form_Helper::input( array(
    ‘type’ => ‘text’,
    ‘post_id’ => $object_id,
    ‘id’ => ‘wcv_custom_product_sample_file_title’,
    ‘label’ => __( ‘Sample file title for preview’, ‘wcvendors-pro’ ),
    ‘placeholder’ => __( ‘File title goes here. Leave blank if you don\’t have a sample file’, ‘wcvendors-pro’ ),
    ‘desc_tip’ => ‘true’,
    ‘description’ => __( ‘Leave blank if you don\’t have a sample file’, ‘wcvendors-pro’ ),
    ) );

    WCVendors_Pro_Form_Helper::input( array(
    ‘type’ => ‘text’,
    ‘post_id’ => $object_id,
    ‘id’ => ‘wcv_custom_product_sample_file_path’,
    ‘label’ => __( ‘Sample file path for preview’, ‘wcvendors-pro’ ),
    ‘placeholder’ => __( ‘Click the Add file buttton below and paste here the URL. Leave blank if you don\’t have a sample file ‘, ‘wcvendors-pro’ ),
    ‘desc_tip’ => ‘true’,
    ‘description’ => __( ‘Click the Add file button upload your file and the select it and paste here the link of the file. You can find the link in the left details area’, ‘wcvendors-pro’ ),
    ) );

    wcv_file_uploader();

    ?>
    3. onesocial-child/wc-vendors-pro/public/class-wcvendors-pro-form-helper.php

    echo ‘‘.$field[ ‘add_text’ ].’<br />’;

    #32012
    Gabriel
    Participant

    Screenshots too.
    All for FREE

    #32042
    WC Vendors Support
    Participant

    Nice work!

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