{"id":309,"date":"2026-05-16T23:52:05","date_gmt":"2026-05-16T23:52:05","guid":{"rendered":"https:\/\/demo.webinwp.com\/themearab\/?page_id=309"},"modified":"2026-05-16T23:52:24","modified_gmt":"2026-05-16T23:52:24","slug":"cart","status":"publish","type":"page","link":"https:\/\/demo.webinwp.com\/themearab\/cart\/","title":{"rendered":"cart"},"content":{"rendered":"<div id=\"wcod-cart-1\" style=\"font-family:'Inter',sans-serif;max-width:860px;margin:0 auto;\">\n\n    <!-- Empty State (shown until JS evaluates cart) -->\n    <div id=\"wcod-cart-1-empty\" style=\"display:none;text-align:center;padding:60px 20px;\">\n        <svg width=\"64\" height=\"64\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#d1d5db\" stroke-width=\"1.2\" style=\"margin-bottom:16px;\"><circle cx=\"9\" cy=\"21\" r=\"1\"\/><circle cx=\"20\" cy=\"21\" r=\"1\"\/><path d=\"M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6\"\/><\/svg>\n        <p style=\"font-size:18px;font-weight:700;color:#374151;margin:0 0 8px;\">\u0639\u0631\u0628\u062a\u0643 \u0641\u0627\u0631\u063a\u0629<\/p>\n        <p style=\"font-size:14px;color:#9ca3af;margin:0 0 20px;\">\u062a\u0635\u0641\u062d \u0645\u0646\u062a\u062c\u0627\u062a\u0646\u0627 \u0648\u0623\u0636\u0641 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0644\u0644\u0628\u062f\u0621.<\/p>\n        <a href=\"https:\/\/demo.webinwp.com\/themearab\/\"\n           style=\"display:inline-flex;align-items:center;gap:8px;padding:12px 24px;background:#510b49;color:#ffffff;border-radius:8px;font-size:14px;font-weight:700;text-decoration:none;\">\n            \u0645\u0648\u0627\u0635\u0644\u0629 \u0627\u0644\u062a\u0633\u0648\u0642        <\/a>\n    <\/div>\n\n    <!-- Cart Content -->\n    <div id=\"wcod-cart-1-content\" style=\"display:none;\">\n\n        <h2 style=\"font-size:22px;font-weight:800;color:#111827;margin:0 0 20px;\">\u0639\u0631\u0628\u0629 \u0627\u0644\u062a\u0633\u0648\u0642            <span id=\"wcod-cart-1-count\" style=\"font-size:15px;font-weight:600;color:#9ca3af;margin-left:8px;\"><\/span>\n        <\/h2>\n\n        <div style=\"display:grid;grid-template-columns:1fr 320px;gap:24px;align-items:start;\">\n\n            <!-- Items Table -->\n            <div style=\"background:#fff;border-radius:12px;box-shadow:0 1px 8px rgba(0,0,0,.07);overflow:hidden;\">\n                <div id=\"wcod-cart-1-items\"><\/div>\n            <\/div>\n\n            <!-- Order Summary -->\n            <div style=\"background:#fff;border-radius:12px;box-shadow:0 1px 8px rgba(0,0,0,.07);padding:24px;position:sticky;top:80px;\">\n                <h3 style=\"font-size:15px;font-weight:700;color:#111827;margin:0 0 16px;\">\u0645\u0644\u062e\u0635 \u0627\u0644\u0637\u0644\u0628<\/h3>\n                <div style=\"display:flex;justify-content:space-between;font-size:14px;color:#6b7280;margin-bottom:10px;\">\n                    <span>\u0627\u0644\u0645\u062c\u0645\u0648\u0639 \u0627\u0644\u0641\u0631\u0639\u064a<\/span>\n                    <span id=\"wcod-cart-1-subtotal\">\u2014<\/span>\n                <\/div>\n                <div style=\"display:flex;justify-content:space-between;font-size:14px;color:#6b7280;margin-bottom:10px;\">\n                    <span>\u0627\u0644\u0634\u062d\u0646<\/span>\n                    <span style=\"color:#10b981;font-weight:600;\">\u064a\u064f\u062d\u0633\u0628 \u0639\u0646\u062f \u0627\u0644\u062f\u0641\u0639<\/span>\n                <\/div>\n                <div style=\"border-top:1px solid #f3f4f6;padding-top:12px;margin-top:4px;display:flex;justify-content:space-between;font-size:17px;font-weight:800;color:#111827;\">\n                    <span>\u0627\u0644\u0625\u062c\u0645\u0627\u0644\u064a<\/span>\n                    <span id=\"wcod-cart-1-total\" style=\"color:#510b49;\"><\/span>\n                <\/div>\n\n                                <a href=\"https:\/\/demo.webinwp.com\/themearab\/checkout\/\"\n                   style=\"display:flex;align-items:center;justify-content:center;gap:8px;margin-top:20px;padding:14px;background:#510b49;color:#ffffff;border-radius:8px;font-size:15px;font-weight:700;text-decoration:none;transition:opacity .15s;\"\n                   onmouseover=\"this.style.opacity='.88'\" onmouseout=\"this.style.opacity='1'\">\n                    <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\"><path d=\"M5 12h14\"\/><path d=\"M12 5l7 7-7 7\"\/><\/svg>\n                    \u0625\u062a\u0645\u0627\u0645 \u0627\u0644\u0634\u0631\u0627\u0621                <\/a>\n                \n                <a href=\"https:\/\/demo.webinwp.com\/themearab\/\"\n                   style=\"display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;font-size:13px;color:#510b49;text-decoration:none;\">\n                    <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\"><polyline points=\"15 18 9 12 15 6\"\/><\/svg>\n                    \u0645\u0648\u0627\u0635\u0644\u0629 \u0627\u0644\u062a\u0633\u0648\u0642                <\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<script>\n(function(){\n    var uid      = 'wcod-cart-1';\n    var primary  = '#510b49';\n    var radius   = 8;\n    var currency = '\u062f.\u0645';\n    var curPos   = 'before';\n\n    function fmt(v) { v = parseFloat(v).toFixed(2); return curPos === 'before' ? currency + v : v + currency; }\n    function getCart()   { try { return JSON.parse(localStorage.getItem('wcod_cart') || '[]'); } catch(e){ return []; } }\n    function saveCart(c) { localStorage.setItem('wcod_cart', JSON.stringify(c)); window.dispatchEvent(new Event('wcod_cart_updated')); render(); }\n\n    function render() {\n        var cart    = getCart();\n        var empty   = document.getElementById(uid + '-empty');\n        var content = document.getElementById(uid + '-content');\n        var itemsEl = document.getElementById(uid + '-items');\n        var countEl = document.getElementById(uid + '-count');\n\n        if (!cart.length) {\n            if (empty)   empty.style.display   = 'block';\n            if (content) content.style.display = 'none';\n            return;\n        }\n        if (empty)   empty.style.display   = 'none';\n        if (content) content.style.display = 'block';\n\n        var total = 0;\n        var count = 0;\n        var rows  = '';\n\n        cart.forEach(function(item, idx) {\n            var lineTotal = parseFloat(item.price) * parseInt(item.qty || 1);\n            total += lineTotal;\n            count += parseInt(item.qty || 1);\n\n            var attrsHtml = '';\n            if (item.attrs && Object.keys(item.attrs).length) {\n                Object.keys(item.attrs).forEach(function(k){ attrsHtml += '<span style=\"display:inline-block;background:#f3f4f6;border-radius:4px;padding:1px 6px;font-size:11px;color:#6b7280;margin-right:4px;\">' + escHtml(k.replace('attr_','').replace(\/_\/g,' ')) + ': ' + escHtml(item.attrs[k]) + '<\/span>'; });\n            }\n\n            rows += '<div style=\"display:grid;grid-template-columns:60px 1fr auto auto;gap:12px;align-items:center;padding:14px 16px;border-bottom:1px solid #f3f4f6;\">'\n                  + '<div style=\"width:60px;height:60px;border-radius:' + radius + 'px;overflow:hidden;background:#f3f4f6;flex-shrink:0;\">'\n                  + (item.image ? '<img decoding=\"async\" src=\"' + escHtml(item.image) + '\" style=\"width:100%;height:100%;object-fit:cover;\" \/>' : '<svg width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#d1d5db\" stroke-width=\"1.2\" style=\"margin:14px\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"\/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\"\/><polyline points=\"21 15 16 10 5 21\"\/><\/svg>')\n                  + '<\/div>'\n                  + '<div><div style=\"font-size:14px;font-weight:700;color:#111827;margin-bottom:4px;\">' + escHtml(item.title) + '<\/div>' + attrsHtml + '<\/div>'\n                  + '<div style=\"display:flex;align-items:center;border:1px solid #e5e7eb;border-radius:' + radius + 'px;overflow:hidden;\">'\n                  + '<button onclick=\"wcod_cart_adj(' + idx + ',-1)\" style=\"width:32px;height:32px;border:none;background:#f9fafb;cursor:pointer;font-size:16px;font-weight:700;color:#374151;\">&#8722;<\/button>'\n                  + '<span style=\"width:36px;text-align:center;font-size:14px;font-weight:700;\">' + parseInt(item.qty||1) + '<\/span>'\n                  + '<button onclick=\"wcod_cart_adj(' + idx + ',1)\" style=\"width:32px;height:32px;border:none;background:#f9fafb;cursor:pointer;font-size:16px;font-weight:700;color:#374151;\">+<\/button>'\n                  + '<\/div>'\n                  + '<div style=\"text-align:right;\">'\n                  + '<div style=\"font-size:15px;font-weight:800;color:' + primary + ';\">' + fmt(lineTotal) + '<\/div>'\n                  + '<button onclick=\"wcod_cart_remove(' + idx + ')\" style=\"background:none;border:none;color:#ef4444;font-size:12px;cursor:pointer;padding:4px 0;font-weight:600;\">\u0625\u0632\u0627\u0644\u0629<\/button>'\n                  + '<\/div>'\n                  + '<\/div>';\n        });\n\n        if (itemsEl) itemsEl.innerHTML = rows;\n        if (countEl) countEl.textContent = '(' + count + ' \u0639\u0646\u0627\u0635\u0631)';\n        var sub = document.getElementById(uid + '-subtotal');\n        var tot = document.getElementById(uid + '-total');\n        if (sub) sub.textContent = fmt(total);\n        if (tot) tot.textContent = fmt(total);\n    }\n\n    function escHtml(s){ var d=document.createElement('div'); d.appendChild(document.createTextNode(String(s||''))); return d.innerHTML; }\n\n    window.wcod_cart_adj = function(idx, dir) {\n        var cart = getCart();\n        if (!cart[idx]) return;\n        cart[idx].qty = Math.max(1, parseInt(cart[idx].qty || 1) + dir);\n        saveCart(cart);\n    };\n    window.wcod_cart_remove = function(idx) {\n        var cart = getCart();\n        cart.splice(idx, 1);\n        saveCart(cart);\n    };\n\n    render();\n    window.addEventListener('wcod_cart_updated', render);\n})();\n<\/script>\n\n<style>\n@media (max-width: 640px) {\n    #wcod-cart-1-content > div { grid-template-columns: 1fr !important; }\n    #wcod-cart-1-content > div > div:last-child { position: static !important; }\n}\n<\/style>\n\n\n\n\n<p class=\"wp-block-paragraph\"><\/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":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"class_list":["post-309","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/pages\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/comments?post=309"}],"version-history":[{"count":2,"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/pages\/309\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/pages\/309\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/demo.webinwp.com\/themearab\/wp-json\/wp\/v2\/media?parent=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}