{"id":11448,"date":"2025-02-10T05:25:10","date_gmt":"2025-02-09T21:25:10","guid":{"rendered":"https:\/\/www.sci.com.tw\/%e8%af%b7%e6%b1%82%e6%8a%a5%e4%bb%b7\/"},"modified":"2025-08-27T10:31:47","modified_gmt":"2025-08-27T02:31:47","slug":"request-quote","status":"publish","type":"page","link":"https:\/\/www.sci.com.tw\/zh-hans\/request-quote\/","title":{"rendered":"\u8bf7\u6c42\u62a5\u4ef7"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"11448\" class=\"elementor elementor-11448 elementor-228\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"wd-negative-gap elementor-element elementor-element-d0ab793 e-flex e-con-boxed e-con e-parent\" data-id=\"d0ab793\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-722ada6b color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"722ada6b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\n<div class=\"woocommerce ywraq-wrapper ywraq-empty\">\n\t\t\t<div id=\"yith-ywraq-message\"><div class=\"ywraq-question-message\">\n\t<\/div>\n<\/div>\n\t\t\n\t\t\t\t<div class=\"ywraq-form-table-wrapper vertical\">\n\t\t\t<div class=\"ywraq-before-form\">\n\t<p class=\"ywraq_list_empty_message\">\u60a8\u7684\u5217\u8868\u70ba\u7a7a\uff0c\u8acb\u6dfb\u52a0\u7522\u54c1\u4ee5\u767c\u9001\u8a62\u554f<p><p class=\"return-to-shop\"><a class=\"button wc-backward\" href=\"https:\/\/www.sci.com.tw\/product\/\">\u8fd4\u56de\u7522\u54c1\u9801<\/a><\/p><\/div>\n\t\t\t\t\t<\/div>\n\t<\/div>\n<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1fa1b12 elementor-widget elementor-widget-html\" data-id=\"1fa1b12\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", async function () {\n  try {\n    const raw = sessionStorage.getItem(\"sci_rq_ids\");\n    const ids = JSON.parse(raw || \"[]\");\n\n    if (!Array.isArray(ids) || ids.length === 0) return;\n\n    const items = ids.map(id => ({ id, qty: 1 }));\n\n    \/\/ \u547c\u53eb API \u52a0\u5165\u8a62\u50f9\u55ae\uff08\u4f60\u539f\u672c\u5df2\u6709\u8a2d\u8a08\uff09\n    const res = await fetch(\"\/wp-json\/sci\/v1\/add-to-quote\", {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application\/json\"\n      },\n      body: JSON.stringify({ items })\n    });\n\n    const result = await res.json();\n\n    if (res.ok && result.success) {\n      alert(`\u2705 \u6210\u529f\u52a0\u5165\u8a62\u50f9\uff0c\u5171 ${result.added} \u9805\u5546\u54c1\uff01`);\n      sessionStorage.removeItem(\"sci_rq_ids\"); \/\/ \u6e05\u9664 sessionStorage\n      location.reload(); \/\/ \u91cd\u65b0\u6574\u7406\u9801\u9762\u986f\u793a\u7d50\u679c\n    } else {\n      console.error(result);\n      alert(\"\u274c \u52a0\u5165\u8a62\u50f9\u5931\u6557\uff1a\" + (result.message || \"\u672a\u77e5\u932f\u8aa4\"));\n    }\n  } catch (err) {\n    console.error(err);\n    alert(\"\u274c \u8acb\u6c42\u932f\u8aa4\uff0c\u7121\u6cd5\u52a0\u5165\u8a62\u50f9\");\n  }\n});\n<\/script>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7821882 elementor-widget elementor-widget-html\" data-id=\"7821882\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n  const quoteItems = [...document.querySelectorAll('.yith-ywraq-list table tbody tr')];\n  const output = [];\n\n  if (quoteItems.length > 0) {\n    output.push('<table border=\"1\" cellpadding=\"6\" cellspacing=\"0\" style=\"border-collapse:collapse;width:100%;font-family:Arial,sans-serif;font-size:14px;\">');\n    output.push('<tr style=\"background:#f3f3f3;\"><th>\u5716\u7247<\/th><th>\u5546\u54c1\u540d\u7a31<\/th><th>\u5546\u54c1\u6578\u91cf<\/th><\/tr>');\n\n    quoteItems.forEach(row => {\n      const img = row.querySelector('img')?.src || '';\n      const name = row.querySelector('.product-name, td.product-name')?.textContent.trim() || '';\n      const qty = row.querySelector('input[type=\"number\"]')?.value || '1';\n\n      output.push(`<tr>\n        <td><img decoding=\"async\" src=\"${img}\" width=\"80\" height=\"80\" style=\"object-fit:cover;\" \/><\/td>\n        <td>${name}<\/td>\n        <td>${qty}<\/td>\n      <\/tr>`);\n    });\n\n    output.push('<\/table>');\n  }\n\n  const hiddenInput = document.getElementById('quote_items');\n  if (hiddenInput) hiddenInput.value = output.join('');\n});\n<\/script>\n\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<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":6,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-11448","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/pages\/11448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/comments?post=11448"}],"version-history":[{"count":1,"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/pages\/11448\/revisions"}],"predecessor-version":[{"id":11449,"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/pages\/11448\/revisions\/11449"}],"wp:attachment":[{"href":"https:\/\/www.sci.com.tw\/zh-hans\/wp-json\/wp\/v2\/media?parent=11448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}