{"id":73,"date":"2026-08-05T13:41:09","date_gmt":"2026-08-05T13:41:09","guid":{"rendered":"http:\/\/www.plexadermlife.shop\/?page_id=73"},"modified":"2026-08-05T13:41:10","modified_gmt":"2026-08-05T13:41:10","slug":"orders","status":"publish","type":"page","link":"https:\/\/www.plexadermlife.shop\/?page_id=73","title":{"rendered":"Orders"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\n<style>\n.orders-login-wrap{\n    max-width:420px;\n    margin:100px auto;\n    padding:40px;\n    border:1px solid #eee;\n    border-radius:20px;\n    background:#fff;\n    box-shadow:0 5px 20px rgba(0,0,0,0.05);\n    text-align:center;\n    font-family:Arial;\n}\n\n.orders-input{\n    width:100%;\n    padding:14px;\n    border:1px solid #ddd;\n    border-radius:12px;\n    font-size:16px;\n}\n\n.orders-btn{\n    width:100%;\n    margin-top:15px;\n    padding:14px;\n    background:#000;\n    color:#fff;\n    border:none;\n    border-radius:12px;\n    cursor:pointer;\n}\n\n.shop-orders-wrap{\n    max-width:900px;\n    margin:40px auto;\n    font-family:Arial;\n}\n\n.shop-order-card{\n    border:1px solid #eee;\n    padding:20px;\n    margin-bottom:15px;\n    border-radius:16px;\n    box-shadow:0 2px 10px rgba(0,0,0,0.03);\n}\n<\/style>\n\n<div id=\"shopify-app\"><\/div>\n\n<script>\n\nlet email = \"\";\n\n\/\/ ========================\n\/\/ \u767b\u5f55\u6846\n\/\/ ========================\nfunction renderLogin(){\n\ndocument.getElementById(\"shopify-app\").innerHTML = `\n<div class=\"orders-login-wrap\">\n    <h2>My Orders<\/h2>\n    <p>Enter email to continue<\/p>\n\n    <input id=\"emailInput\" class=\"orders-input\" placeholder=\"you@example.com\">\n\n    <button class=\"orders-btn\" onclick=\"saveEmail()\">View Orders<\/button>\n<\/div>\n`;\n}\n\n\/\/ ========================\n\/\/ \u4fdd\u5b58\u90ae\u7bb1\n\/\/ ========================\nfunction saveEmail(){\n\n    const e = document.getElementById(\"emailInput\").value;\n\n    if(!e){ alert(\"Enter email\"); return; }\n\n    document.cookie = \"shopify_email=\" + e + \"; path=\/; max-age=31536000\";\n\n    email = e;\n\n    loadOrders();\n}\n\n\/\/ ========================\n\/\/ \u52a0\u8f7d\u8ba2\u5355\n\/\/ ========================\nasync function loadOrders(){\n\n    const res = await fetch(\n        \"https:\/\/shopify-order-worker.fefkxmk29364.workers.dev\/api\/orders?email=\" + email\n    );\n\n    const data = await res.json();\n\n    let html = `\n    <div class=\"shop-orders-wrap\">\n        <h2>My Orders<\/h2>\n        <p>${email}<\/p>\n        <button onclick=\"switchEmail()\">Switch Email<\/button>\n    `;\n\n    if(!data.orders.length){\n        html += \"<p>No orders found<\/p>\";\n    }\n\n    data.orders.forEach(o => {\n        html += `\n        <div class=\"shop-order-card\">\n            <h3>Order #${o.shopify_order_id}<\/h3>\n            <p>Total: $${o.total_price}<\/p>\n            <p>Date: ${o.created_at}<\/p>\n        <\/div>`;\n    });\n\n    html += \"<\/div>\";\n\n    document.getElementById(\"shopify-app\").innerHTML = html;\n}\n\n\/\/ ========================\n\/\/ \u5207\u6362\u90ae\u7bb1\n\/\/ ========================\nfunction switchEmail(){\n    document.cookie = \"shopify_email=; path=\/; max-age=0\";\n    email = \"\";\n    renderLogin();\n}\n\n\/\/ ========================\n\/\/ \u521d\u59cb\u5316\n\/\/ ========================\nif(email){\n    loadOrders();\n}else{\n    renderLogin();\n}\n\n<\/script>\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-73","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=\/wp\/v2\/pages\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=73"}],"version-history":[{"count":1,"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=\/wp\/v2\/pages\/73\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=\/wp\/v2\/pages\/73\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/www.plexadermlife.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}