Display woocomerce registration field as a quiz question

Home Forums WPLMS AddOns WPLMS WooCommerce Display woocomerce registration field as a quiz question

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #132669
    mrloopz26
    Participant
    Good day, I am trying to set up a type of identity verification for my course. I have a woocomerce product connected to a WPLMS course. When a student buys the course they are asked some registration questions like name, address, company name, etc. I have setup a quiz at the beginning of my course and want to display those fields as a quiz question for that currently logged in user. https://prnt.sc/gycput Is there a way to do this ? I was thinking maybe something like you describe here is needed: (https://wplms.io/support/forums/topic/conditional-access-based-on-buddypress-extended-field/) But I am not sure if making this a shortcode is an overkill for what I need. Furthermore, I am not sure if woocomerce has an equivalent like "<span style="color: #24292e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;">bp_get_profile_field_data" </span>that buddypress has? Any help or orientation would be greatly appreciated. I am running WPLMS 3.0  
    #132737
    H.K. Latiyan
    Participant
    Hi, If I understand clearly you want to show all the buddypress profile fields again before starting the quiz ? I am not sure what's the reason behind this because all these settings are already saved in the user profile. Can you please clarify on this . -------------
    #132788
    mrloopz26
    Participant
    <span style="color: #000000; font-family: verdana, geneva; font-size: 13.3333px;">Good day Latiyan,</span> No. I am trying to display woocomerce fields as a quiz question.   These are the fields I am trying to show as questions in a quiz: <span style="color: #4b4d4d; font-family: Lato; font-size: 14px;">https://prnt.sc/gycput</span> Thank you
    #132813
    H.K. Latiyan
    Participant
    Hi, Sorry this is not possible to show these fields in a question. However you can create different questions in the quiz with these question types. If you want the users to enter some information then create a text type question, if you want them to select the options then create select type question or single choice question type.
    #132903
    mrloopz26
    Participant
    Is it possible to show buddypress fields as a quiz question? I can synchronize buddypress fields with woocomerce via the wc2bd plugin.  
    #133053
    H.K. Latiyan
    Participant
    Hi, No its not possible to show the fields as the quiz questions, you can only create new questions similar to the fields but the fields will not be shown as the question automatically.  
    #133154
    mrloopz26
    Participant
    Yes it is possible. put this code inside wplms customizer plugin. function get_question1() { return xprofile_get_field_data( '5', bp_loggedin_user_id() ); } add_shortcode('getquestion1', 'get_question1'); Then simply use shortcode [getquestion1] to display it, either as a question or even as an answer! In this example the '5' is the ID of the field, which you can exchange with the name of the field. The bp_loggedin_user_id is needed to return the fields that correspond to current user. xprofile_get_field_data requires just 2 parameters. 1) is the ID or name of the field to be displayed and 2) is the ID of the user. The free plugin "WC4BP Buddypress xprofile checkout manager" will synchronize your woocomerce sign up fields with your buddypress extended profile fields. I am sure somebody can make a better version of this code. This version restricts you to displaying just the value of the field with ID=5. So if you need to display several different fields you would need to add this code several times, one for each field that needs to be displayed. But since I am not a programmer, this is the best I could come up with on my own. I appreciate the support provided by Alex to thewpgame in the support question I referenced on my original post. I took that as inspiration and then figured out the rest on my own. H.K. Latiyan, I would suggest you try to understand peoples necessities a little better before saying something is not possible or ask questions if you are not understanding. I will remind you that this is paid support. It is not free. You are supposed to be the expert here and most of us asking questions here are trying to fulfill a need that our users are asking for since we have running websites with WPLMS as the base of what we offer. A programmer would not be using WPLMS or paying for support if for some reason they were using it.
    #133229
    H.K. Latiyan
    Participant
    Hi, Thanks for sharing the information here. This is a shortcode that you have created and now if you want to show this as a question and wants to record the user's answer then you'll have to create a question and use the shortcode in it. Thanks for suggestion, I'll definitely try to improve my way of answering to the users and try to better understand their issue.  
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Display woocomerce registration field as a quiz question’ is closed to new replies.