{"id":11502,"date":"2025-02-10T05:25:10","date_gmt":"2025-02-09T21:25:10","guid":{"rendered":"https:\/\/www.sci.com.tw\/%e3%81%8a%e8%a6%8b%e7%a9%8d%e3%82%82%e3%82%8a%e3%82%92%e3%83%aa%e3%82%af%e3%82%a8%e3%82%b9%e3%83%88%e3%81%99%e3%82%8b\/"},"modified":"2026-05-14T10:31:31","modified_gmt":"2026-05-14T02:31:31","slug":"request-quote","status":"publish","type":"page","link":"https:\/\/www.sci.com.tw\/ja\/request-quote\/","title":{"rendered":"\u304a\u898b\u7a4d\u308a\u306f\u3053\u3061\u3089"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"11502\" class=\"elementor elementor-11502 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\">\u30ea\u30b9\u30c8\u304c\u7a7a\u3067\u3059\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\u306b\u306f\u3001\u88fd\u54c1\u3092\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<p><p class=\"return-to-shop\"><a class=\"button wc-backward\" href=\"https:\/\/www.sci.com.tw\/product\/\">\u88fd\u54c1\u30da\u30fc\u30b8\u306b\u623b\u308b<\/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-5cf5dca elementor-widget elementor-widget-html\" data-id=\"5cf5dca\" 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>document.addEventListener(\"DOMContentLoaded\", function () {\r\n  const tiers = [\"500-1k\", \"1k~5k\", \"5k~10k\", \"10k~50k\", \"50k~100k\", \"100k Up\"];\r\n  const table = document.querySelector(\"#yith-ywraq-table-list\");\r\n  const overlay = document.getElementById(\"quote-loading-overlay\");\r\n\r\n  const showOverlay = () => { if (overlay) overlay.style.display = \"block\"; };\r\n  const hideOverlay = () => { if (overlay) overlay.style.display = \"none\"; };\r\n\r\n  function buildCustomSelect() {\r\n    const wrapper = document.createElement(\"div\");\r\n    wrapper.className = \"custom-select-wrapper\";\r\n\r\n    const trigger = document.createElement(\"div\");\r\n    trigger.className = \"custom-select-trigger custom-qty-select\";\r\n    trigger.textContent = \"Quantity\";\r\n    wrapper.appendChild(trigger);\r\n\r\n    const optionsList = document.createElement(\"ul\");\r\n    optionsList.className = \"custom-options\";\r\n    wrapper.appendChild(optionsList);\r\n\r\n    optionsList.style.backgroundColor = \"#333\";\r\n    optionsList.style.color = \"#fff\";\r\n\r\n    tiers.forEach(tier => {\r\n      const option = document.createElement(\"li\");\r\n      option.className = \"custom-option\";\r\n      option.dataset.value = tier;\r\n      option.textContent = tier;\r\n\r\n      option.style.backgroundColor = \"#333\";\r\n      option.style.color = \"#fff\";\r\n\r\n      optionsList.appendChild(option);\r\n    });\r\n\r\n    wrapper.addEventListener(\"click\", function (e) {\r\n      const row = wrapper.closest('tr');\r\n      if (e.target.closest(\".custom-select-trigger\")) {\r\n        document.querySelectorAll('.custom-select-wrapper.is-open').forEach(otherWrapper => {\r\n          if (otherWrapper !== wrapper) {\r\n            otherWrapper.querySelector('.custom-options').style.display = 'none';\r\n            otherWrapper.classList.remove('is-open');\r\n            otherWrapper.closest('tr').style.zIndex = 'auto';\r\n          }\r\n        });\r\n        \r\n        optionsList.style.display = (optionsList.style.display === \"block\") ? \"none\" : \"block\";\r\n        trigger.classList.toggle(\"is-open\");\r\n        \r\n        if (optionsList.style.display === \"block\") {\r\n          row.style.zIndex = '999';\r\n        } else {\r\n          row.style.zIndex = 'auto';\r\n        }\r\n\r\n      } else if (e.target.closest(\".custom-option\")) {\r\n        trigger.textContent = e.target.textContent;\r\n        optionsList.style.display = \"none\";\r\n        row.style.zIndex = 'auto';\r\n      }\r\n    });\r\n\r\n    document.addEventListener(\"click\", function (e) {\r\n      if (!wrapper.contains(e.target)) {\r\n        optionsList.style.display = \"none\";\r\n        trigger.classList.remove(\"is-open\");\r\n        wrapper.closest('tr').style.zIndex = 'auto';\r\n      }\r\n    });\r\n\r\n    return wrapper;\r\n  }\r\n\r\n  function ensureContainers() {\r\n    document.querySelectorAll(\"tr.cart_item\").forEach(row => {\r\n      if (!row.querySelector(\".custom-qty-container\")) {\r\n        const nameCell = row.querySelector(\"td.product-name\");\r\n        if (!nameCell) return;\r\n        const container = document.createElement(\"td\");\r\n        container.className = \"custom-qty-container\";\r\n        nameCell.insertAdjacentElement(\"afterend\", container);\r\n      }\r\n    });\r\n  }\r\n\r\n  function fillDropdowns() {\r\n    document.querySelectorAll(\".custom-qty-container\").forEach(c => {\r\n      if (!c.querySelector(\".custom-select-wrapper\")) {\r\n        c.appendChild(buildCustomSelect());\r\n      }\r\n    });\r\n  }\r\n\r\n  function initDropdowns() {\r\n    ensureContainers();\r\n    fillDropdowns();\r\n  }\r\n\r\n  if (table) {\r\n    table.style.position = \"relative\";\r\n    table.appendChild(overlay);\r\n\r\n    let lastRowCount = table.querySelectorAll(\"tr.cart_item\").length;\r\n\r\n    const observer = new MutationObserver(() => {\r\n      const rows = table.querySelectorAll(\"tr.cart_item\").length;\r\n\r\n      if (rows === 0 && lastRowCount > 0) {\r\n        showOverlay();\r\n      }\r\n      if (rows > 0 && overlay.style.display === \"block\") {\r\n        setTimeout(() => {\r\n          initDropdowns();\r\n          hideOverlay();\r\n        }, 700);\r\n      }\r\n\r\n      lastRowCount = rows;\r\n    });\r\n\r\n    observer.observe(table, { childList: true, subtree: true });\r\n  }\r\n\r\n  setInterval(initDropdowns, 3000);\r\n  initDropdowns();\r\n});\r\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3929505 elementor-widget elementor-widget-html\" data-id=\"3929505\" 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>document.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>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4fede94 elementor-widget elementor-widget-html\" data-id=\"4fede94\" 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>document.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\n      \/\/ \u9019\u88e1\u4fee\u6539\u70ba\u5f9e\u81ea\u5b9a\u7fa9\u4e0b\u62c9\u9078\u55ae\u4e2d\u7372\u53d6\u6578\u91cf\n      const customSelect = row.querySelector('.custom-select-trigger');\n      const qty = customSelect ? customSelect.textContent.trim() : 'Quantity';\n      \n      output.push(`<tr><td><img decoding=\"async\" src=\"${img}\" width=\"80\" height=\"80\" style=\"object-fit:cover;\" \/><\/td><td>${name}<\/td><td>${qty}<\/td><\/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>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-105cf4a elementor-widget elementor-widget-html\" data-id=\"105cf4a\" 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 src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.6.0\/jquery.min.js\"><\/script><script>jQuery(document).ready(function ($) {\r\n  function updateQuoteFormFields() {\r\n    var html = '';\r\n\r\n    $('tr.cart_item').each(function () {\r\n      var $row = $(this);\r\n\r\n      var name = $row.find('.product-name a').text().trim();\r\n      var url = $row.find('.product-name a').attr('href') || '#';\r\n      \/\/ \u9019\u88e1\u9032\u884c\u4fee\u6539\uff1a\u5f9e\u81ea\u8a02\u4e0b\u62c9\u9078\u55ae\u7684\u89f8\u767c\u5668\u8b80\u53d6\u6587\u5b57\u5167\u5bb9\r\n      var qty = $row.find('.custom-select-trigger').text().trim() || '-';\r\n      var imgEl = $row.find('.product-thumbnail img');\r\n      var img = imgEl.length > 0 ? (imgEl.attr('srcset') ? imgEl.attr('srcset').split(',')[0].split(' ')[0] : imgEl.attr('src')) : '';\r\n\r\n      html += `\r\n        <tr><td width=\"100\" valign=\"top\"><a href=\"${url}\"><img decoding=\"async\" src=\"${img}\" alt=\"${name}\" style=\"width:100px;height:auto;border:1px solid #ddd;\"><\/a><\/td><td valign=\"top\" style=\"padding-left:15px;\"><p style=\"margin:0 0 8px 0;font-size:16px;font-weight:bold;\"><a href=\"${url}\" style=\"color:#111;text-decoration:none;\">${name}<\/a><\/p><p style=\"margin:0;color:#555;\"><strong>\u8a62\u554f\u6578\u91cf\uff1a<\/strong> ${qty}<\/p><\/td><\/tr>`;\r\n    });\r\n\r\n    $('#product_list').val(\r\n      html ? `<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">${html}<\/table>` : ''\r\n    );\r\n  }\r\n\r\n  \/\/ \u9801\u9762\u8f09\u5165\u6642\u5148\u57f7\u884c\u4e00\u6b21\u66f4\u65b0\r\n  updateQuoteFormFields();\r\n\r\n  \/\/ \u9019\u88e1\u9032\u884c\u4fee\u6539\uff1a\u76e3\u807d\u9ede\u64ca\u81ea\u8a02\u9078\u9805\u7684\u4e8b\u4ef6\r\n  $(document).on('click', '.custom-option', updateQuoteFormFields);\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<\/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-11502","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/pages\/11502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/comments?post=11502"}],"version-history":[{"count":3,"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/pages\/11502\/revisions"}],"predecessor-version":[{"id":25856,"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/pages\/11502\/revisions\/25856"}],"wp:attachment":[{"href":"https:\/\/www.sci.com.tw\/ja\/wp-json\/wp\/v2\/media?parent=11502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}