• Resolved elvol

    (@elvol)


    I want virtual and downloadable ticks enabled and hidden by default.
    Is there a solution ?!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello @elvol ,

    To perform this, you will need a two-step procedure.

    First step: Making the checkbox checked by default

    You can do this by overriding the template file – dokan-lite/templates/products/download-virtual.php and make the input field checked by default. Here is the modified file – https://gist.github.com/rashedripon/b6ecc1c3606d039e60be988c39c248e0

    Make sure to keep the file under your child theme > dokan > products folder.

    Alternatively, you can use this code in your theme’s functions.php file to make the fields checked by default –

    add_action('wp_head', function() { ?>
    
      <script type="text/javascript">
        jQuery('.downloadable-checkbox input, .virtual-checkbox input' ).prop('checked', true);
      </script>
      <?php
    
    });

    Second step: hiding the fields

    You can use this CSS to hide the fields from frontend –

    .dokan-dashboard .dokan-form-group.dokan-product-type-container.show_if_subscription.show_if_variable-subscription.show_if_simple {
        display: none;
    }

    I hope the information helps.

    Thank you 🙂

    Thread Starter elvol

    (@elvol)

    Greetings and Regards
    Thanks for your prompt reply
    Yes, digital and downloadable products are marked by default, but they are not hidden!
    Help if you can

    Hello @elvol ,

    Have you tried using the CSS that I shared? –

    .dokan-dashboard .dokan-form-group.dokan-product-type-container.show_if_subscription.show_if_variable-subscription.show_if_simple {
        display: none;
    }

    If this does not work, please contact our support with access details of your site. Also, mention this thread so that we can track down the work till now.

    Thank you 🙂

    Thread Starter elvol

    (@elvol)

    Yes
    I put this code in css template!
    But it did not work
    png: http://rozup.ir/view/3327642/sdgdgs.png
    And how can I access you ?!
    This is my site address:
    http://www.elvol.ir

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @rur165 While I know you have the best of intentions, it’s forum policy that you not ask users for admin or server access. Users on the forums aren’t your customers, they’re your open source collaborators, and requesting that kind of access can put you and them at high risk.

    If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.

    Thankfully are other ways to get information you need:

    You get the idea.

    We know volunteer support is not easy, and this guideline can feel needlessly restrictive. It’s actually there to protect you as much as end users. Should their site be hacked or have any issues after you accessed it, you could be held legally liable for damages. In addition, it’s difficult for end users to know the difference between helpful developers and people with malicious intentions. Because of that, we rely on plugin developers and long-standing volunteers (like you) to help us and uphold this particular guideline.

    When you help users here and in public, you also help the next person with the same problem. They’ll be able to read the debugging and solution and educate themselves.

    Hello @elvol ,

    You can contact us using this contact form – https://wedevs.com/contact

    Thanks, @sterndata for sharing the suggestions. I am aware of the fact that we should not exchange any site details in this forum. My intention was to redirect the user to our main site and get details over there so that we can help further. I will try to articulate this in a more clear notice in the future.

    Thank you 🙂

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    >> My intention was to redirect the user to our main site and get details <<

    Attempting to go around the rules is also breaking the rules. You may not ask, under any circumstances, for credentials for a user’s site.

    You’ve been placed on “modwatch” until we’re convinced such postings have stopped. Your account has *not* been banned, we just want to check things for a while before they’re public. If you wish to take issue with this, contact moderators via the #forums channel on slack (https://make.wordpress.org/slack)

    Hello @sterndata ,

    I understand the concern.

    I am sure that I will be careful with the guidelines.

    Thanks a lot for your help.

    Thank you 🙂

    Thread Starter elvol

    (@elvol)

    @rur165
    Thank you my problem was solved 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Automatically enable and hide virtual and downloadable product settings in dokan’ is closed to new replies.