Home › Forums › WPLMS AddOns › WPLMS WooCommerce › Display woocomerce registration field as a quiz question
- This topic has 7 replies, 2 voices, and was last updated 7 years, 1 month ago by H.K. Latiyan.
Viewing 8 posts - 1 through 8 (of 8 total)
-
AuthorPosts
-
October 17, 2017 at 5:26 am #132669mrloopzParticipantGood 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.0October 17, 2017 at 12:26 pm #132737H.K. LatiyanParticipantHi, 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 . -------------October 17, 2017 at 10:06 pm #132788mrloopzParticipant<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 youOctober 18, 2017 at 6:35 am #132813H.K. LatiyanParticipantHi, 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.October 18, 2017 at 4:20 pm #132903mrloopzParticipantIs it possible to show buddypress fields as a quiz question? I can synchronize buddypress fields with woocomerce via the wc2bd plugin.October 21, 2017 at 6:28 am #133053H.K. LatiyanParticipantHi, 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.October 23, 2017 at 4:14 am #133154mrloopzParticipantYes 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.October 23, 2017 at 11:56 am #133229H.K. LatiyanParticipantHi, 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. -
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
- The topic ‘Display woocomerce registration field as a quiz question’ is closed to new replies.