{"id":7891,"date":"2026-09-29T20:24:37","date_gmt":"2026-09-29T20:24:37","guid":{"rendered":"https:\/\/haatexpresss.com\/staging\/?page_id=7891"},"modified":"2026-10-02T18:31:10","modified_gmt":"2026-10-02T18:31:10","slug":"all-categories","status":"publish","type":"page","link":"https:\/\/haatexpresss.com\/staging\/all-categories\/","title":{"rendered":"All Categories"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"7891\" class=\"elementor elementor-7891\">\n\t\t\t\t<div class=\"elementor-element elementor-element-515397a e-flex e-con-boxed e-con e-parent\" data-id=\"515397a\" 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-9274975 elementor-widget elementor-widget-html\" data-id=\"9274975\" 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<style>\r\n.he-cat-page{\r\n  max-width:1200px;\r\n  margin:auto;\r\n  padding:25px 15px 60px;\r\n  font-family:Arial,Helvetica,sans-serif;\r\n  color:#222;\r\n}\r\n.he-cat-page *{box-sizing:border-box}\r\n\r\n.he-cat-hero{\r\n  background:linear-gradient(135deg,#6F2DBD,#8E44D6);\r\n  color:#fff;\r\n  text-align:center;\r\n  padding:45px 20px;\r\n  border-radius:22px;\r\n  margin-bottom:35px;\r\n}\r\n.he-cat-hero h1{\r\n  margin:0 0 10px;\r\n  font-size:38px;\r\n  font-weight:800;\r\n}\r\n.he-cat-hero p{\r\n  margin:0 auto;\r\n  max-width:650px;\r\n  font-size:16px;\r\n  line-height:1.6;\r\n}\r\n\r\n.he-cat-title{\r\n  text-align:center;\r\n  margin-bottom:25px;\r\n}\r\n.he-cat-title h2{\r\n  margin:0 0 8px;\r\n  font-size:28px;\r\n}\r\n.he-cat-title p{\r\n  margin:0;\r\n  color:#777;\r\n}\r\n\r\n.he-cat-grid{\r\n  display:grid;\r\n  grid-template-columns:repeat(4,minmax(0,1fr));\r\n  gap:20px;\r\n}\r\n\r\n.he-cat-card{\r\n  display:block;\r\n  text-decoration:none !important;\r\n  color:#222 !important;\r\n  background:#fff;\r\n  border:1px solid #eee;\r\n  border-radius:18px;\r\n  overflow:hidden;\r\n  transition:.25s ease;\r\n  box-shadow:0 4px 15px rgba(0,0,0,.05);\r\n}\r\n.he-cat-card:hover{\r\n  transform:translateY(-6px);\r\n  box-shadow:0 12px 30px rgba(0,0,0,.12);\r\n  border-color:#6F2DBD;\r\n}\r\n\r\n.he-cat-image{\r\n  height:165px;\r\n  background:#f7f3fc;\r\n  display:flex;\r\n  align-items:center;\r\n  justify-content:center;\r\n  overflow:hidden;\r\n}\r\n.he-cat-image img{\r\n  width:100%;\r\n  height:100%;\r\n  object-fit:contain;\r\n  display:block;\r\n}\r\n.he-cat-icon{\r\n  font-size:62px;\r\n}\r\n\r\n.he-cat-info{\r\n  padding:18px 14px;\r\n  text-align:center;\r\n}\r\n.he-cat-name{\r\n  font-size:16px;\r\n  font-weight:700;\r\n  line-height:1.4;\r\n  min-height:45px;\r\n  display:flex;\r\n  align-items:center;\r\n  justify-content:center;\r\n}\r\n.he-cat-count{\r\n  color:#777;\r\n  font-size:13px;\r\n  margin-top:6px;\r\n}\r\n.he-cat-arrow{\r\n  display:inline-block;\r\n  margin-top:12px;\r\n  background:#6F2DBD;\r\n  color:#fff;\r\n  padding:8px 16px;\r\n  border-radius:20px;\r\n  font-size:12px;\r\n  font-weight:700;\r\n}\r\n\r\n.he-cat-message{\r\n  text-align:center;\r\n  padding:35px 15px;\r\n  color:#777;\r\n  font-size:15px;\r\n  grid-column:1\/-1;\r\n}\r\n\r\n@media(max-width:1000px){\r\n  .he-cat-grid{\r\n    grid-template-columns:repeat(3,minmax(0,1fr));\r\n  }\r\n}\r\n\r\n@media(max-width:700px){\r\n  .he-cat-grid{\r\n    grid-template-columns:repeat(2,minmax(0,1fr));\r\n    gap:14px;\r\n  }\r\n  .he-cat-hero{\r\n    padding:32px 16px;\r\n    border-radius:18px;\r\n  }\r\n  .he-cat-hero h1{font-size:29px}\r\n  .he-cat-image{height:140px}\r\n  .he-cat-info{padding:14px 9px}\r\n  .he-cat-name{font-size:14px}\r\n}\r\n\r\n@media(max-width:420px){\r\n  .he-cat-grid{gap:10px}\r\n  .he-cat-image{height:120px}\r\n  .he-cat-icon{font-size:48px}\r\n}\r\n<\/style>\r\n\r\n<div class=\"he-cat-page\">\r\n\r\n  <section class=\"he-cat-hero\">\r\n    <h1>Shop by Category<\/h1>\r\n    <p>\r\n      Explore our categories and discover products for your everyday needs.\r\n    <\/p>\r\n  <\/section>\r\n\r\n  <div class=\"he-cat-title\">\r\n    <h2>All Categories<\/h2>\r\n    <p>Choose a category to explore our products.<\/p>\r\n  <\/div>\r\n\r\n  <div class=\"he-cat-grid\" id=\"heCategoryGrid\">\r\n    <div class=\"he-cat-message\">Loading categories...<\/div>\r\n  <\/div>\r\n\r\n<\/div>\r\n\r\n<script>\r\ndocument.addEventListener(\"DOMContentLoaded\", function(){\r\n\r\n  const grid = document.getElementById(\"heCategoryGrid\");\r\n\r\n  if(!grid) return;\r\n\r\n  const API =\r\n    window.location.origin +\r\n    \"\/wp-json\/wc\/store\/v1\/products\/categories?per_page=100&page=\";\r\n\r\n  function makeElement(tag, className, text){\r\n    const el = document.createElement(tag);\r\n    if(className) el.className = className;\r\n    if(text !== undefined) el.textContent = text;\r\n    return el;\r\n  }\r\n\r\n  function getFallbackIcon(name){\r\n    const n = name.toLowerCase();\r\n\r\n    if(n.includes(\"baby\")) return \"\ud83d\udc76\";\r\n    if(n.includes(\"beauty\") || n.includes(\"skin\")) return \"\ud83d\udc84\";\r\n    if(n.includes(\"car\") || n.includes(\"bike\")) return \"\ud83d\ude97\";\r\n    if(n.includes(\"cloth\") || n.includes(\"fashion\")) return \"\ud83d\udc55\";\r\n    if(n.includes(\"eco\") || n.includes(\"sustainable\")) return \"\ud83c\udf31\";\r\n    if(n.includes(\"fitness\") || n.includes(\"sport\")) return \"\ud83c\udfc3\";\r\n    if(n.includes(\"kitchen\") || n.includes(\"culinary\")) return \"\ud83c\udf73\";\r\n    if(n.includes(\"home\") || n.includes(\"decor\")) return \"\ud83c\udfe0\";\r\n    if(n.includes(\"outdoor\") || n.includes(\"camping\")) return \"\ud83c\udfd5\ufe0f\";\r\n    if(n.includes(\"tech\") || n.includes(\"mobile\")) return \"\ud83d\udcf1\";\r\n    if(n.includes(\"watch\")) return \"\u231a\";\r\n    if(n.includes(\"jewellery\") || n.includes(\"jewelry\")) return \"\ud83d\udc8e\";\r\n    if(n.includes(\"travel\")) return \"\ud83e\uddf3\";\r\n    if(n.includes(\"office\")) return \"\ud83d\udcda\";\r\n    if(n.includes(\"pet\")) return \"\ud83d\udc3e\";\r\n    if(n.includes(\"tool\")) return \"\ud83d\udee0\ufe0f\";\r\n    if(n.includes(\"food\") || n.includes(\"grocery\")) return \"\ud83d\uded2\";\r\n    if(n.includes(\"gift\")) return \"\ud83c\udf81\";\r\n\r\n    return \"\ud83d\udecd\ufe0f\";\r\n  }\r\n\r\n  function createCategoryCard(cat){\r\n\r\n    const card = makeElement(\"a\",\"he-cat-card\");\r\n\r\n    const imageBox = makeElement(\"div\",\"he-cat-image\");\r\n\r\n    if(\r\n      cat.image &&\r\n      cat.image.src &&\r\n      \/^https?:\\\/\\\/\/i.test(cat.image.src)\r\n    ){\r\n      const img = document.createElement(\"img\");\r\n      img.src = cat.image.src;\r\n      img.alt = cat.name || \"Category\";\r\n      img.loading = \"lazy\";\r\n      img.onerror = function(){\r\n        imageBox.innerHTML = \"\";\r\n        imageBox.appendChild(\r\n          makeElement(\"div\",\"he-cat-icon\",\r\n            getFallbackIcon(cat.name || \"\"))\r\n        );\r\n      };\r\n      imageBox.appendChild(img);\r\n    }else{\r\n      imageBox.appendChild(\r\n        makeElement(\"div\",\"he-cat-icon\",\r\n          getFallbackIcon(cat.name || \"\"))\r\n      );\r\n    }\r\n\r\n    const info = makeElement(\"div\",\"he-cat-info\");\r\n\r\n    const name = makeElement(\r\n      \"div\",\"he-cat-name\",cat.name || \"Category\"\r\n    );\r\n\r\n    const count = Number(cat.count || 0);\r\n\r\n    const countText = makeElement(\r\n      \"div\",\r\n      \"he-cat-count\",\r\n      count + (count === 1 ? \" Product\" : \" Products\")\r\n    );\r\n\r\n    const arrow = makeElement(\r\n      \"span\",\"he-cat-arrow\",\"View Products \u2192\"\r\n    );\r\n\r\n    const url = cat.permalink;\r\n\r\n    if(url && \/^https?:\\\/\\\/\/i.test(url)){\r\n      card.href = url;\r\n    }else{\r\n      card.href = \"\/product-category\/\" +\r\n        encodeURIComponent(cat.slug || \"\") + \"\/\";\r\n    }\r\n\r\n    info.appendChild(name);\r\n    info.appendChild(countText);\r\n    info.appendChild(arrow);\r\n\r\n    card.appendChild(imageBox);\r\n    card.appendChild(info);\r\n\r\n    return card;\r\n  }\r\n\r\n  async function loadCategories(){\r\n\r\n    try{\r\n\r\n      let allCategories = [];\r\n      let page = 1;\r\n      let totalPages = 1;\r\n\r\n      do{\r\n\r\n        const response = await fetch(\r\n          API + page,\r\n          {credentials:\"same-origin\"}\r\n        );\r\n\r\n        if(!response.ok){\r\n          throw new Error(\"Category API request failed\");\r\n        }\r\n\r\n        const categories = await response.json();\r\n\r\n        if(!Array.isArray(categories)){\r\n          throw new Error(\"Invalid category data\");\r\n        }\r\n\r\n        allCategories = allCategories.concat(categories);\r\n\r\n        totalPages = parseInt(\r\n          response.headers.get(\"X-WP-TotalPages\") || \"1\",\r\n          10\r\n        );\r\n\r\n        page++;\r\n\r\n      }while(page <= totalPages);\r\n\r\n      const visibleCategories = allCategories\r\n        .filter(function(cat){\r\n          return (\r\n            cat.slug !== \"uncategorized\" &&\r\n            String(cat.name).toLowerCase() !== \"uncategorized\"\r\n          );\r\n        })\r\n        .sort(function(a,b){\r\n          return a.name.localeCompare(b.name);\r\n        });\r\n\r\n      grid.innerHTML = \"\";\r\n\r\n      if(visibleCategories.length === 0){\r\n        grid.appendChild(\r\n          makeElement(\r\n            \"div\",\r\n            \"he-cat-message\",\r\n            \"No categories found.\"\r\n          )\r\n        );\r\n        return;\r\n      }\r\n\r\n      visibleCategories.forEach(function(cat){\r\n        grid.appendChild(createCategoryCard(cat));\r\n      });\r\n\r\n    }catch(error){\r\n\r\n      console.error(\"HAAT Category Error:\",error);\r\n\r\n      grid.innerHTML = \"\";\r\n\r\n      grid.appendChild(\r\n        makeElement(\r\n          \"div\",\r\n          \"he-cat-message\",\r\n          \"Categories could not be loaded. Please refresh the page.\"\r\n        )\r\n      );\r\n\r\n    }\r\n\r\n  }\r\n\r\n  loadCategories();\r\n\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":"<p>Shop by Category Explore our categories and discover products for your everyday needs. All Categories Choose a category to explore our products. Loading categories&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"full-width-container","site-content-style":"unboxed","site-sidebar-style":"unboxed","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_zipai_imported":false,"_zipai_import_id":"","footnotes":""},"class_list":["post-7891","page","type-page","status-publish","hentry"],"spectra_blocks_featured_image_url":null,"spectra_blocks_author_info":{"display_name":"haatexpresss","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/afee3d086a81f37431ad2f9f4fd916c4cae4ee0b5c4b5f45c3a4fc8fece60c61?s=96&d=mm&r=g","author_link":"https:\/\/haatexpresss.com\/staging\/author\/haatexpresss\/","description":""},"_links":{"self":[{"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/pages\/7891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/comments?post=7891"}],"version-history":[{"count":11,"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/pages\/7891\/revisions"}],"predecessor-version":[{"id":8095,"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/pages\/7891\/revisions\/8095"}],"wp:attachment":[{"href":"https:\/\/haatexpresss.com\/staging\/wp-json\/wp\/v2\/media?parent=7891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}