<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Rupai</title><atom:link href="https://myrupai.com/feed/" rel="self" type="application/rss+xml" /><link>https://myrupai.com/</link><description></description><lastBuildDate>Sat, 02 May 2026 17:16:49 +0000</lastBuildDate><language>en-US</language><sy:updatePeriod> hourly	</sy:updatePeriod><sy:updateFrequency> 1	</sy:updateFrequency><generator>https://wordpress.org/?v=6.9.4</generator><image><url>https://myrupai.com/wp-content/uploads/2026/04/cropped-Logo-PNG-C-1-scaled-1-32x32.png</url><title>Rupai</title><link>https://myrupai.com/</link><width>32</width><height>32</height></image><item><title>Sneho</title><link>https://myrupai.com/sneho/</link><comments>https://myrupai.com/sneho/#respond</comments><dc:creator><![CDATA[rupai]]></dc:creator><pubDate>Sat, 02 May 2026 17:16:49 +0000</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://myrupai.com/?p=1399</guid><description><![CDATA[<p>আমাদের সকল পণ্য Handcrafted with love, delivered free 🔍 ০টি পণ্য পাওয়া গেছে পণ্য লোড হচ্ছে&#8230; (Loading products&#8230;) দুঃখিত! পণ্য লোড করা যাচ্ছে না। Products could not be loaded at this moment. Please try refreshing the page. 🚚 ফ্রি ডেলিভারি 🏠 সম্পূর্ণ ঘরোয়া 🌿 কোনো ক্ষতিকর উপাদান নেই ⭐ ৬ মাস মেয়াদ</p><p>The post <a href="https://myrupai.com/sneho/">Sneho</a> appeared first on <a href="https://myrupai.com">Rupai</a>.</p>
]]></description><content:encoded><![CDATA[ <div id="rupai-shop-page"><style> @import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap'); #rupai-shop-page .rupai-controls { justify-content: flex-start;
} #rupai-shop-page .rupai-product-count { width: 100%;
} /* CSS Scoped entirely to #rupai-shop-page */ #rupai-shop-page { --rupai-green: #2d5016; --rupai-green-dark: #1f3a0f; --rupai-amber: #d4820a; --rupai-amber-hover: #b87108; --rupai-cream: #fdf6ec; --rupai-cream-dark: #f3eadc; --rupai-brown: #5d4037; --rupai-text-main: #333333; --rupai-text-light: #666666; --rupai-border: #e8dbce; --rupai-white: #ffffff; --rupai-red: #cc3333; font-family: 'Inter', sans-serif; background-color: transparent; color: var(--rupai-text-main); box-sizing: border-box; margin: 0 auto; max-width: 1200px; } #rupai-shop-page * { box-sizing: border-box; } /* Bengali Typography Specifics */ #rupai-shop-page .rupai-bengali { font-family: 'Hind Siliguri', sans-serif; } /* Banner */ #rupai-shop-page .rupai-banner { background-color: var(--rupai-green); color: var(--rupai-cream); text-align: center; padding: 3rem 1rem; border-radius: 12px; margin-bottom: 2rem; box-shadow: 0 4px 15px rgba(45, 80, 22, 0.15); } #rupai-shop-page .rupai-banner h1 { margin: 0 0 0.5rem 0; font-size: 2.5rem; font-weight: 700; color: var(--rupai-white); } #rupai-shop-page .rupai-banner p { margin: 0; font-size: 1.1rem; font-weight: 400; opacity: 0.9; } /* Sorting & Meta Bar */ #rupai-shop-page .rupai-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding: 1rem; background: var(--rupai-cream); border-radius: 8px; border: 1px solid var(--rupai-border); } #rupai-shop-page .rupai-product-count { font-size: 1rem; font-weight: 600; color: var(--rupai-brown); } #rupai-shop-page .rupai-sort-dropdown { padding: 0.5rem 1rem; border-radius: 6px; border: 1px solid var(--rupai-border); background-color: var(--rupai-white); font-family: 'Inter', sans-serif; font-size: 0.95rem; color: var(--rupai-text-main); cursor: pointer; outline: none; } #rupai-shop-page .rupai-sort-dropdown:focus { border-color: var(--rupai-amber); } /* Product Grid */ #rupai-shop-page .rupai-product-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 3rem; } @media (min-width: 600px) { #rupai-shop-page .rupai-product-grid { grid-template-columns: repeat(2, 1fr); } } @media (min-width: 900px) { #rupai-shop-page .rupai-product-grid { grid-template-columns: repeat(4, 1fr); } } /* Product Card */ #rupai-shop-page .rupai-card { background: var(--rupai-white); border-radius: 12px; border: 1px solid var(--rupai-border); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; position: relative; display: flex; flex-direction: column; } #rupai-shop-page .rupai-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(45, 80, 22, 0.1); } /* Sale Badge */ #rupai-shop-page .rupai-sale-badge { position: absolute; top: 12px; right: 12px; background-color: var(--rupai-red); color: var(--rupai-white); padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.1); } /* Image Wrapper */ #rupai-shop-page .rupai-card-image-wrap { position: relative; width: 100%; padding-top: 100%; /* 1:1 Aspect Ratio */ overflow: hidden; background-color: var(--rupai-cream-dark); display: block; /* Added block display so the <a> tag behaves correctly */ } #rupai-shop-page .rupai-card-image-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; } #rupai-shop-page .rupai-card:hover .rupai-card-image-wrap img { transform: scale(1.05); } /* Card Content */ #rupai-shop-page .rupai-card-content { padding: 1.25rem; display: flex; flex-direction: column; flex-grow: 1; } #rupai-shop-page .rupai-card-title-link { text-decoration: none; } #rupai-shop-page .rupai-card-title-link:hover .rupai-card-title { color: var(--rupai-amber); transition: color 0.2s ease; } #rupai-shop-page .rupai-card-title { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem 0; color: var(--rupai-green); line-height: 1.4; } #rupai-shop-page .rupai-card-weight { font-size: 0.85rem; color: var(--rupai-text-light); margin-bottom: 0.5rem; } #rupai-shop-page .rupai-card-desc { font-size: 0.9rem; color: var(--rupai-text-light); margin-bottom: 1rem; line-height: 1.5; flex-grow: 1; } /* Pricing */ #rupai-shop-page .rupai-card-price-wrap { margin-bottom: 1.25rem; display: flex; align-items: center; gap: 8px; } #rupai-shop-page .rupai-price-regular { font-size: 1rem; color: var(--rupai-text-light); text-decoration: line-through; } #rupai-shop-page .rupai-price-sale { font-size: 1.35rem; font-weight: 700; color: var(--rupai-amber); } /* Buttons */ #rupai-shop-page .rupai-button-group { display: flex; flex-direction: column; gap: 0.5rem; } #rupai-shop-page .rupai-btn { width: 100%; padding: 0.75rem; border: none; border-radius: 6px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; text-align: center; text-decoration: none; display: flex; justify-content: center; align-items: center; font-family: 'Inter', 'Hind Siliguri', sans-serif; } #rupai-shop-page .rupai-btn-buy { background-color: var(--rupai-amber); color: var(--rupai-white); } #rupai-shop-page .rupai-btn-buy:hover { background-color: var(--rupai-amber-hover); } /* Loading Skeleton */ #rupai-shop-page .rupai-loading-state { display: flex; justify-content: center; align-items: center; min-height: 300px; width: 100%; flex-direction: column; gap: 1rem; } #rupai-shop-page .rupai-spinner { width: 50px; height: 50px; border: 5px solid var(--rupai-cream-dark); border-top: 5px solid var(--rupai-green); border-radius: 50%; animation: rupai-spin 1s linear infinite; } @keyframes rupai-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } #rupai-shop-page .rupai-loading-text { color: var(--rupai-green); font-weight: 600; } /* Error State */ #rupai-shop-page .rupai-error-state { background: #ffebeb; color: var(--rupai-red); padding: 2rem; border-radius: 8px; text-align: center; border: 1px solid #ffcaca; margin-bottom: 3rem; } /* USP Strip */ #rupai-shop-page .rupai-usp-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; background-color: var(--rupai-cream); padding: 1.5rem; border-radius: 12px; border: 1px dashed var(--rupai-amber); margin-top: 2rem; } #rupai-shop-page .rupai-usp-item { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--rupai-brown); } /* ============================================================= মোবাইল ভার্সনের জন্য শুরু ============================================================= */ @media (max-width: 599px) { #rupai-shop-page { max-width: 100%; padding: 0 12px; } /* Premium mobile banner */ #rupai-shop-page .rupai-banner { padding: 2rem 1rem; border-radius: 20px; margin-bottom: 1.4rem; background: linear-gradient(135deg, var(--rupai-green-dark), var(--rupai-green)); box-shadow: 0 10px 24px rgba(45, 80, 22, 0.18); } #rupai-shop-page .rupai-banner h1 { font-size: 2rem; line-height: 1.25; letter-spacing: -0.3px; } #rupai-shop-page .rupai-banner p { font-size: 0.95rem; margin-top: 0.5rem; color: var(--rupai-cream); } /* Controls mobile layout */ #rupai-shop-page .rupai-controls { flex-direction: column; align-items: stretch; gap: 0.8rem; padding: 1rem; border-radius: 16px; margin-bottom: 1.1rem; background: linear-gradient(180deg, #fffaf2, var(--rupai-cream)); } #rupai-shop-page .rupai-product-count { font-size: 1rem; line-height: 1.4; color: var(--rupai-brown); } #rupai-shop-page .rupai-sort-dropdown { width: 100%; padding: 0.78rem 1rem; font-size: 1rem; border-radius: 10px; background-color: var(--rupai-white); } /* Product grid mobile */ #rupai-shop-page .rupai-product-grid { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; } /* Premium horizontal product card */ #rupai-shop-page .rupai-card { display: grid; grid-template-columns: 42% 58%; min-height: 215px; border-radius: 18px; overflow: hidden; border: 1px solid rgba(232, 219, 206, 0.95); box-shadow: 0 8px 22px rgba(45, 80, 22, 0.08); background: var(--rupai-white); } #rupai-shop-page .rupai-card:hover { transform: none; box-shadow: 0 8px 22px rgba(45, 80, 22, 0.08); } /* Image left side */ #rupai-shop-page .rupai-card-image-wrap { padding-top: 0; height: 100%; min-height: 215px; background-color: var(--rupai-cream-dark); } #rupai-shop-page .rupai-card-image-wrap img { position: static; width: 100%; height: 100%; object-fit: cover; display: block; } #rupai-shop-page .rupai-card:hover .rupai-card-image-wrap img { transform: none; } /* Sale badge on image */ #rupai-shop-page .rupai-sale-badge { top: 10px; left: calc(42% - 62px); right: auto; font-size: 0.78rem; padding: 4px 8px; border-radius: 6px; } /* Content right side */ #rupai-shop-page .rupai-card-content { padding: 0.95rem 1rem; display: flex; flex-direction: column; justify-content: center; } #rupai-shop-page .rupai-card-title { font-size: 1.05rem; line-height: 1.35; margin-bottom: 0.4rem; color: var(--rupai-green-dark); } #rupai-shop-page .rupai-card-weight { font-size: 0.8rem; margin-bottom: 0.4rem; color: var(--rupai-text-light); } #rupai-shop-page .rupai-card-price-wrap { margin-bottom: 0.5rem; gap: 7px; flex-wrap: wrap; } #rupai-shop-page .rupai-price-regular { font-size: 0.92rem; color: #777; } #rupai-shop-page .rupai-price-sale { font-size: 1.35rem; font-weight: 700; color: var(--rupai-amber); } #rupai-shop-page .rupai-card-desc { font-size: 0.82rem; line-height: 1.45; margin-bottom: 0.75rem; color: var(--rupai-text-light); } /* Premium Buy Button */ #rupai-shop-page .rupai-btn { padding: 0.68rem 0.7rem; font-size: 0.88rem; border-radius: 10px; box-shadow: 0 5px 12px rgba(212, 130, 10, 0.22); } #rupai-shop-page .rupai-btn-buy { background: linear-gradient(135deg, var(--rupai-amber), var(--rupai-amber-hover)); } #rupai-shop-page .rupai-btn-buy:hover { background: linear-gradient(135deg, var(--rupai-amber-hover), var(--rupai-amber)); } /* USP Strip mobile premium */ #rupai-shop-page .rupai-usp-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; padding: 0.8rem; border-radius: 18px; margin-top: 1.4rem; background: linear-gradient(180deg, #fffaf2, var(--rupai-cream)); } #rupai-shop-page .rupai-usp-item { justify-content: center; text-align: center; padding: 0.9rem 0.45rem; font-size: 0.88rem; line-height: 1.35; border-bottom: 1px solid var(--rupai-border); } #rupai-shop-page .rupai-usp-item span { font-size: 1.3rem; } #rupai-shop-page .rupai-usp-item:nth-child(1), #rupai-shop-page .rupai-usp-item:nth-child(3) { border-right: 1px solid var(--rupai-border); } #rupai-shop-page .rupai-usp-item:nth-child(3), #rupai-shop-page .rupai-usp-item:nth-child(4) { border-bottom: none; }
} /* ============================================================= EXTRA SMALL MOBILE FIX For very small phones below 380px ============================================================= */ @media (max-width: 380px) { #rupai-shop-page { padding: 0 8px; } #rupai-shop-page .rupai-banner h1 { font-size: 1.65rem; } #rupai-shop-page .rupai-banner p { font-size: 0.85rem; } #rupai-shop-page .rupai-card { grid-template-columns: 40% 60%; min-height: 205px; } #rupai-shop-page .rupai-card-image-wrap { min-height: 205px; } #rupai-shop-page .rupai-card-content { padding: 0.8rem; } #rupai-shop-page .rupai-card-title { font-size: 0.95rem; } #rupai-shop-page .rupai-card-weight { font-size: 0.75rem; } #rupai-shop-page .rupai-card-desc { font-size: 0.76rem; } #rupai-shop-page .rupai-price-sale { font-size: 1.18rem; } #rupai-shop-page .rupai-btn { font-size: 0.8rem; padding: 0.6rem; } #rupai-shop-page .rupai-sale-badge { left: calc(40% - 58px); font-size: 0.72rem; }
}
#rupai-shop-page .rupai-card { cursor: pointer;
} #rupai-shop-page .rupai-btn-buy { cursor: pointer;
} #rupai-shop-page .rupai-btn-buy { background: #2d5016 !important; color: #ffffff !important;
} #rupai-shop-page .rupai-btn-buy:hover { background: #c65e00 !important;
} #rupai-shop-page .rupai-btn-buy:active { transform: scale(1.1);
} /* ============================================================= Search Bar - PC + Mobile Responsive ============================================================= */ #rupai-shop-page .rupai-search-wrap { margin-bottom: 1rem; background: var(--rupai-cream); border: 1px solid var(--rupai-border); border-radius: 10px; padding: 0.9rem 1rem;
} #rupai-shop-page .rupai-search-input { width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--rupai-border); border-radius: 8px; background: var(--rupai-white); color: var(--rupai-text-main); font-size: 1rem; outline: none; font-family: 'Inter', 'Hind Siliguri', sans-serif;
} #rupai-shop-page .rupai-search-input::placeholder { color: #999;
} #rupai-shop-page .rupai-search-input:focus { border-color: var(--rupai-amber); box-shadow: 0 0 0 3px rgba(212, 130, 10, 0.12);
} /* Mobile Search Bar */
@media (max-width: 599px) { #rupai-shop-page .rupai-search-wrap { padding: 0.85rem; border-radius: 14px; margin-bottom: 1rem; background: linear-gradient(180deg, #fffaf2, var(--rupai-cream)); } #rupai-shop-page .rupai-search-input { padding: 0.78rem 0.9rem; font-size: 1rem; border-radius: 10px; }
} /* ============================================================= Premium Search Bar Style - Option 5 PC + Mobile Responsive ============================================================= */ #rupai-shop-page .rupai-search-wrap { position: relative; margin-bottom: 1.2rem; background: transparent; border: none; padding: 0;
} /* Main search input */
#rupai-shop-page .rupai-search-input { width: 100%; height: 64px; padding: 0 95px 0 95px; border: 2px solid var(--rupai-amber); border-radius: 999px; background: #fffdf8; color: var(--rupai-text-main); font-size: 1.08rem; outline: none; font-family: 'Inter', 'Hind Siliguri', sans-serif; box-shadow: 0 6px 18px rgba(212, 130, 10, 0.10); transition: all 0.25s ease;
} /* Placeholder */
#rupai-shop-page .rupai-search-input::placeholder { color: #8a8a8a;
} /* Focus effect */
#rupai-shop-page .rupai-search-input:focus { border-color: var(--rupai-amber-hover); box-shadow: 0 8px 24px rgba(212, 130, 10, 0.18); background: #ffffff;
} /* Left leaf circle */
#rupai-shop-page .rupai-search-wrap::before { content: "&#x1f33f;"; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 78px; height: 52px; border-radius: 999px 0 0 999px; background: #f8f0df; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; z-index: 2; pointer-events: none;
} /* Right orange search button style */
#rupai-shop-page .rupai-search-button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 86px; height: 58px; border: none; border-radius: 0 999px 999px 0; background: linear-gradient(135deg, var(--rupai-amber), var(--rupai-amber-hover)); color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 1.65rem; z-index: 3; cursor: pointer; box-shadow: 0 5px 14px rgba(212, 130, 10, 0.25);
} #rupai-shop-page .rupai-search-button:active { transform: translateY(-50%) scale(0.96);
} /* ============================================================= Mobile Responsive ============================================================= */ @media (max-width: 599px) { #rupai-shop-page .rupai-search-wrap { margin-bottom: 1rem; } #rupai-shop-page .rupai-search-input { height: 58px; padding: 0 78px 0 78px; font-size: 1rem; border-radius: 999px; } #rupai-shop-page .rupai-search-wrap::before { left: 7px; width: 64px; height: 46px; font-size: 1.45rem; } #rupai-shop-page .rupai-search-button { right: 4px; width: 70px; height: 52px; font-size: 1.35rem;
}
} /* ============================================================= Extra Small Mobile ============================================================= */ @media (max-width: 380px) { #rupai-shop-page .rupai-search-input { height: 54px; padding: 0 68px 0 68px; font-size: 0.92rem; } #rupai-shop-page .rupai-search-wrap::before { width: 56px; height: 42px; font-size: 1.3rem; } #rupai-shop-page .rupai-search-button { width: 60px; height: 48px; font-size: 1.2rem;
}
} /* ============================================================= মোবাইল ভার্সনের জন্য শেষ ============================================================= */ </style><div class="rupai-banner"><h1 class="rupai-bengali">আমাদের সকল পণ্য</h1><p>Handcrafted with love, delivered free</p></div><div class="rupai-search-wrap" id="rupai-search-wrap" style="display: none;"><input type="text" id="rupai-search-input" class="rupai-search-input rupai-bengali" placeholder="পণ্য খুঁজুন..." ><button type="button" id="rupai-search-button" class="rupai-search-button"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50d.png" alt="🔍" class="wp-smiley" style="height: 1em; max-height: 1em;" /></button></div><div class="rupai-controls" id="rupai-controls" style="display: none;"><div class="rupai-product-count rupai-bengali" id="rupai-product-count"> ০টি পণ্য পাওয়া গেছে </div></div><div id="rupai-content-area"><div class="rupai-loading-state" id="rupai-loading"><div class="rupai-spinner"></div><div class="rupai-loading-text rupai-bengali">পণ্য লোড হচ্ছে&#8230; (Loading products&#8230;)</div></div><div class="rupai-error-state rupai-bengali" id="rupai-error" style="display: none;"><h3 id="rupai-error-title">দুঃখিত! পণ্য লোড করা যাচ্ছে না।</h3><p id="rupai-error-desc">Products could not be loaded at this moment. Please try refreshing the page.</p></div><div class="rupai-product-grid" id="rupai-product-grid"></div></div><div class="rupai-usp-strip rupai-bengali"><div class="rupai-usp-item"><span><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f69a.png" alt="🚚" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> ফ্রি ডেলিভারি</div><div class="rupai-usp-item"><span><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3e0.png" alt="🏠" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> সম্পূর্ণ ঘরোয়া</div><div class="rupai-usp-item"><span><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f33f.png" alt="🌿" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> কোনো ক্ষতিকর উপাদান নেই</div><div class="rupai-usp-item"><span><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2b50.png" alt="⭐" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> ৬ মাস মেয়াদ</div></div><script> document.addEventListener('DOMContentLoaded', () => { // ========================================== // &#x26a0; CREDENTIALS CONFIGURATION // REPLACE THESE WITH YOUR ACTUAL WOOCOMMERCE // REST API KEYS (Read-only keys are recommended) // ========================================== const CONSUMER_KEY = 'ck_aca473c4eef5d32ba244f60b2f0b26f1c3c808e0'; const CONSUMER_SECRET = 'cs_b4d6a14f29c759d7f973b1bdd19797dfe559f92b'; const STORE_URL = 'https://myrupai.com'; // ========================================== let allProducts = []; const gridContainer = document.getElementById('rupai-product-grid'); const loadingState = document.getElementById('rupai-loading'); const errorState = document.getElementById('rupai-error'); const errorTitle = document.getElementById('rupai-error-title'); const errorDesc = document.getElementById('rupai-error-desc'); const controls = document.getElementById('rupai-controls'); const searchWrap = document.getElementById('rupai-search-wrap'); const searchButton = document.getElementById('rupai-search-button'); const searchInput = document.getElementById('rupai-search-input'); const countDisplay = document.getElementById('rupai-product-count'); // Initialize App fetchProducts(); searchInput.addEventListener('input', () => { filterSortAndRenderProducts(); });
searchButton.addEventListener('click', () => { filterSortAndRenderProducts();
}); searchInput.addEventListener('keydown', (e) => { if (e.key === 'Enter') { filterSortAndRenderProducts(); }
}); // 1. Fetch Products async function fetchProducts() { try { // Preview mode fallback: If keys are not replaced, show mock data to prevent 401 error if (CONSUMER_KEY === 'ck_REPLACE_WITH_YOUR_KEY' || CONSUMER_SECRET === 'cs_REPLACE_WITH_YOUR_SECRET') { console.warn("Notice: Using placeholder API keys. Loading mock data for preview."); allProducts = [ { id: 101, name: 'রসুনের আচার (Garlic Pickle)', price: '250', regular_price: '300', sale_price: '250', weight: '400g', short_description: '<p>Premium homemade garlic pickle with authentic spices.</p>', images: [{src: 'https://placehold.co/500x500/2d5016/fdf6ec?text=Garlic+Pickle'}], date_created: '2024-01-01T10:00:00' }, { id: 102, name: 'আমের কাশ্মীরি আচার (Mango Kashmiri)', price: '300', regular_price: '300', sale_price: '', weight: '500g', short_description: '<p>Sweet and sour mango kashmiri pickle.</p>', images: [{src: 'https://placehold.co/500x500/d4820a/fdf6ec?text=Mango+Kashmiri'}], date_created: '2024-02-15T12:30:00' }, { id: 103, name: 'জলপাই আচার (Olive Pickle)', price: '200', regular_price: '250', sale_price: '200', weight: '400g', short_description: '<p>Traditional tangy olive pickle made with mustard oil.</p>', images: [{src: 'https://placehold.co/500x500/5d4037/fdf6ec?text=Olive+Pickle'}], date_created: '2024-03-10T09:15:00' } ]; loadingState.style.display = 'none'; controls.style.display = 'flex'; searchWrap.style.display = 'block'; updateCountDisplay(allProducts.length); renderProducts(allProducts); return; // Exit early to avoid making the real API call } // Endpoint targeting published products, max 20 per page const apiUrl = `${STORE_URL}/wp-json/wc/v3/products?status=publish&per_page=20&consumer_key=${CONSUMER_KEY}&consumer_secret=${CONSUMER_SECRET}`; const response = await fetch(apiUrl); if (!response.ok) { if (response.status === 401) { throw new Error("HTTP 401 Unauthorized: Invalid consumer_key or consumer_secret."); } throw new Error(`HTTP error! status: ${response.status}`); } allProducts = await response.json(); if(allProducts.length > 0) { loadingState.style.display = 'none'; controls.style.display = 'flex'; searchWrap.style.display = 'block'; updateCountDisplay(allProducts.length); renderProducts(allProducts); return; } else { throw new Error("No products found."); } } catch (error) { console.error("WooCommerce API Error:", error); loadingState.style.display = 'none'; errorState.style.display = 'block'; if (error.message.includes('401')) { errorDesc.innerHTML = "Authentication Error: Please check if your WooCommerce API keys are correct."; } } } // 2. Format Currency (Bangladeshi Taka) function formatPrice(price) { if(!price) return ''; // format with commas if needed, prepending ৳ return `৳${parseFloat(price).toLocaleString('en-IN')}`; } // 3. Strip HTML & Truncate function stripAndTruncateHtml(htmlStr, maxLength = 60) { if (!htmlStr) return ''; const tmp = document.createElement("div"); tmp.innerHTML = htmlStr; let text = tmp.textContent || tmp.innerText || ""; text = text.trim(); if (text.length > maxLength) { return text.substring(0, maxLength) + "..."; } return text; } // 4. Update Product Count Text function updateCountDisplay(count) { // Convert to Bengali numbers format just for visual flair if desired, // but standard numbers are usually fine in mixed texts. // Using standard numbers with Bengali text for compatibility. countDisplay.innerHTML = `${count}টি পণ্য পাওয়া গেছে / ${count} products found`; } // 5. Render HTML Cards function renderProducts(productsToRender) { gridContainer.innerHTML = ''; // Clear current grid if (productsToRender.length === 0) { gridContainer.innerHTML = ` <div class="rupai-error-state rupai-bengali" style="display:block; grid-column: 1 / -1;"><h3>কোনো পণ্য পাওয়া যায়নি</h3><p>আপনার সার্চ অনুযায়ী কোনো পণ্য মেলেনি।</p></div> `; return;
} productsToRender.forEach(product => { // Identify Image const imgSrc = product.images && product.images.length > 0 ? product.images[0].src : 'https://via.placeholder.com/500x500.png?text=No+Image'; // Identify Pricing Structure const isSale = product.sale_price !== ""; const displayRegularPrice = isSale ? formatPrice(product.regular_price) : ''; const displayMainPrice = formatPrice(product.price); // Identify Weight const weightStr = product.weight ? `<div class="rupai-card-weight rupai-bengali">পরিমাণ (Weight): ${product.weight}</div>` : ''; // Identify Permalink const productLink = product.permalink || '#'; // HTML Skeleton const card = document.createElement('div'); card.className = 'rupai-card'; card.dataset.productLink = productLink; card.style.cursor = 'pointer'; card.addEventListener('click', function(e) { if (e.target.closest('.rupai-btn-buy')) { return; } window.location.href = this.dataset.productLink; }); card.innerHTML = ` ${isSale ? `<div class="rupai-sale-badge">Sale!</div>` : ''} <a href="${productLink}" class="rupai-card-image-wrap"><img decoding="async" src="${imgSrc}" alt="${product.name}" loading="lazy"></a><div class="rupai-card-content"><a href="${productLink}" class="rupai-card-title-link"><h3 class="rupai-card-title rupai-bengali">${product.name}</h3></a> ${weightStr} <div class="rupai-card-price-wrap"> ${isSale ? `<span class="rupai-price-regular">${displayRegularPrice}</span>` : ''} <span class="rupai-price-sale">${displayMainPrice}</span></div><div class="rupai-card-desc rupai-bengali"> ${stripAndTruncateHtml(product.short_description, 65)} </div><div class="rupai-button-group"><a href="${STORE_URL}/checkout/?buy-now=${product.id}" class="rupai-btn rupai-btn-buy rupai-bengali" onclick="event.stopPropagation();"> এখনই কিনুন (Buy Now) </a></div></div> `; gridContainer.appendChild(card); }); } // 6. Sorting Logic function sortAndRenderProducts(sortType) { let sortedProducts = [...allProducts]; switch(sortType) { case 'price-low': sortedProducts.sort((a, b) => parseFloat(a.price || 0) - parseFloat(b.price || 0)); break; case 'price-high': sortedProducts.sort((a, b) => parseFloat(b.price || 0) - parseFloat(a.price || 0)); break; case 'newest': sortedProducts.sort((a, b) => new Date(b.date_created) - new Date(a.date_created)); break; case 'default': default: // Keeps original fetched order break; } renderProducts(sortedProducts); } function filterSortAndRenderProducts() { const searchText = searchInput.value.toLowerCase().trim(); let filteredProducts = allProducts.filter(product => { const productTitle = product.name ? product.name.toLowerCase() : ''; return productTitle.includes(searchText); }); updateCountDisplay(filteredProducts.length); renderProducts(filteredProducts);
} });
</script></div><p>The post <a href="https://myrupai.com/sneho/">Sneho</a> appeared first on <a href="https://myrupai.com">Rupai</a>.</p>
]]></content:encoded><wfw:commentRss>https://myrupai.com/sneho/feed/</wfw:commentRss><slash:comments>0</slash:comments></item><item><title>Hello world!</title><link>https://myrupai.com/hello-world/</link><comments>https://myrupai.com/hello-world/#respond</comments><dc:creator><![CDATA[rupai]]></dc:creator><pubDate>Sun, 05 Apr 2026 07:53:25 +0000</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://myrupai.com/?p=1</guid><description><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p><p>The post <a href="https://myrupai.com/hello-world/">Hello world!</a> appeared first on <a href="https://myrupai.com">Rupai</a>.</p>
]]></description><content:encoded><![CDATA[
<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p><p>The post <a href="https://myrupai.com/hello-world/">Hello world!</a> appeared first on <a href="https://myrupai.com">Rupai</a>.</p>
]]></content:encoded><wfw:commentRss>https://myrupai.com/hello-world/feed/</wfw:commentRss><slash:comments>0</slash:comments></item></channel></rss>