Home Forums WC Vendors Pro Support Force Downloadable and Virtual products

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 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #11061
    clothncraft
    Participant

    Hi!

    I’m wondering if there’s a way to force products to be downloadable and virtual?

    I’d be happy for the page to load with those already ticked if that was all we could do. I don’t mind if the fields are visible – it would be cool if we could hide them and declare the products as downloadable and virtual.

    In the front end by the way…

    Thanks!

    #11062
    clothncraft
    Participant

    The closest forum post I found was previous to vendors pro being released i think and the recomendation was to use a WP – front end plugin… but am hoping there is an option now that wc vendors pro is out 🙂

    #11064
    WC Vendors Support
    Participant

    Validating that the fields are populated is probably your best method, you can add this to the template with your own code of course.

    #11065
    Jamie
    Keymaster

    Hello,

    You could always create them as hidden fields in the product-edit form and just remove the existing ones. That way they will always be populated and can’t be messed with by the vendors.

    cheers,

    Jamie.

    #11106
    clothncraft
    Participant

    Thanks guys.

    Any hints as to how to “create them as hidden fields” while still “validating that the fields are populated”?

    Could that be done by a function? Or would I need to mess with the code of the product-edit form?

    #11112
    Jamie
    Keymaster

    Hi ClothnCraft,

    Do you just need downloadable and Virtual perma-ticked as it were?

    cheers,

    Jamie.

    #11190
    clothncraft
    Participant

    By “perma-ticked” do you mean permanently ticked? If so then yes 🙂

    #11225
    Jamie
    Keymaster

    Hello,

    This should do what you want. This assumes you want them to be simple products.

    https://gist.github.com/digitalchild/cb49e3dfd04b67450d2c

    cheers,

    Jamie.

    #11531
    clothncraft
    Participant

    Thanks HEAPS for that.

    However, I don’t believe it is doing what it ought to be doing 🙁

    Can I just confirm that I’ve done everything right?

    I have copied the template in to my theme folder – thus it is located …

    …mytheme/wc-vendors/dashboard/product-edit.php

    and the area around where I was supposed to edit looks like this …

    <!-- Product Attributes (if any) -->
    <?php
    //Product Type
    WCVendors_Pro_Form_Helper::input( array(
    'post_id' => $object_id,
    'type' => 'hidden',
    'id' => 'product-type',
    'value' => 'simple',
    )
    );
    // Virtual Product
    WCVendors_Pro_Form_Helper::input( array(
    'post_id' => $object_id,
    'type' => 'hidden',
    'id' => '_virtual',
    'value' => 'yes',
    )
    );
    // Downloadable Product
    WCVendors_Pro_Form_Helper::input( array(
    'post_id' => $object_id,
    'type' => 'hidden',
    'id' => '_downloadable',
    'value' => 'yes',
    )
    );
    ?>
    </div>

    <div class="all-100">
    <!-- Media uploader -->

    etc etc.

    Is that correct?

    • This reply was modified 7 years, 3 months ago by clothncraft. Reason: did the tag wrong - it put spurious stuff in the code
    #11533
    clothncraft
    Participant

    hmm it still seems to have put spurious code in there …

    Will try it as plain text…

    <!– Product Attributes (if any) –>
    <?php
    //Product Type
    WCVendors_Pro_Form_Helper::input( array(
    ‘post_id’ => $object_id,
    ‘type’ => ‘hidden’,
    ‘id’ => ‘product-type’,
    ‘value’ => ‘simple’,
    )
    );
    // Virtual Product
    WCVendors_Pro_Form_Helper::input( array(
    ‘post_id’ => $object_id,
    ‘type’ => ‘hidden’,
    ‘id’ => ‘_virtual’,
    ‘value’ => ‘yes’,
    )
    );
    // Downloadable Product
    WCVendors_Pro_Form_Helper::input( array(
    ‘post_id’ => $object_id,
    ‘type’ => ‘hidden’,
    ‘id’ => ‘_downloadable’,
    ‘value’ => ‘yes’,
    )
    );
    ?>
    </div>

    <div class=”all-100″>
    <!– Media uploader –>

    #11534
    clothncraft
    Participant

    Oh deary me – don’t mind me – I am far too tired to be doing this – I was trying to replace the wrong bit of code. I will try again and replacing the correct be and see where we end up 🙂 So sorry!

    #11535
    clothncraft
    Participant

    Nope, still no love 🙁 Any ideas?

    The page still seems to operate completely as it did before.

    #11548
    WC Vendors Support
    Participant

    When pasting code here, use pastebin, or gist.github.com and just paste in the link to the code in your forum reply. 🙂

    #11585
    clothncraft
    Participant

    Thanks!

    Ok, let’s see if this works …

    I edited the code and in it’s context it looks like this …

    http://pastebin.com/KpTPxSZC

    • This reply was modified 7 years, 3 months ago by clothncraft.
    • This reply was modified 7 years, 3 months ago by clothncraft.
    • This reply was modified 7 years, 3 months ago by clothncraft.
    • This reply was modified 7 years, 3 months ago by clothncraft. Reason: Think I've got the pastebin right now!
    #11588
    WC Vendors Support
    Participant

    http://pastebin.com/KpTPxSZC

    Dont link the embed code, just the site url with the random characters after it, short and sweet! 🙂

    #11591
    WC Vendors Support
    Participant

    I’ve got to run out for dinner real fast with my wife and son. Today is my birthday (a ripe old 36). So, I’ll get to this topic and test out the code to see what’s going on with it in about 4 hours. Check back soon. 🙂

    #11593
    clothncraft
    Participant

    Gosh what a palava! You wouldn’t think it would be this hard!!

    got it right after the 5th attempt … could have been worse I guess!! 😛

    Thanks for holding my hand through this!

    Michelle

    #11595
    clothncraft
    Participant

    I find that the product page still looks like…

    Still looks like….jpg

    and I still have to click on Virtual and Downloadable to get it to look like…

    this.jpg

    ie automatically displaying the download box …

    I THOUGHT the code above was supposed to set virtual and downloadable as the page loaded thus automagically displaying the add file box etc … but I could be making wrong assumptions here?

    • This reply was modified 7 years, 3 months ago by clothncraft. Reason: to be more specific in my expectations
    #11599
    clothncraft
    Participant

    Missed that last post sorry!

    Absolutely NOT a problem – sorry to be bugging you on your birthday.

    Happy birthday!

    Have a wonderful evening with your family!

    #11618
    Karen Thomas
    Participant

    Happy birthday Ben! You’ve had a busy month! 🙂

    #11620
    WC Vendors Support
    Participant

    Thanks Karen, it has been a busy month indeed!


    @digitalchild
    The gist for the auto-check doesn’t work. Tested on dev w/ Superstore and no dice! 🙂


    @clothncraft
    Jamie should be able to fix that code for you soon.

    #11637
    Jamie
    Keymaster

    Hello,

    Apologies, my instructions were incorrect. The following is correct, however it won’t work until our next release as I had to update the underlying javascript that controls the product form also. I have tested this and it works (with our new code but we won’t see another release for a week or so).

    https://gist.github.com/digitalchild/cb49e3dfd04b67450d2c

    It will look like this:

    Forced Simple Product and downloadable

    cheers,

    Jamie.

    #11646
    clothncraft
    Participant

    You guys so totally rock!! I will be waiting for the next update in earnest!

    🙂

    Thanks heaps!

    #12457
    clothncraft
    Participant

    Just installed this modification to the code in 1.0.3 and it works a treat – thanks!

Viewing 24 posts - 1 through 24 (of 24 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.