Home Forums Theme Support Dokan Terms and Conditions code does not work

This topic is: not resolved

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Nayem 3 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #72638

    Daniela
    Member

    Hi,

    I need to have terms and conditions for my vendors. I copied the code and filled in my url. But it still does not show up. Did I do something wrong?

    “Add terms and condition field in registration form
    The registration form is coming from WooCommerce, but we have added some extra fields in the registration form for the seller using the WooCommerce functions.

    To add more fields to the registration fields, you have to open template-tags.php which is located inside \wp-content\plugins\dokan-plugin\includes\ and go to line number 346.

    You will see a function named dokan_seller_reg_form_fields() all the extra fields are located inside that function. We will add our checkbox for terms and conditions in the bottom of the form. So we will go to line number 385 and paste the following code.

    1
    2
    3
    4

    Here we have used the built in browser validation to check if the user has checked the box or not. We did not use any PHP code as we do not need to store any data. So only browser validation is enough.

    We have used # as hyperlink reference placeholder. You have to use the URL of your terms and conditions page.

    After placing the codes on the template-tags.php file, just hit save and reload your registration page. You will get to see a new checkbox with a link to your terms and conditions page.

    Terms and Conditions field”

    Thank you so much

    #72670

    Nayem
    Moderator
    Post count: 6480

    Hello,

    You can add this terms and condition through child theme function.php file. You have to paste those codes into the function file of your child theme-

    add_action( 'dokan_seller_registration_field_after','terms_condition' ); 
    
    function terms_condition(){
    ?>
    <p class="form-row form-group form-row-wide">
    <label><input name="terms" required="" type="checkbox" value="checked" />
    I agree to the <a href="#">terms and conditions</a><span class="required">*</span></label>
    </p>
    
    <?php
    }

    Thanks.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Terms and Conditions code does not work’ is closed to new replies.