{"id":3586,"date":"2026-10-29T22:46:17","date_gmt":"2026-10-29T22:46:17","guid":{"rendered":"https:\/\/byzzenzz.com\/?page_id=3586"},"modified":"2026-10-29T22:46:57","modified_gmt":"2026-10-29T22:46:57","slug":"atlasiax","status":"publish","type":"page","link":"https:\/\/byzzenzz.com\/index.php\/atlasiax\/","title":{"rendered":"atlasiax"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"3586\" class=\"elementor elementor-3586\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-03ec64e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"03ec64e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ed1b2d6\" data-id=\"ed1b2d6\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3f5cc89 elementor-widget elementor-widget-shortcode\" data-id=\"3f5cc89\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><div class=\"atx\">\n<style>\n.atx{max-width:720px;margin:0 auto;font-family:inherit}\n.atx .c{border:1px solid #e4dfd8;border-radius:12px;padding:16px;margin-bottom:14px;background:#fff}\n.atx h3{font-size:13px;letter-spacing:.05em;text-transform:uppercase;color:#777;margin:0 0 10px}\n.atx label{display:block;font-size:13px;font-weight:600;margin:8px 0 4px}\n.atx input,.atx select{width:100%;padding:9px 10px;border:1px solid #ddd;border-radius:8px;box-sizing:border-box}\n.atx .g{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}\n.atx button{background:#c8281f;color:#fff;border:0;border-radius:10px;padding:12px 18px;font-weight:700;cursor:pointer;width:100%;font-size:16px}\n.atx button.s{background:#eee;color:#222;width:auto;font-size:14px}\n.atx button:disabled{opacity:.5}\n.atx .calc{font-size:13px;color:#666;margin-top:10px}\n.atx .err{color:#b3261e;font-size:13px;margin-top:8px}.atx .ok{color:#1f7a4d;font-size:13px;margin-top:8px}\n.atx .big{font-size:32px;font-weight:800}.atx .big small{font-size:15px;color:#777}\n.atx table{width:100%;border-collapse:collapse;font-size:14px}.atx td{padding:6px 0;border-bottom:1px solid #eee}.atx td+td{text-align:right}\n.atx pre{background:#1d1b19;color:#eee;padding:10px;border-radius:8px;font-size:12px;overflow:auto;max-height:300px}\n<\/style>\n\n\t<div class=\"c err\"><strong>ATLASIAX connection failed:<\/strong> HTTP 0 \u2014 cURL error 6: Could not resolve host: emnavevxdxshzygifsal.supabase.co<br>Check ATLASIAX_KEY in the snippet (format client_id:secret).<\/div>\n\n<div class=\"c\"><h3>Route<\/h3>\n\t<div class=\"g\">\n\t\t<div><label>Ship from<\/label><select id=\"atx-wh\">\n\t\t\t\t\t<\/select><\/div>\n\t\t<div><label>Destination<\/label><select id=\"atx-dest\">\n\t\t\t\t\t\t\t<option value=\"\u00c9tats-Unis\" data-iso=\"US\" data-en=\"United States\">\u00c9tats-Unis (USA)<\/option>\n\t\t\t\t\t<\/select><\/div>\n\t<\/div>\n<\/div>\n\n<div class=\"c\"><h3>Product<\/h3>\n\t<div class=\"g\">\n\t\t<div><label>Product name<\/label><input id=\"atx-name\" placeholder=\"Copper mug\"><\/div>\n\t\t<div><label>SKU (optional)<\/label><input id=\"atx-sku\"><\/div>\n\t<\/div>\n\t<div class=\"g\">\n\t\t<div><label>Quantity<\/label><input id=\"atx-qty\" type=\"number\" min=\"1\" value=\"1\"><\/div>\n\t\t<div><label>Weight \/ unit<\/label><input id=\"atx-wt\" type=\"number\" step=\"0.01\" min=\"0\" placeholder=\"0.40\"><\/div>\n\t\t<div><label>Unit<\/label><select id=\"atx-u\"><option value=\"kg\">kg<\/option><option value=\"lb\">lb<\/option><\/select><\/div>\n\t<\/div>\n\t<div class=\"g\">\n\t\t<div><label>Length cm<\/label><input id=\"atx-L\" type=\"number\" min=\"0\"><\/div>\n\t\t<div><label>Width cm<\/label><input id=\"atx-W\" type=\"number\" min=\"0\"><\/div>\n\t\t<div><label>Height cm<\/label><input id=\"atx-H\" type=\"number\" min=\"0\"><\/div>\n\t<\/div>\n\t<div class=\"g\">\n\t\t<div><label>Value \/ unit (USD)<\/label><input id=\"atx-val\" type=\"number\" step=\"0.01\" min=\"0\" placeholder=\"25\"><\/div>\n\t\t<div><label>HS code (optional)<\/label><input id=\"atx-hs\"><\/div>\n\t\t<div><label>1 USD = MAD<\/label><input id=\"atx-rate\" type=\"number\" step=\"0.01\" value=\"10\"><\/div>\n\t<\/div>\n\t<div class=\"calc\" id=\"atx-calc\"><\/div>\n<\/div>\n\n<button id=\"atx-go\">Get shipping price<\/button>\n<div id=\"atx-msg\"><\/div>\n\n<div class=\"c\" id=\"atx-res\" style=\"display:none;margin-top:14px\"><h3>Quote<\/h3>\n\t<div class=\"big\" id=\"atx-total\"><\/div><div class=\"calc\" id=\"atx-per\"><\/div>\n\t<table id=\"atx-tbl\"><\/table>\n\t\t<details><summary>Raw response<\/summary><pre id=\"atx-raw\"><\/pre><\/details>\n<\/div>\n\n<script>\n(function(){\n\tconst AJAX = \"https:\\\/\\\/byzzenzz.com\\\/wp-admin\\\/admin-ajax.php\", NONCE = \"8c961aa3ed\";\n\tconst $ = id => document.getElementById('atx-' + id);\n\tlet last = null;\n\tfunction calc(){\n\t\tconst q = Math.max(1, +$('qty').value || 1), lb = $('u').value === 'lb';\n\t\tconst wu = (+$('wt').value || 0) * (lb ? 0.453592 : 1), w = wu * q;\n\t\tconst vol = (+$('L').value||0) * (+$('W').value||0) * (+$('H').value||0) \/ 5000;\n\t\tconst bill = Math.max(w, vol), val = (+$('val').value || 0) * q;\n\t\t$('calc').textContent = `Real ${w.toFixed(2)} kg \u00b7 Volumetric ${vol.toFixed(2)} kg \u00b7 Billable ${bill.toFixed(2)} kg \u00b7 Value $${val.toFixed(2)}`;\n\t\treturn {q, wu, bill, val};\n\t}\n\tasync function post(action, data){\n\t\tconst fd = new FormData(); fd.append('action', action); fd.append('nonce', NONCE);\n\t\tfor (const k in data) fd.append(k, data[k]);\n\t\tconst r = await fetch(AJAX, {method:'POST', body:fd, credentials:'same-origin'});\n\t\treturn r.json();\n\t}\n\tconst fmt = n => Number(n).toLocaleString(undefined,{minimumFractionDigits:2,maximumFractionDigits:2});\n\tfunction flat(o, p = '', out = []){\n\t\tfor (const [k,v] of Object.entries(o || {})){\n\t\t\tconst key = p ? p + ' \u203a ' + k : k;\n\t\t\tif (v && typeof v === 'object' && !Array.isArray(v)) flat(v, key, out);\n\t\t\telse if (v !== null && typeof v !== 'object') out.push([key, v]);\n\t\t}\n\t\treturn out;\n\t}\n\tfunction render(){\n\t\tif (!last) return;\n\t\tconst c = calc(), d = last.data ?? last, cur = d.currency || 'MAD', rate = +$('rate').value || 10;\n\t\tconst k = ['total_mad','total','total_price','price_mad','price','selling_price','shipping_cost_mad','amount'].find(k => typeof d[k] === 'number');\n\t\t$('res').style.display = '';\n\t\tif (k){\n\t\t\tconst usd = cur === 'USD' ? d[k] : d[k] \/ rate;\n\t\t\t$('total').innerHTML = `${fmt(d[k])} ${cur} <small>\u2248 $${fmt(usd)}<\/small>`;\n\t\t\t$('per').textContent = c.q > 1 ? `\u2248 $${fmt(usd \/ c.q)} per unit \u00b7 ${c.bill.toFixed(2)} kg billable` : `${c.bill.toFixed(2)} kg billable`;\n\t\t} else { $('total').textContent = 'See breakdown'; $('per').textContent = ''; }\n\t\t$('tbl').innerHTML = flat(d).map(([a,b]) => `<tr><td>${String(a).replace(\/_\/g,' ')}<\/td><td>${typeof b === 'number' ? fmt(b) : b}<\/td><\/tr>`).join('');\n\t\t$('raw').textContent = JSON.stringify(last, null, 2);\n\t}\n\t['qty','wt','u','L','W','H','val'].forEach(id => $(id).addEventListener('input', calc));\n\t$('rate').addEventListener('input', render);\n\t$('go').onclick = async () => {\n\t\tconst c = calc(), o = $('dest').selectedOptions[0];\n\t\tif (!c.bill){ $('msg').className = 'err'; $('msg').textContent = 'Enter a weight.'; return; }\n\t\t$('go').disabled = true; $('msg').className = ''; $('msg').textContent = 'Getting price\u2026';\n\t\ttry {\n\t\t\tconst r = await post('atlasiax_quote', {warehouse_id: $('wh').value, dest: o.value, dest_iso: o.dataset.iso || '', dest_en: o.dataset.en || '', weight_kg: c.bill, value_usd: c.val});\n\t\t\tif (r.success){ last = r.data; $('msg').textContent = ''; render(); }\n\t\t\telse { $('msg').className = 'err'; $('msg').textContent = r.data?.message || 'Error'; if (r.data?.raw){ $('res').style.display = ''; $('raw').textContent = JSON.stringify(r.data.raw, null, 2); } }\n\t\t} catch(e){ $('msg').className = 'err'; $('msg').textContent = e.message; }\n\t\t$('go').disabled = false;\n\t};\n\tif ($('save')) $('save').onclick = async () => {\n\t\tconst c = calc(); $('save').disabled = true; $('smsg').textContent = 'Saving\u2026';\n\t\tconst r = await post('atlasiax_save_product', {name: $('name').value, sku: $('sku').value, hs: $('hs').value, value_usd_unit: +$('val').value || 0, weight_unit_kg: c.wu, L: $('L').value, W: $('W').value, H: $('H').value});\n\t\t$('smsg').className = r.success ? 'ok' : 'err';\n\t\t$('smsg').textContent = r.success ? 'Saved \u2713 \u2014 ' + (r.data?.data?.approval_status || 'pending') : (r.data?.message || 'Error');\n\t\t$('save').disabled = false;\n\t};\n\tcalc();\n})();\n<\/script>\n<\/div>\n\t<\/div>\n\t\t\t\t\t\t<\/div>\n\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":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3586","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/pages\/3586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/comments?post=3586"}],"version-history":[{"count":4,"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/pages\/3586\/revisions"}],"predecessor-version":[{"id":3591,"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/pages\/3586\/revisions\/3591"}],"wp:attachment":[{"href":"https:\/\/byzzenzz.com\/index.php\/wp-json\/wp\/v2\/media?parent=3586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}