Home Forums WC Vendors Pro Support Checkboxes checked by default

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 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #20153
    Nino
    Participant

    Hi Ben,

    On the product add/edit page I’d like to have the ‘Virtual’ and ‘Downloadable’ checkboxes checked by default and then I’d like to hide these two boxes from the user. Is this possible?

    My store is solely a digital download one and all products have to be virtual and downloadable. I want to make the add screen as simple as possible for my users.

    Thanks

    N

    #20156
    Nino
    Participant

    UPDATE:

    I’ve changed the defaults to ‘yes’ in wc-vendors-pro/public/forms/class-wcvendors-pro-product-form.php

    This works perfectly but I’m guessing this isn’t exactly upgrade proof…

    I also removed <?php WCVendors_Pro_Product_Form::product_type( $object_id ); ?> from the product-edit.php template

    Which I’m guessing is upgrade proof.

    #20163
    WC Vendors Support
    Participant

    The correct way to make them “yes” by default, would be to write a filter that takes the no and makes it yes, by returning the variable with the array key and value.

    This example below is for shipping, but it’s the same principal. Find the variable before the apply_filters for the array, and configure it so that the filter looks like this and you’re good to go. Upgrade safe, too. 🙂

    https://gist.github.com/bentasm1/9946a035456de59f5629

    #20192
    Nino
    Participant

    Ok cool.

    I added the following code and it works. I put it in functions.php. Is this correct?

    [https://gist.github.com/nrosella/293f9f0f617e1b388148]

    #20197
    Nino
    Participant

    ^ Couldn’t get that gist to embed haha

    #20199
    Nino
    Participant

    []

    #20200
    Jamie
    Keymaster

    Hello,

    Yes this is correct. Also to get gist to embed just past the URL and the forums sorts it out.

    cheers,

    Jamie.

    #20201
    Nino
    Participant

    Cheers Jamie

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