{"id":1771,"date":"2023-03-26T22:14:28","date_gmt":"2023-03-26T14:14:28","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1771"},"modified":"2023-04-23T21:20:07","modified_gmt":"2023-04-23T13:20:07","slug":"bigcommerce-custom-cashier","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/26\/bigcommerce-custom-cashier\/","title":{"rendered":"Bigcommerce\u81ea\u5b9a\u4e49\u6536\u94f6\u53f0"},"content":{"rendered":"<h2>\u53c2\u8003\u6587\u6863<\/h2>\n<p>Optimized One-Page Checkout\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/support.bigcommerce.com\/s\/article\/Optimized-Single-Page-Checkout\">https:\/\/support.bigcommerce.com\/s\/article\/Optimized-Single-Page-Checkout<\/a><br \/>\nCustomizing Checkout: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/stencil-docs\/customizing-checkout\">https:\/\/developer.bigcommerce.com\/stencil-docs\/customizing-checkout<\/a><br \/>\nInstalling a Custom Checkout\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/stencil-docs\/customizing-checkout\/installing-custom-checkouts\">https:\/\/developer.bigcommerce.com\/stencil-docs\/customizing-checkout\/installing-custom-checkouts<\/a><br \/>\nFile Access (WebDAV)\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/support.bigcommerce.com\/s\/article\/File-Access-WebDAV\">https:\/\/support.bigcommerce.com\/s\/article\/File-Access-WebDAV<\/a><br \/>\nThe Complete Guide to Checkout Customization on BigCommerce\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/medium.com\/bigcommerce-developer-blog\/the-complete-guide-to-checkout-customization-on-bigcommerce-6b566bc36fa9\">https:\/\/medium.com\/bigcommerce-developer-blog\/the-complete-guide-to-checkout-customization-on-bigcommerce-6b566bc36fa9<\/a><br \/>\nStorefront Checkout API\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/api-reference\/cart-checkout\/storefront-checkout-api\">https:\/\/developer.bigcommerce.com\/api-reference\/cart-checkout\/storefront-checkout-api<\/a><br \/>\ncheckout-sdk-js\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/bigcommerce\/checkout-sdk-js\">https:\/\/github.com\/bigcommerce\/checkout-sdk-js<\/a><\/p>\n<p><!-- more --><\/p>\n<blockquote>\n<p>Optimized One-Page Checkout is BigCommerce\u2019s default checkout and order confirmation page.<\/p>\n<p>The Storefront Checkout API surfaces the business logic of the backend ecommerce application \u2014 retrieving customer information, fetching available shipping methods, and calculating discounts and sales tax.<\/p>\n<\/blockquote>\n<h2>\u81ea\u5b9a\u4e49\u6536\u94f6\u53f0\u8bbe\u7f6e<\/h2>\n<p>Advanced Settings (\u9ad8\u7ea7\u8bbe\u7f6e) \u203a Checkout (\u7ed3\u7b97) \u203a select Optimized one-page checkout (Recommended)<\/p>\n<h2>\u53ef\u5b9a\u5236\u9009\u9879<\/h2>\n<h3>\u81ea\u5b9a\u4e49\u8868\u5355\u5b57\u6bb5<\/h3>\n<p>Form\u8868\u5355\u7f16\u8f91: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/support.bigcommerce.com\/s\/article\/Editing-Form-Fields#advanced-settings\">https:\/\/support.bigcommerce.com\/s\/article\/Editing-Form-Fields#advanced-settings<\/a><\/p>\n<h3>\u5e97\u94fa\u8bbe\u7f6e<\/h3>\n<p>\u5e97\u94fa\u914d\u7f6e: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/stencil-docs\/store-design\/configuring-store-design\">https:\/\/developer.bigcommerce.com\/stencil-docs\/store-design\/configuring-store-design<\/a><\/p>\n<h3>\u591a\u8bed\u8a00\u6536\u94f6\u53f0<\/h3>\n<p>Stencil templates: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/stencil-docs\/template-files\/customize-stencil-checkout\/multi-language-checkout#multi_browsing\">https:\/\/developer.bigcommerce.com\/stencil-docs\/template-files\/customize-stencil-checkout\/multi-language-checkout#multi_browsing<\/a><\/p>\n<h3>\u81ea\u5b9a\u4e49CSS<\/h3>\n<p>optimized-checkout.scss: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/stencil-docs\/template-files\/customize-stencil-checkout\/optimized-one-page-checkout\">https:\/\/developer.bigcommerce.com\/stencil-docs\/template-files\/customize-stencil-checkout\/optimized-one-page-checkout<\/a><\/p>\n<h3>\u81ea\u5b9a\u4e49JavaScript<\/h3>\n<p>Script Manager(\u6ce8\u5165\u811a\u672c): <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/support.bigcommerce.com\/s\/article\/Using-Script-Manager\">https:\/\/support.bigcommerce.com\/s\/article\/Using-Script-Manager<\/a><br \/>\nScripts API(\u811a\u672cAPI): <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/api-reference\/storefront\/content-scripts-api\">https:\/\/developer.bigcommerce.com\/api-reference\/storefront\/content-scripts-api<\/a><br \/>\n\u4f7f\u7528 setInterval()\u8f6e\u8be2 DOM\uff0c\u4ee5\u786e\u4fdd\u8981\u76ee\u6807\u7684\u5143\u7d20\u5df2\u7ecf\u52a0\u8f7d: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/MutationObserver\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/MutationObserver<\/a><\/p>\n<pre><code class=\"language-javascript\">&lt;script&gt;\n(function(win) {\n    &#039;use strict&#039;;\n\n    var listeners = [], \n    doc = win.document, \n    MutationObserver = win.MutationObserver || win.WebKitMutationObserver,\n    observer;\n\n    function ready(selector, fn) {\n        \/\/ Store the selector and callback to be monitored\n        listeners.push({\n            selector: selector,\n            fn: fn\n        });\n        if (!observer) {\n            \/\/ Watch for changes in the document\n            observer = new MutationObserver(check);\n            observer.observe(doc.documentElement, {\n                childList: true,\n                subtree: true\n            });\n        }\n        \/\/ Check if the element is currently in the DOM\n        check();\n    }\n\n    function check() {\n        \/\/ Check the DOM for elements matching a stored selector\n        for (var i = 0, len = listeners.length, listener, elements; i &lt; len; i++) {\n            listener = listeners[i];\n            \/\/ Query for elements matching the specified selector\n            elements = doc.querySelectorAll(listener.selector);\n            for (var j = 0, jLen = elements.length, element; j &lt; jLen; j++) {\n                element = elements[j];\n                \/\/ Make sure the callback isn&#039;t invoked with the \n                \/\/ same element more than once\n                if (!element.ready) {\n                    element.ready = true;\n                    \/\/ Invoke the callback with the element\n                    listener.fn.call(element, element);\n                }\n            }\n        }\n    }\n    \/\/ Expose `ready`\n    win.ready = ready;\n\n})(this);\n\nready(&#039;#checkoutBillingAddress&#039;, function(element) {\n    \/\/ do something\n    alert(&quot;You&#039;re on the billing step!&quot;);\n});   \n&lt;\/script&gt;<\/code><\/pre>\n<h2>Headless Checkout<\/h2>\n<p>BigCommerce surfaces APIs that cover the full checkout process end-to-end, which means that you can build a fully custom checkout either on top of the native storefront, or on a remote platform.<\/p>\n<p>Headless means that the front-end presentation layer has been decoupled from the backend platform that powers it<\/p>\n<h3>Checkout JS SDK<\/h3>\n<p>Checkout JS SDK: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/bigcommerce\/checkout-sdk-js\">https:\/\/github.com\/bigcommerce\/checkout-sdk-js<\/a><br \/>\nmethods: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/bigcommerce\/checkout-sdk-js\/blob\/master\/docs\/classes\/checkoutservice.md\">https:\/\/github.com\/bigcommerce\/checkout-sdk-js\/blob\/master\/docs\/classes\/checkoutservice.md<\/a><\/p>\n<p>Checkout pages built with the SDK are considered headless because you\u2019re replacing the native presentation layer with one that\u2019s custom-built on another framework. The Checkout SDK can also provide a checkout solution for remote headless storefronts, if you redirect back to the BigCommerce domain for the checkout step.<\/p>\n<h3>Embedded Checkout<\/h3>\n<p>Embedded checkout is a great solution for a remote headless storefront, because shoppers can complete their purchase in-context, without being redirected to a BigCommerce domain.<\/p>\n<p>BigCommerce for WordPress: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/bigcommerce\/bigcommerce-for-wordpress\">https:\/\/github.com\/bigcommerce\/bigcommerce-for-wordpress<\/a><\/p>\n<h3>Server-to-Server Checkout API<\/h3>\n<p>Server-to-Server (S2S) Checkout API: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developer.bigcommerce.com\/api-reference\/cart-checkout\/server-server-checkout-api\">https:\/\/developer.bigcommerce.com\/api-reference\/cart-checkout\/server-server-checkout-api<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u6587\u6863 Optimized One-Page Checkout\uff1ahttps:\/\/support.bigcom [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[446],"tags":[],"class_list":["post-1771","post","type-post","status-publish","format-standard","hentry","category-bigcommerce"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1771"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1771\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}