{"id":272,"date":"2026-06-16T13:52:14","date_gmt":"2026-06-16T13:52:14","guid":{"rendered":"https:\/\/thesteynswedding.co.za\/?page_id=272"},"modified":"2026-06-28T16:08:58","modified_gmt":"2026-06-28T16:08:58","slug":"registry","status":"publish","type":"page","link":"https:\/\/thesteynswedding.co.za\/index.php\/registry\/","title":{"rendered":"Registry"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"272\" class=\"elementor elementor-272\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2a35d8d2 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"2a35d8d2\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t\t<div class=\"elementor-background-overlay\"><\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-no\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6de05530\" data-id=\"6de05530\" data-element_type=\"column\" data-e-type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t<div class=\"elementor-background-overlay\"><\/div>\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2b3f331e elementor-widget elementor-widget-heading\" data-id=\"2b3f331e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-default\">Registry<\/h1>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t<div class=\"elementor-element elementor-element-8148934 e-flex e-con-boxed e-con e-parent\" data-id=\"8148934\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-a9348f6 e-con-full e-flex e-con e-child\" data-id=\"a9348f6\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b1c32f1 elementor-widget elementor-widget-jkit_heading\" data-id=\"b1c32f1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"jkit_heading.default\">\n\t\t\t\t\t<div  class=\"jeg-elementor-kit jkit-heading  align-center align-tablet- align-mobile- jeg_module___6a43bfc1e0df3\" ><h5 class=\"heading-section-subtitle  style-color\">Registry<\/h5><div class=\"heading-section-title  display-inline-block\"><h2 class=\"heading-title\">Registry &amp; Gifts<\/h2><\/div><div class=\"heading-section-description\"><p class=\"isSelectedEnd\">Should you wish to send a gift, kindly have it delivered to:<\/p><p>67 Integra Drive, Breaunanda, Krugersdorp<\/p><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-7b9f9d4 e-con-full e-flex e-con e-child\" data-id=\"7b9f9d4\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-70586f2 elementor-widget elementor-widget-html\" data-id=\"70586f2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div class=\"registry-container\">\n    <div id=\"registry-items\"><\/div>\n\n<\/div>\n\n<style>\n    .registry-container{\n    max-width:1200px;\n    \n    margin:0 auto;\n    padding:20px;\n}\n\n.registry-grid{\n    display:grid;\n    grid-template-columns:repeat(auto-fill,minmax(300px,1fr));\n    gap:20px;\n}\n\n.registry-item{\n    border:1px solid #ddd;\n    border-radius:10px;\n    padding:20px;\n    background:#fff;\n}\n\n.registry-item h3{\n    margin-top:0;\n}\n\n.registry-item a{\n    display:inline-block;\n    margin-bottom:15px;\n}\n\n.registry-btn{\n    padding:10px 20px;\n    margin-top: 10px;\n    border:none;\n    cursor:pointer;\n    border-radius:5px;\n}\n\n.registry-btn:hover{\n    opacity:0.9;\n}\n\n.registry-status{\n    margin-top:10px;\n    font-weight:bold;\n}\n\n.progress-bar{\n    width:100%;\n    height:12px;\n    background:#eee;\n    border-radius:20px;\n    overflow:hidden;\n    margin-top:10px;\n}\n\n.progress-fill{\n    height:100%;\n    background:#4caf50;\n}\n<\/style>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8b1891f elementor-widget elementor-widget-html\" data-id=\"8b1891f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\r\n\r\nconst registryURL = '\/registry\/registry.json';\r\n\r\nloadRegistry();\r\n\r\nfunction loadRegistry(){\r\n\r\n    fetch(registryURL)\r\n    .then(response => response.json())\r\n    .then(items => {\r\n\r\n        let html = '<div class=\"registry-grid\">';\r\n\r\n        items.forEach(item => {\r\n\r\n            html += `\r\n                <div class=\"registry-item\">\r\n\r\n                    <h3>${item.name}<\/h3>\r\n\r\n                    <p>\r\n                        <a href=\"${item.url}\" target=\"_blank\">\r\n                            View Product\r\n                        <\/a>\r\n                    <\/p>\r\n            `;\r\n\r\n            \/*\r\n            -------------------------------------\r\n            SINGLE ITEM\r\n            -------------------------------------\r\n            *\/\r\n\r\n            if(item.type === 'single'){\r\n\r\n                if(item.claimed){\r\n\r\n                    let claimedBy = '';\r\n\r\n                    if(item.claimed_by && item.claimed_by.name){\r\n                        claimedBy = item.claimed_by.name;\r\n                    }\r\n\r\n                    html += `\r\n                        <div class=\"registry-status\">\r\n                            Reserved ${claimedBy ? 'by '+claimedBy : ''}\r\n                        <\/div>\r\n                    `;\r\n\r\n                }else{\r\n\r\n                    html += `\r\n                        <button\r\n                            class=\"registry-btn\"\r\n                            onclick=\"claimGift(${item.id})\"\r\n                        >\r\n                            Reserve Gift\r\n                        <\/button>\r\n                    `;\r\n                }\r\n            }\r\n\r\n            \/*\r\n            -------------------------------------\r\n            QUANTITY ITEM\r\n            -------------------------------------\r\n            *\/\r\n\r\n            if(item.type === 'quantity'){\r\n\r\n                const percent =\r\n                    (item.claimed \/ item.required) * 100;\r\n\r\n                html += `\r\n                    <p>\r\n                        ${item.claimed} of ${item.required} claimed\r\n                    <\/p>\r\n\r\n                    <div class=\"progress-bar\">\r\n                        <div\r\n                            class=\"progress-fill\"\r\n                            style=\"width:${percent}%\"\r\n                        ><\/div>\r\n                    <\/div>\r\n                `;\r\n\r\n                if(item.claimed < item.required){\r\n\r\n                    html += `\r\n                        <button\r\n                            class=\"registry-btn\"\r\n                            onclick=\"claimGift(${item.id})\"\r\n                        >\r\n                            Claim One\r\n                        <\/button>\r\n                    `;\r\n                }else{\r\n\r\n                    html += `\r\n                        <div class=\"registry-status\">\r\n                            Fully Claimed\r\n                        <\/div>\r\n                    `;\r\n                }\r\n            }\r\n\r\n            \/*\r\n            -------------------------------------\r\n            CONTRIBUTION ITEM\r\n            -------------------------------------\r\n            *\/\r\n\r\n            if(item.type === 'contribution'){\r\n\r\n                const percent =\r\n                    (item.raised \/ item.target) * 100;\r\n\r\n                html += `\r\n                    <p>\r\n                        Raised R${item.raised}\r\n                        of R${item.target}\r\n                    <\/p>\r\n\r\n                    <div class=\"progress-bar\">\r\n                        <div\r\n                            class=\"progress-fill\"\r\n                            style=\"width:${percent}%\"\r\n                        ><\/div>\r\n                    <\/div>\r\n\r\n                    <button\r\n                        class=\"registry-btn\"\r\n                        onclick=\"contribute(${item.id})\"\r\n                    >\r\n                        Contribute\r\n                    <\/button>\r\n                `;\r\n            }\r\n\r\n            html += `\r\n                <\/div>\r\n            `;\r\n        });\r\n\r\n        html += '<\/div>';\r\n\r\n        document.getElementById('registry-items').innerHTML = html;\r\n    });\r\n}\r\n\r\n\/*\r\n-------------------------------------\r\nCLAIM GIFT\r\n-------------------------------------\r\n*\/\r\n\r\nfunction claimGift(itemId){\r\n\r\n    const name = prompt('Your Name');\r\n\r\n    if(!name) return;\r\n\r\n    const email = prompt('Your Email');\r\n\r\n    if(!email) return;\r\n\r\n    fetch('\/registry\/claim-gift.php',{\r\n\r\n        method:'POST',\r\n\r\n        headers:{\r\n            'Content-Type':'application\/json'\r\n        },\r\n\r\n        body:JSON.stringify({\r\n            item_id:itemId,\r\n            name:name,\r\n            email:email\r\n        })\r\n    })\r\n    .then(response => response.json())\r\n    .then(data => {\r\n\r\n        alert(data.message);\r\n\r\n        if(data.success){\r\n            loadRegistry();\r\n        }\r\n    });\r\n}\r\n\r\n\/*\r\n-------------------------------------\r\nCONTRIBUTE\r\n-------------------------------------\r\n*\/\r\n\r\nfunction contribute(itemId){\r\n\r\n    const name = prompt('Your Name');\r\n\r\n    if(!name) return;\r\n\r\n    const email = prompt('Your Email');\r\n\r\n    if(!email) return;\r\n\r\n    const amount = prompt('Contribution Amount');\r\n\r\n    if(!amount) return;\r\n\r\n    fetch('\/registry\/contribute.php',{\r\n\r\n        method:'POST',\r\n\r\n        headers:{\r\n            'Content-Type':'application\/json'\r\n        },\r\n\r\n        body:JSON.stringify({\r\n            item_id:itemId,\r\n            name:name,\r\n            email:email,\r\n            amount:amount\r\n        })\r\n    })\r\n    .then(response => response.json())\r\n    .then(data => {\r\n\r\n        alert(data.message);\r\n\r\n        if(data.success){\r\n            loadRegistry();\r\n        }\r\n    });\r\n}\r\n\r\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-71c3af12 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"71c3af12\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t\t<div class=\"elementor-background-overlay\"><\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-no\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-39583741\" data-id=\"39583741\" data-element_type=\"column\" data-e-type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t<div class=\"elementor-background-overlay\"><\/div>\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6f28769b elementor-widget elementor-widget-jkit_heading\" data-id=\"6f28769b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"jkit_heading.default\">\n\t\t\t\t\t<div  class=\"jeg-elementor-kit jkit-heading  align-center align-tablet- align-mobile- jeg_module__1_6a43bfc1e1a0c\" ><h5 class=\"heading-section-subtitle  style-color\">Save The Date<\/h5><div class=\"heading-section-title  display-inline-block\"><h2 class=\"heading-title\">We can&#039;t Wait to see you!<\/h2><\/div><div class=\"heading-section-description\">Please RSVP before feb 14th, Feb 2023. let us know if you coming<\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3e3aaf0d elementor-widget elementor-widget-jkit_button\" data-id=\"3e3aaf0d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"jkit_button.default\">\n\t\t\t\t\t<div  class=\"jeg-elementor-kit jkit-button  icon-position-before jeg_module__2_6a43bfc1e2fd1\" ><a href=\"https:\/\/thesteynswedding.co.za\/#rsvp\" class=\"jkit-button-wrapper\">RSVP<\/a><\/div>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Registry Registry Registry &amp; Gifts Should you wish to send a gift, kindly have it delivered to: 67 Integra Drive, Breaunanda, Krugersdorp Save The Date We can&#039;t Wait to see you! Please RSVP before feb 14th, Feb 2023. let us know if you coming RSVP<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-272","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/pages\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=272"}],"version-history":[{"count":34,"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/pages\/272\/revisions"}],"predecessor-version":[{"id":385,"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/pages\/272\/revisions\/385"}],"wp:attachment":[{"href":"https:\/\/thesteynswedding.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}