Anyone else able to create vouchers?
-
I am new to the LifterLMS family (since version 2.2.3) and am really enjoying the platform. I have run across an issue in both versions where I cannot assign anything to my vouchers.
I can create the voucher title, but any courses, memberships, or codes I create are not saved when I click “Update / Publish” the fields just blank out back to default.
Anyone else able to create vouchers or know what I am doing wrong?
-
Hey Affiliatenow,
This looks like some kind of JS conflict with your theme or one of the plugins.
Can you please check Console output in your browser and note what JS error are you getting? You can open debug console by pressing Ctrl+Shift+J in Chrome.If you don’t have any JS errors then please provide us with LifterLMS system report.
Details on obtaining your system report are available here: https://lifterlms.com/docs/how-to-use-the-lifterlms-system-report/Thanks! I created a support ticket with my system report attached.
I changed to the Twenty-Fifteen” theme, and disabled all plugins except for LifterLMS and was still getting the same issue.
Thanks for submitting report, I can’t find anything in it that would cause problem like the one you are describing.
It looks like JS error is only possible solution, can you please tell us which browser you use and follow step 3 instructions from following link to provide us with JS errors from voucher page: https://codex.www.ads-software.com/Using_Your_Browser_to_Diagnose_JavaScript_Errors
I agree it is JS related, I had to wp_enque a helpdesk form that used Java… here is what I get:
Initializing Review llms.min.js:1:15908
Review Methods Bound llms.min.js:1:17105
Initializing Rest Methods llms.min.js:1:17431
Rest Methods Bound llms.min.js:1:17502And then when I click on the first .js link I get
var LLMS=window.LLMS||{};!function(e){"use strict";LLMS.Ajax={url:window.ajaxurl||window.llms.ajaxurl,type:"post",data:[],cache:!1,dataType:"json",async:!0,response:[],init:function(e){if(null===e||"object"!=typeof e)return!1;e.url=this.url,e.type="type"in e?e.type:this.type,e.data="data"in e?e.data:this.data,e.cache="cache"in e?e.cache:this.cache,e.dataType="dataType"in e?e.dataType:this.dataType,e.async="async"in e?e.async:this.async,e.data._ajax_nonce=wp_ajax_data.nonce;var t=LLMS.Rest,s=t.get_query_vars();return e.data.post_id="post"in s?s.post:null,e},call:function(e){var t=this.init(e);return t?(this.request(t),this):!1},request:function(t){return e.ajax(t),this}},LLMS.MB_Course_Outline={init:function(){e("#llms_post_edit_type").length&&"course"===e("#llms_post_edit_type").val()&&this.bind()},alreadySubmitted:!1,bind:function(){function t(){e("#llms-outline-add").removeClass("clicked"),e("#llms-outline-add").addClass("bt"),e("#llms-outline-menu").removeClass("fade-in"),e("#triangle").show()}var s=this;e(document).ready(function(){s.addSectionRowFunctionality(),s.addLessonRowFunctionality()}),e(".llms-modal-cancel").click(function(t){t.preventDefault(),e(window).trigger("build")}),e(document).ready(function(){e(".llms-chosen-select").chosen({width:"100%"})}),e(".tab-link").on("click",function(){e("#content_ifr").css("height","300px"),e("#excerpt_ifr").css("height","300px")}),e("#_has_prerequisite").attr("checked")?(e(".llms-prereq-top").addClass("top"),e(".llms-prereq-bottom").show()):e(".llms-prereq-bottom").hide(),e("#_has_prerequisite").change(function(){e("#_has_prerequisite").attr("checked")?(e(".llms-prereq-top").addClass("top"),e(".llms-prereq-bottom").show()):(e(".llms-prereq-top").removeClass("top"),e(".llms-prereq-bottom").hide())}),this.toggle_custom_single_price_field(),e("a.llms-modal").click(function(){e("#"+e(this).attr("data-modal_id")).topModal({title:e(this).attr("data-modal_title"),closed:function(){s.alreadySubmitted=!1}})}),e("a.llms-modal-new-lesson-link").click(function(){e("#"+e(this).attr("data-modal_id")).topModal({title:e(this).attr("data-modal_title"),open:function(){s.getSections(),e("#llms_create_lesson").find('input[value="Create Lesson"]').removeProp("disabled")},closed:function(){s.alreadySubmitted=!1}})}),e("a.llms-modal-existing-lesson-link").click(function(){e("#"+e(this).attr("data-modal_id")).topModal({title:e(this).attr("data-modal_title"),open:function(){s.getSections(),s.getLessons()},closed:function(){s.alreadySubmitted=!1}})}),this.setup_course(),e(window).click(function(s){"llms-outline-add"!==s.target.id&&e("#llms-outline-add").hasClass("clicked")&&(e("#llms-outline-menu").css("display","none"),t())}),e(window).scroll(function(){if(e("#llms-outline-add").hasClass("clicked")){e("#triangle").hide();var t=e("#llms-outline-menu"),s=-e("#llms-outline-add").offset().top-81+e(window).scrollTop()+e(window).height()/2;t.css("top",s)}}),e("#llms-outline-add").click(function(t){t.preventDefault();var s=e("#llms-outline-menu");if(e(this).hasClass("bt")){if(e(this).offset().top-e(window).scrollTop()<200)s.css("top","43px"),e(window).width()<851&&(s.find("#triangle").css("left","164px"),s.css("top","57px"),s.css("left","-138px"),s.css("bottom","15px"));else if(s.css("top",""),e(window).width()<851){s.css("top","-54px");var i=e(window).width()<400?-Math.abs(e(window).width()/2):-242;i+="px",s.css("left",i),s.css("bottom","15px"),s.find("#triangle").css("left","227px")}e(this).removeClass("bt"),e(this).addClass("clicked"),s.addClass("fade-in"),s.css("display","block")}else e(this).removeClass("clicked"),e(this).addClass("bt"),s.removeClass("fade-in"),s.css("display","none"),s.find("#triangle").show()}),e("#tooltip_menu a").click(function(t){var s=e("#llms-outline-menu");s.removeClass("fade-in"),s.css("display","none"),t.preventDefault()}),e("a.tooltip").click(function(e){e.preventDefault()}),e("#llms_create_section").on("submit",function(t){t.preventDefault();var i={};e.each(e(this).serializeArray(),function(e,t){i[t.name]=t.value}),s.alreadySubmitted===!1&&(s.alreadySubmitted=!0,s.createSection(i))}),e("#llms_create_lesson").on("submit",function(t){t.preventDefault();var i={};e.each(e(this).serializeArray(),function(e,t){i[t.name]=t.value}),s.alreadySubmitted===!1&&(s.alreadySubmitted=!0,s.createLesson(i))}),e("#llms_add_existing_lesson").on("submit",function(t){t.preventDefault();var i={};e.each(e(this).serializeArray(),function(e,t){i[t.name]=t.value}),s.alreadySubmitted===!1&&(s.alreadySubmitted=!0,s.addExistingLesson(i))}),e("#llms_edit_lesson").on("submit",function(t){t.preventDefault();var i={};e.each(e(this).serializeArray(),function(e,t){i[t.name]=t.value}),s.updateLesson(i)}),e("#llms_edit_section").on("submit",function(t){t.preventDefault();var i={};e.each(e(this).serializeArray(),function(e,t){i[t.name]=t.value}),s.updateSection(i)}),e("#llms_delete_section").on("submit",function(t){t.preventDefault();var i={};e.each(e(this).serializeArray(),function(e,t){i[t.name]=t.value}),s.deleteSection(i)})},toggle_custom_single_price_field:function(){e("#_is_custom_single_price").attr("checked")?(e(".llms-custom-single-price-top").removeClass("bottom"),e(".llms-custom-single-price-top").addClass("top"),e(".llms-custom-single-price-bottom").show()):e(".llms-custom-single-price-bottom").hide(),e("#_is_custom_single_price").change(function(){e("#_is_custom_single_price").attr("checked")?(e(".llms-custom-single-price-top").removeClass("bottom"),e(".llms-custom-single-price-top").addClass("top"),e(".llms-custom-single-price-bottom").show()):(e(".llms-custom-single-price-top").removeClass("top"),e(".llms-custom-single-price-top").addClass("bottom"),e(".llms-custom-single-price-bottom").hide())})},resortSections:function(){var t={};e(".llms-section").each(function(s){s++,e(this).find('[name="llms_section_order[]"]').val(s),e(this).find(".llms-section-order").html(s);var i=e(this).find('[name="llms_section_id[]"]').val();t[i]=s}),LLMS.MB_Course_Outline.updateSectionOrder(t)},updateSectionOrder:function(e){console.log(e),LLMS.Ajax.call({data:{action:"update_section_order",sections:e},beforeSend:function(){},success:function(e){console.log(e)}})},updateLessonOrder:function(e){console.log(e),LLMS.Ajax.call({data:{action:"update_lesson_order",lessons:e},beforeSend:function(){},success:function(e){console.log(e)}})},resortLessons:function(){var t={};e(".llms-lesson-tree").each(function(){e(this).find(".llms-lesson").each(function(s){s++;var i=e(this).parent().parent().find('[name="llms_section_id[]"]').val();e(this).find('[name="llms_lesson_parent_section[]"]').val(i),e(this).find('[name="llms_lesson_order[]"]').val(s),e(this).find(".llms-lesson-order").html(s),console.log(i);var n=e(this).find('[name="llms_lesson_id[]"]').val();t[n]={parent_section:i,order:s}})}),LLMS.MB_Course_Outline.updateLessonOrder(t)},createSection:function(t){LLMS.Ajax.call({data:{action:"create_section",title:t.llms_section_name},beforeSend:function(){},success:function(t){console.log(t),t.success===!0&&(e("#llms_course_outline_sort").append(t.data),e(window).trigger("build"),LLMS.MB_Course_Outline.addSectionRowFunctionality(),e("#llms_create_section").each(function(){this.reset()}))}})},addSectionRowFunctionality:function(){e(".llms-lesson-tree").sortable({connectWith:".llms-lesson-tree",axis:"y",placeholder:"placeholder",cursor:"move",forcePlaceholderSize:!0,stop:function(){LLMS.MB_Course_Outline.resortLessons()}}).disableSelection(),e("#llms_course_outline_sort").sortable({connectWith:".sortablewrapper",axis:"y",placeholder:"placeholder",cursor:"move",forcePlaceholderSize:!0,stop:function(){LLMS.MB_Course_Outline.resortSections()}}).disableSelection(),e("a.llms-edit-section-link").click(function(){var t=e(this);e("#"+e(this).attr("data-modal_id")).topModal({title:e(this).attr("data-modal_title"),open:function(){var e=t.parent().parent().find('[name="llms_section_id[]"]').val();LLMS.MB_Course_Outline.getSection(e)}})}),e("a.llms-delete-section-link").click(function(){var t=e(this);e("#"+e(this).attr("data-modal_id")).topModal({title:e(this).attr("data-modal_title"),open:function(){var s=t.parent().parent().find('[name="llms_section_id[]"]').val();e("#llms-section-delete-id").val(s)}})})},addLessonRowFunctionality:function(){e("a.llms-edit-lesson-link").click(function(){var t=e(this);e("#"+e(this).attr("data-modal_id")).topModal({title:e(this).attr("data-modal_title"),open:function(){var e=t.parent().parent().parent().find('[name="llms_lesson_id[]"]').val();LLMS.MB_Course_Outline.getLesson(e)}})}),e(".llms-remove-lesson-link").on("click",function(t){t.preventDefault();var s=e(this).parent().parent().parent().find('[name="llms_lesson_id[]"]').val();LLMS.MB_Course_Outline.removeLesson(s)})},createLesson:function(t){LLMS.Ajax.call({data:{action:"create_lesson",title:t.llms_lesson_name,excerpt:t.llms_lesson_excerpt,section_id:t.llms_section},beforeSend:function(){},success:function(s){console.log(s),s.success===!0&&(e(".llms-section").each(function(){var i=e(this).find('[name="llms_section_id[]"]').val();console.log(i),i===t.llms_section&&(console.log("found one"),console.log(e(this)),console.log(e(this).find(".llms_lesson_tree")),e(this).find("#llms_section_tree_"+t.llms_section).append(s.data))}),e(window).trigger("build"),LLMS.MB_Course_Outline.addLessonRowFunctionality(),e("#llms_create_lesson").each(function(){this.reset()}))}})},addExistingLesson:function(t){LLMS.Ajax.call({data:{action:"add_lesson_to_course",lesson_id:t.llms_lesson,section_id:t.llms_section},beforeSend:function(){},success:function(s){s.success===!0&&(e(".llms-section").each(function(){var i=e(this).find('[name="llms_section_id[]"]').val();console.log(i),i===t.llms_section&&e(this).find("#llms_section_tree_"+t.llms_section).append(s.data)}),e(window).trigger("build"),LLMS.MB_Course_Outline.addLessonRowFunctionality(),e("#llms_add_existing_lesson").each(function(){this.reset()}))}})},getSections:function(){LLMS.Ajax.call({data:{action:"get_course_sections"},success:function(t){t.success===!0&&(e("#llms-section-select").empty(),e.each(t.data,function(t,s){var i=e('<option value="'+s.ID+'">'+s.post_title+"</option>");e("#llms-section-select").append(i)}),e("#llms-section-select").trigger("chosen:updated"))}})},getSection:function(t){console.log(t),LLMS.Ajax.call({data:{action:"get_course_section",section_id:t},success:function(t){t.success===!0&&(e("#llms-section-edit-name").val(t.data.post.post_title),e("#llms-section-edit-id").val(t.data.id))}})},getLesson:function(t){console.log(t),LLMS.Ajax.call({data:{action:"get_course_lesson",lesson_id:t},success:function(t){t.success===!0&&(e("#llms-lesson-edit-name").val(t.data.post.post_title),e("#llms-lesson-edit-excerpt").val(t.data.post.post_excerpt),e("#llms-lesson-edit-id").val(t.data.id))}})},updateSection:function(t){LLMS.Ajax.call({data:{action:"update_course_section",section_id:t.llms_section_edit_id,title:t.llms_section_edit_name},success:function(s){s.success===!0&&(e(".llms-section").each(function(){var i=e(this).find('[name="llms_section_id[]"]').val();console.log(i),i===t.llms_section_edit_id&&(console.log("found one"),console.log(e(this)),console.log(e(this).find(".llms-section-title")),e(this).find(".llms-section-title").html(s.data.title))}),e(window).trigger("build"),e("#llms_edit_section").each(function(){this.reset()}))}})},updateLesson:function(t){LLMS.Ajax.call({data:{action:"update_course_lesson",lesson_id:t.llms_lesson_edit_id,title:t.llms_lesson_edit_name,excerpt:t.llms_lesson_edit_excerpt},success:function(s){s.success===!0&&(e(".llms-lesson").each(function(){var i=e(this).find('[name="llms_lesson_id[]"]').val();console.log(i),i===t.llms_lesson_edit_id&&(e(this).find(".llms-lesson-title").html(s.data.title.title),e(this).find(".llms-lesson-excerpt").html(s.data.excerpt.post_excerpt))}),e(window).trigger("build"),e("#llms_edit_lesson").each(function(){this.reset()}))}})},removeLesson:function(t){LLMS.Ajax.call({data:{action:"remove_course_lesson",lesson_id:t},success:function(s){s.success===!0&&e(".llms-lesson").each(function(){var s=e(this).find('[name="llms_lesson_id[]"]').val();console.log(s),s===t&&(e(this).remove(),LLMS.MB_Course_Outline.resortLessons())})}})},deleteSection:function(t){LLMS.Ajax.call({data:{action:"delete_course_section",section_id:t.llms_section_delete_id},success:function(s){s.success===!0&&(e(".llms-section").each(function(){var s=e(this).find('[name="llms_section_id[]"]').val();console.log(s),s===t.llms_section_delete_id&&(e(this).remove(),LLMS.MB_Course_Outline.resortSections())}),e(window).trigger("build"))}})},getLessons:function(){LLMS.Ajax.call({data:{action:"get_lesson_options_for_select"},success:function(t){t.success===!0&&(e("#llms-lesson-select").empty(),e.each(t.data,function(t,s){var i=e('<option value="'+t+'">'+s+"</option>");e("#llms-lesson-select").append(i)}),e("#llms-lesson-select").trigger("chosen:updated"))}})},setup_course:function(){var t=LLMS.Rest,s=["post-new.php"],i="course",n=t.get_query_vars();t.is_path(s)&&n.post_type===i&&(e(document).ready(function(){e("#pop1").topModal({title:"Create New Course"})}),e("#llms-create-course-submit").click(function(t){e("#title").val(e("#llms-course-name").val()),e("#save-post").click(),t.preventDefault()}))}},LLMS.Quiz={init:function(){var e=LLMS.Rest,t=["llms_quiz"];e.is_path(t)&&this.bind()},bind:function(){var t=this;e("#llms-quiz-timer").hide(),e("#llms_start_quiz").click(function(){return t.start_quiz(),!1}),e(".view-summary").click(function(){var t=e(".accordion");t.hasClass("hidden")?(t.fadeIn(300),t.removeClass("hidden"),e(this).text("Hide Summary")):(t.fadeOut(300),t.addClass("hidden"),e(this).text("View Summary"))}),this.chart_quiz_grade()},chart_quiz_grade:function(){var t=e(".llms-animated-circle"),s=e(".llms-progress-circle-count"),i=e("#llms-grade-value").val(),n=430*i/100;t.css({"stroke-dashoffset":430-n}),s.html(Math.round(i)+"%")},start_quiz:function(){var t=e("#llms-quiz").val(),s=e("#llms-user").val(),i=new Ajax("post",{action:"start_quiz",quiz_id:t,user_id:s},!0);i.start_quiz(t,s)},answer_question:function(){if(e("input[name=llms_option_selected]:checked").length<=0)e("#llms-quiz-question-wrapper .llms-error").remove(),e("#llms-quiz-question-wrapper").prepend('<div class="llms-error">You must enter an answer to continue.</div>');else{var t=e("#llms-quiz").val(),s=e("#question-type").val(),i=e("#question-id").val(),n=e("input[name=llms_option_selected]:checked").val(),l=new Ajax("post",{action:"answer_question",quiz_id:t,question_type:s,question_id:i,answer:n},!0);l.answer_question(s,i,n)}},previous_question:function(){var t=e("#llms-quiz").val(),s=e("#question-id").val(),i=new Ajax("post",{action:"previous_question",quiz_id:t,question_id:s},!0);i.previous_question(t,s)},start_quiz_timer:function(){var t=e("#set-time").val();if(t){var s,i,n,l,o=(new Date).getTime()+60*t*1e3,a=60*t*1e3,c=document.getElementById("tiles"),r=this;setTimeout(function(){r.complete_quiz()},a),this.getCountdown(t,o,a,s,i,n,l,c),setInterval(function(){r.getCountdown(t,o,a,s,i,n,l,c)},1e3)}},getCountdown:function(t,s,i,n,l,o,a,c){var r=(new Date).getTime(),d=(s-r)/1e3;d>=0&&(i/2>1e3*d&&(e("#tiles").removeClass("color-full"),e("#tiles").addClass("color-half")),i/4>1e3*d&&(e("#tiles").removeClass("color-half"),e("#tiles").addClass("color-empty")),n=this.pad(parseInt(d/86400)),d%=86400,l=this.pad(parseInt(d/3600)),d%=3600,o=this.pad(parseInt(d/60)),a=this.pad(parseInt(d%60)),c.innerHTML="<span>"+l+":</span><span>"+o+":</span><span>"+a+"</span>")},pad:function(e){return(10>e?"0":"")+e},complete_quiz:function(){var t=e("#llms-quiz").val(),s=e("#question-type").val(),i=e("#question-id").val(),n=e("input[name=llms_option_selected]:checked").val(),l=new Ajax("post",{action:"complete_quiz",quiz_id:t,question_id:i,question_type:s,answer:n},!0);l.complete_quiz(t,i,s,n)}},LLMS.Review={init:function(){console.log("Initializing Review "),this.bind()},bind:function(){e("#llms_review_submit_button").click(function(){""!==e("#review_title").val()&&""!==e("#review_text").val()?jQuery.ajax({type:"post",dataType:"json",url:window.llms.ajaxurl,data:{action:"LLMSSubmitReview",review_title:e("#review_title").val(),review_text:e("#review_text").val(),pageID:e("#post_ID").val()},success:function(){console.log("Review success"),e("#review_box").hide("swing"),e("#thank_you_box").show("swing")},error:function(e,t,s){console.log(e),console.log(t),console.log(s)}}):(""===e("#review_title").val()?e("#review_title_error").show("swing"):e("#review_title_error").hide("swing"),""===e("#review_text").val()?e("#review_text_error").show("swing"):e("#review_text_error").hide("swing"))}),e("#_llms_display_reviews").attr("checked")?(e(".llms-num-reviews-top").addClass("top"),e(".llms-num-reviews-bottom").show()):e(".llms-num-reviews-bottom").hide(),e("#_llms_display_reviews").change(function(){e("#_llms_display_reviews").attr("checked")?(e(".llms-num-reviews-top").addClass("top"),e(".llms-num-reviews-bottom").show()):(e(".llms-num-reviews-top").removeClass("top"),e(".llms-num-reviews-bottom").hide())}),console.log("Review Methods Bound")}},LLMS.Tabs={init:function(){this.bind()},bind:function(){e("ul.tabs li").click(function(){var t=e(this).attr("data-tab");e("ul.tabs li").removeClass("current"),e(".tab-content").removeClass("current"),e(this).addClass("current"),e("#"+t).addClass("current")})}},LLMS.Rest={init:function(){console.log("Initializing Rest Methods "),this.bind()},bind:function(){console.log("Rest Methods Bound")},is_path:function(e){for(var t=!1,s=window.location.href,i=0;i<e.length;i++)s.search(e[i])>0&&!t&&(t=!0);return t},get_query_vars:function(){for(var e,t=[],s=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<s.length;i++)e=s[i].split("="),t.push(e[0]),t[e[0]]=e[1];return t}},LLMS.init=function(){for(var e in LLMS)"object"==typeof LLMS[e]&&null!==LLMS[e]&&void 0!==LLMS[e].init&&"function"==typeof LLMS[e].init&&LLMS[e].init()},LLMS.init(e)}(jQuery);
Hey @affiliatenow,
This doesn’t actually show any errors, it looks like you’re just outputting some of our functions onto the console. Unfortunately this isn’t the least bit helpful in narrowing down the issue.
Can you reproduce this issue in other browsers?
Would you please let us know what browser (and version) and operating system your experiencing this in.
Have you also confirmed that this is not a conflict with a theme or plugin? You can identify that by disabling all other plugins except LifterLMS and checking to see if the issue is still occurring.
If it is still occurring please try this with a default theme like twentysixteen.
You can also provide us with a copy of your LifterLMS system report. Details on locating your system report are here: https://lifterlms.com/docs/how-to-use-the-lifterlms-system-report/
I’m sorry that you’re having issues here and we very much want to resolve it but it does seem like this is specific to your environment somehow as this hasn’t been reported by anyone else and both petar and I are unable to reproduce the issue.
Thanks,
I could not tell where the corruption was coming from, so I just blew my entire WordPress site away and started from scratch. I reinstalled the exact same plugins and themes and it now works.
I wish I had a better answer, if anybody ever encounters this in the future… but that is what I had to do.
hey @affiliatenow,
Sounds like you’ve fixed it, going to mark this as resolved.
Please open a new thread if you require help on other matters and have a great day!
- The topic ‘Anyone else able to create vouchers?’ is closed to new replies.