{"id":14063,"date":"2022-10-04T07:11:21","date_gmt":"2022-10-04T14:11:21","guid":{"rendered":"https:\/\/membermouse.com\/?p=14063"},"modified":"2023-11-10T16:23:24","modified_gmt":"2023-11-10T21:23:24","slug":"zweistufiger-checkout","status":"publish","type":"post","link":"https:\/\/membermouse.com\/de\/support-geschichten\/zweistufiger-checkout\/","title":{"rendered":"How Can I Create A 2-Step Checkout? Two Elegant Methods Revealed"},"content":{"rendered":"In this installment from the HelpDesk, one of our team members reveals an elegant method to create a two-step checkout. First, he explains one way that creates two separate pages, as most 2-step checkout processes do. Then, he also shows a method for showing only the account details information form first, and then the payment information as a second, separate step, but on the same page. Please note that this second option does involve HTML and some basic scripting.\n\n<hr \/>\n\n<strong>Curious about Checkouts asked:<\/strong>\n\n\"I was wondering if there is an easy way to separate the core checkout page into two separate pages. I want to have a page that asks for customer account info (name, email, etc..) , and then go to a page to enter payment info after their account is created.\"\n\n<hr \/>\n\n<blockquote><strong>John from MemberMouse replied:<\/strong>\n\n\"There are two approaches to this. The first one works exactly as you described, where there are two independent checkout pages in series. We have a detailed description of how to build this process in our support article <a href=\"https:\/\/support.membermouse.com\/a\/solutions\/articles\/9000020262\" target=\"_blank\" rel=\"noopener nofollow\">Create a 2-Step Checkout<\/a>. I'll include the essentials below too.\n\nThe first step is to create a new page for the first checkout step, and place a <a href=\"https:\/\/membermouse.com\/docs\/make-a-free-membership-signup-form\/\" target=\"_blank\" rel=\"noopener nofollow\">Free Membership Signup Form<\/a> on the page.\n\nNext, you create a <a href=\"https:\/\/membermouse.com\/docs\/create-product-specific-confirmation-page\/\" target=\"_blank\" rel=\"noopener nofollow\">Product Specific Confirmation Page<\/a> for Free Memberships, and on this confirmation page you place a copy of the <a href=\"https:\/\/membermouse.com\/docs\/checkout-core-page-template\/\" target=\"_blank\" rel=\"noopener nofollow\">Checkout Core Page Template<\/a> code, modifying the <a href=\"https:\/\/support.membermouse.com\/a\/solutions\/articles\/9000020262\" target=\"_blank\" rel=\"noopener nofollow\">Form SmartTag<\/a> slightly so that a specific product is offered. Since anyone who reaches this page is a logged-in member, the Account Details section of the checkout is automatically hidden, and we don't prompt for that information again. At this point, the member would be able to fill out payment information and finish the checkout process.\n\nThe main drawback of this approach is that it can be difficult to provide two-step checkout for multiple products on the same site. All members who sign up on the free membership level we created will be offered the product we specified. To offer multiple products this way, one option would be to place a <a href=\"https:\/\/membermouse.com\/docs\/switch-membership-products-on-checkout\/\">Product Switch<\/a> on the second step of the checkout. Alternatively, you would need a separate free membership level for each product you sold, and a <a href=\"https:\/\/membermouse.com\/docs\/member-decision-smarttag-mm_member_decision\/\">Member Decision SmartTag<\/a> to switch between the checkout code for each one at the second step.\n\nThe second approach is to fake two pages using scripting. With this method, there aren't really two pages, and members are not really created until they complete the entire process. Instead, you're just hiding and showing sections of the page, and providing buttons to advance through them. This creates the experience of two-step checkout without an intermediary free membership being created.\n\nThis is more like an intermediate-level page-building activity, but if you're interested and somewhat comfortable with HTML and basic scripts, you can follow the demonstration implementation below to see how it can be done.\n<h3 class=\"title-budicon\"><i class=\"budicon-star color-blue\"><\/i> <strong>Elegant 2-Step Checkout Demonstration<\/strong><\/h3>\n<div style=\"text-align: center;\"><img src=\"https:\/\/storage.googleapis.com\/wpgcbucket\/wp\/2022\/10\/b526235d-2_step_checkout.gif\"><\/div>\nFirst, take a look at the <a href=\"https:\/\/membermouse.com\/docs\/checkout-core-page-template\/\" target=\"_blank\" rel=\"noopener\">Checkout Page Template<\/a> and you'll see that all the different sections are already laid out as &lt;div&gt; blocks and our section auto-hiding is a separate system that surrounds them, so that's really convenient for us. We'll start by opening the checkout page in the editor and viewing it as HTML.\n\nThe first change we need to make is to add some CSS so that when the page loads it will be in the desired configuration. There's a bunch of different ways to do this, ultimately it might be better to have it in your theme's Additional CSS section, but for now we'll just add some code to the very top of the checkout page:\n<pre>&lt;style&gt;\n#mm-billing-information-section, #mm-shipping-information-section, \n#mm-coupon-block, .mm-purchaseSection, #page-nav-back {display: none;}\n&lt;\/style&gt;\n<\/pre>\nJust underneath that, we'll add some scripting for our functions that show and hide the pages:\n<pre>&lt;script&gt;\nfunction showPageOne() {\n  jQuery( \".mm-purchaseSection\" ).hide();\n  jQuery( \"#mm-account-information-section\" ).show();\n  jQuery( \"#mm-billing-information-section\" ).hide();\n  jQuery( \"#mm-shipping-information-section\" ).hide();\n  jQuery( \"#mm-coupon-block\" ).hide();\n  jQuery( \"#page-nav-back\" ).hide();\n  jQuery( \"#page-nav-forward\" ).show();\n}\n\nfunction showPageTwo() {\n  jQuery( \".mm-purchaseSection\" ).show();\n  jQuery( \"#mm-account-information-section\" ).hide();\n  jQuery( \"#mm-billing-information-section\" ).show();\n  jQuery( \"#mm-shipping-information-section\" ).show();\n  jQuery( \"#mm-coupon-block\" ).show();\n  jQuery( \"#page-nav-forward\" ).hide();\n  jQuery( \"#page-nav-back\" ).show();\n}\n&lt;\/script&gt;\n<\/pre>\nNow we need to create our page navigation buttons, and the associated click handlers. I've elected to put those in the right column, I'm not sure that this is the very best layout decision, and I just borrowed some MemberMouse button styling, but you can change these things around as you prefer. In the <a href=\"https:\/\/membermouse.com\/docs\/checkout-core-page-template\/\" target=\"_blank\" rel=\"noopener nofollow\">Checkout Core Page Template<\/a> this would be inserted between line 144 and 145, so just above the &lt;div class=\"mm-purchaseSection\"&gt; tag:\n<pre>&lt;div id=\"page-nav-forward\"&gt;\n&lt;div id=\"page-nav-forward-button\" class=\"mm-button large green\" style=\"width:220px; text-align:center;\"&gt;\nPayment Information \u2192&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div id=\"page-nav-back\"&gt;\n&lt;div id=\"page-nav-back-button\" class=\"mm-button large green\" style=\"width:220px; text-align:center;\"&gt;\n\u2190 Account Information&lt;\/div&gt;\n&lt;p&gt;\u00a0&lt;\/p&gt;\n&lt;\/div&gt;\n\n&lt;script&gt;\njQuery( \"#page-nav-forward-button\" ).click(function() {\n  showPageTwo();\n});\njQuery( \"#page-nav-back-button\" ).click(function() {\n  showPageOne();\n});\n&lt;\/script&gt;\n<\/pre>\nYou can certainly use your own buttons or images, they just need to have the correct IDs so that the script can pick them up.\n\nGive this a try and please let me know if you have any questions.<\/blockquote>\n\n<hr \/>\n\n<strong>Curious about Checkouts replied:<\/strong>\n\n\"This resolved my issue. Thanks so much for taking the time to give me a detailed response with all the information I needed!\"","protected":false},"excerpt":{"rendered":"<p>Haben Sie sich jemals gew\u00fcnscht, eine zweistufige Kaufabwicklung f\u00fcr Ihre Mitgliederseite zu erstellen? Gute Nachrichten! Das k\u00f6nnen Sie. Und in diesem Artikel zeigen wir Ihnen, wie.<\/p>","protected":false},"author":9645,"featured_media":14093,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_strive_editorial_status":"not-started","_strive_copy_of":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_strive_checklists":"\"\"","_strive_active_checklist":"","_strive_post_notes":"","footnotes":""},"categories":[117,120],"tags":[],"class_list":["post-14063","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mm-dash","category-support-stories"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/posts\/14063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/users\/9645"}],"replies":[{"embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/comments?post=14063"}],"version-history":[{"count":0,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/posts\/14063\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/media\/14093"}],"wp:attachment":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/media?parent=14063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/categories?post=14063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/tags?post=14063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}