{"id":2559,"date":"2025-08-14T09:51:56","date_gmt":"2025-08-14T09:51:56","guid":{"rendered":"https:\/\/white-hy.com\/?page_id=2559"},"modified":"2025-09-13T08:17:03","modified_gmt":"2025-09-13T08:17:03","slug":"cartidges","status":"publish","type":"page","link":"https:\/\/white-hy.com\/en\/cartidges\/","title":{"rendered":"Cartidges"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"2559\" class=\"elementor elementor-2559\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-749e268 e-con-full e-flex e-con e-parent\" data-id=\"749e268\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-265081d elementor-widget__width-inherit elementor-widget elementor-widget-html\" data-id=\"265081d\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div style=\"text-align:center; margin:20px;\">\r\n  <button onclick=\"sendQuotation1()\" \r\n          style=\"padding:10px 20px; background:#28a745; color:white; border:none; border-radius:6px; font-size:14px; cursor:pointer;\">\r\n    \u2714 \u0625\u0631\u0633\u0627\u0644 \u0639\u0631\u0636 \u0633\u0639\u0631 \u0644\u0644\u0645\u0646\u062a\u062c\u0627\u062a \u0627\u0644\u0645\u062e\u062a\u0627\u0631\u0629\r\n  <\/button>\r\n<\/div>\r\n\r\n<div id=\"products1\" style=\"text-align:center;\"><\/div>\r\n\r\n<div style=\"text-align:center; margin:20px;\">\r\n  <button onclick=\"sendQuotation1()\" \r\n          style=\"padding:10px 20px; background:#007bff; color:white; border:none; border-radius:6px; font-size:14px; cursor:pointer;\">\r\n    \ud83d\udce9 \u0625\u0631\u0633\u0627\u0644 \u0639\u0631\u0636 \u0633\u0639\u0631 \u0644\u0644\u0645\u0646\u062a\u062c\u0627\u062a \u0627\u0644\u0645\u062e\u062a\u0627\u0631\u0629\r\n  <\/button>\r\n<\/div>\r\n\r\n<script>\r\nfunction sendQuotation1() {\r\n  const checkboxes = document.querySelectorAll(\".product1-check:checked\");\r\n  if (checkboxes.length === 0) {\r\n    alert(\"\u0645\u0646 \u0641\u0636\u0644\u0643 \u0627\u062e\u062a\u0631 \u0645\u0646\u062a\u062c \u0648\u0627\u062d\u062f \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644 \u0644\u0625\u0631\u0633\u0627\u0644 \u0639\u0631\u0636 \u0627\u0644\u0633\u0639\u0631.\");\r\n    return;\r\n  }\r\n\r\n  let selectedProducts = [];\r\n  checkboxes.forEach(cb => selectedProducts.push(cb.value));\r\n\r\n  const subject = \"\u0637\u0644\u0628 \u0639\u0631\u0636 \u0633\u0639\u0631\";\r\n  const body = \"\u0645\u0631\u062d\u0628\u0627\u060c\\n\\n\u0623\u0631\u063a\u0628 \u0641\u064a \u0637\u0644\u0628 \u0639\u0631\u0636 \u0633\u0639\u0631 \u0644\u0644\u0645\u0646\u062a\u062c\u0627\u062a \u0627\u0644\u062a\u0627\u0644\u064a\u0629:\\n\\n\" + selectedProducts.join(\"\\n\") + \"\\n\\n\u0634\u0643\u0631\u0627.\";\r\n  \r\n  window.location.href = `mailto:info@white-hy.com?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;\r\n}\r\n\r\n(async () => {\r\n  const SHEET_ID = '1FNMpPYGzc7D6m4lPQR22vaf8awXksfVohJ_62RAt6-w';\r\n  const SHEET_NAME = 'Sheet1'; \/\/ \u2705 \u0634\u064a\u062a 1\r\n  const SHEET_URL = `https:\/\/docs.google.com\/spreadsheets\/d\/${SHEET_ID}\/gviz\/tq?sheet=${encodeURIComponent(SHEET_NAME)}&tqx=out:json`;\r\n\r\n  const container = document.getElementById('products1');\r\n  container.innerHTML = \"\u062c\u0627\u0631\u064a \u062c\u0644\u0628 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a...\";\r\n\r\n  try {\r\n    const res = await fetch(SHEET_URL);\r\n    const text = await res.text();\r\n    const json = JSON.parse(text.substr(47).slice(0, -2));\r\n\r\n    container.innerHTML = \"\"; \r\n\r\n    json.table.rows.forEach((row, index) => {\r\n      const catalog   = row.c[1]?.v || '';   \/\/ Catalog (PDF)\r\n      const brand     = row.c[2]?.v || '';   \/\/ Brand\r\n      const code      = row.c[3]?.v || '';   \/\/ Product Code\r\n      const thread    = row.c[4]?.v || '';   \/\/ Thread Size\r\n      const imageURL  = row.c[5]?.v || '';   \/\/ Image\r\n      const cavity    = row.c[6]?.v || '';   \/\/ Cavity's Catalog\r\n      const desc      = row.c[7]?.v || '';   \/\/ Desc\r\n\r\n      if (!brand && !code) return; \r\n\r\n      function fixDriveURL(url) {\r\n        if (url && url.includes(\"drive.google.com\")) {\r\n          const fileIdMatch = url.match(\/[-\\w]{25,}\/);\r\n          if (fileIdMatch) {\r\n            return `https:\/\/drive.google.com\/uc?export=view&id=${fileIdMatch[0]}`;\r\n          }\r\n        }\r\n        return url;\r\n      }\r\n      const finalImageURL = fixDriveURL(imageURL);\r\n\r\n      const productLabel = `${brand} - ${code}`;\r\n      const checkboxId = `chk1-${index}`;\r\n\r\n      container.innerHTML += `\r\n        <div style=\"\r\n          border:1px solid #ccc;\r\n          padding:8px;\r\n          margin:10px;\r\n          border-radius:8px;\r\n          display:inline-block;\r\n          width:270px;\r\n          vertical-align:top;\r\n          background:#fff;\r\n          text-align:left;\r\n          font-family:Arial, sans-serif;\r\n          box-shadow:0 2px 6px rgba(0,0,0,0.1);\r\n          font-size:12px;\r\n        \">\r\n          <div style=\"margin-bottom:6px;\">\r\n            <input id=\"${checkboxId}\" type=\"checkbox\" class=\"product1-check\" value=\"${productLabel}\">\r\n            <label for=\"${checkboxId}\" style=\"font-size:12px; color:#007bff; font-weight:bold; cursor:pointer;\">\u0627\u062e\u062a\u0631 \u0627\u0644\u0645\u0646\u062a\u062c<\/label>\r\n          <\/div>\r\n\r\n          <img decoding=\"async\" src=\"${finalImageURL || ''}\" alt=\"${brand}\" \r\n               style=\"width:100%;height:150px;object-fit:contain;border-bottom:1px solid #ddd;padding-bottom:4px;${finalImageURL ? '' : 'display:none;'}\">\r\n\r\n          <h3 style=\"font-size:14px;margin:6px 0;font-weight:bold;color:#333;\">Brand: ${brand}<\/h3>\r\n          <p style=\"margin:0;color:#555;font-size:12px;\">Product Code: ${code}<\/p>\r\n          <p style=\"margin:0;color:#555;font-size:12px;\">Thread Size: ${thread}<\/p>\r\n          <p style=\"margin:0;color:#555;font-size:12px;\">Cavity's Catalog: ${cavity}<\/p>\r\n          <p style=\"margin:4px 0;color:#333;font-size:12px;text-align:left;\">${desc}<\/p>\r\n\r\n          ${catalog ? `\r\n            <div style=\"text-align:center; margin-top:8px;\">\r\n              <a href=\"${catalog}\" target=\"_blank\" \r\n                 style=\"display:inline-block;padding:6px 12px;background:#007bff;color:#fff;\r\n                        font-size:12px;font-weight:bold;border-radius:6px;text-decoration:none;\">\r\n                 \u0639\u0631\u0636 \u0627\u0644\u0643\u062a\u0627\u0644\u0648\u062c\r\n              <\/a>\r\n            <\/div>` : ''}\r\n        <\/div>\r\n      `;\r\n    });\r\n\r\n    if (!container.innerHTML.trim()) {\r\n      container.innerHTML = \"\u0644\u0627 \u064a\u0648\u062c\u062f \u0645\u0646\u062a\u062c\u0627\u062a \u0644\u0639\u0631\u0636\u0647\u0627.\";\r\n    }\r\n  } catch (err) {\r\n    container.innerHTML = `\u062e\u0637\u0623: ${err.message}`;\r\n  }\r\n})();\r\n<\/script>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>&#8230;<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2559","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/2559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/comments?post=2559"}],"version-history":[{"count":13,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/2559\/revisions"}],"predecessor-version":[{"id":2667,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/2559\/revisions\/2667"}],"wp:attachment":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/media?parent=2559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}