{"id":2748,"date":"2024-12-31T20:26:17","date_gmt":"2024-12-31T20:26:17","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/learn-to-create-checkout-like-step-progress-bar-in-magento-2-complete-code-explanation\/"},"modified":"2025-03-17T06:12:59","modified_gmt":"2025-03-17T06:12:59","slug":"create-checkout-like-step-progress-bar-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/create-checkout-like-step-progress-bar-in-magento-2\/","title":{"rendered":"Learn to Create Checkout-like Step Progress Bar In Magento 2 \u2013 Complete Code + Explanation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Do you want to&nbsp;<em><strong>create checkout-like step progress bar in Magento 2<\/strong><\/em>? In this blog post, I am going to share a detailed method to do that.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Filling up never-ending forms online can be tiring.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s admit it\u2014we all have ditched such lengthy forms many times. The end experience is very poor! If you are a&nbsp;<a href=\"https:\/\/business.adobe.com\/products\/magento\/magento-commerce.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2<\/a>&nbsp;store owner, you can make this experience better for your customers by adding a checkout-like progress bar in&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/create-custom-form-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 forms<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We all are acquainted with the checkout progress bar in Magento 2, where the top bar shows the finished\/unfinished steps by the customers.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2023\/04\/add-checkout-like-progress-bar-in-magento-2.png\" alt=\"Add Checkout-like Progress Bar in Magento 2\" class=\"wp-image-30797\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The progress bar in Magento 2 checkout consolidates all the details on one page. Adding a progress bar in Magento 2 can be an effective strategy to increase form fill-ups. Just like us, other users also hate filling up lengthy forms. Breaking down the form into small steps can make the boring process look straightforward.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>In this micro post, we\u2019ll see how to add a checkout-like step progress bar in Magento 2.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s dive into it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code to Create Checkout-like Step Progress Bar in Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Creating a checkout-like step progress bar in Magento 2 is straightforward.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can re-use the core Magento 2&nbsp;<code>opc-progress-bar<\/code>&nbsp;class for the checkout progress bar in&nbsp;<code>.phtml<\/code>&nbsp;file to do that.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>For example:<\/strong><\/em><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;ul class=\"opc-progress-bar\">\n&lt;li class=\"opc-progress-bar-item _active\">\n&lt;span data-bind=\"i18n: item.title, click: $parent.navigateTo\">Step 1&lt;\/span>\n&lt;\/li>\n&lt;li class=\"opc-progress-bar-item \">\n&lt;span data-bind=\"i18n: item.title, click: $parent.navigateTo\">Step 2&lt;\/span>\n&lt;\/li>\n&lt;li class=\"opc-progress-bar-item \">\n&lt;span data-bind=\"i18n: item.title, click: $parent.navigateTo\">Step 3&lt;\/span>\n&lt;\/li>\n&lt;\/ul><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Modify the above code snippet and add it to&nbsp;<code>.phtml<\/code>&nbsp;file of the page where you want to show the progress bar.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the above code, the&nbsp;<code>opc-progress-bar<\/code>&nbsp;class refers to the main progress bar in&nbsp;<code>&lt;ul&gt;<\/code>&nbsp;HTML tag.<\/li>\n\n\n\n<li>The&nbsp;<code>opc-progress-bar-item<\/code>&nbsp;class refers to the individual step.<\/li>\n\n\n\n<li>The&nbsp;<code>_active<\/code>&nbsp;class is added to the&nbsp;<code>&lt;li&gt;<\/code>&nbsp;tag for the currently active step.<\/li>\n\n\n\n<li>The&nbsp;<code>_complete<\/code>&nbsp;class is added to the&nbsp;<code>&lt;li&gt;<\/code>&nbsp;tag for the completed steps.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Customize the above code to display the checkout-like progress bar in Magento 2 according to your requirements!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>That\u2019s it! I hope this blog post has added something valuable to your Magento knowledge!<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In case you still have any queries, feel free to comment.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not forget to share this tutorial in the Magento community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You!  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you want to&nbsp;create checkout-like step progress bar in Magento 2? In this blog post, I am going to share a detailed method to do&#8230;<\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-2748","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=2748"}],"version-history":[{"count":1,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2748\/revisions"}],"predecessor-version":[{"id":3815,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2748\/revisions\/3815"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=2748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=2748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=2748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}