Help
RSS
API
Feed
Maltego
Contact
Domain > brightcurrentpowerhub.com
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2025-11-02
172.67.140.178
(
ClassC
)
Port 443
HTTP/1.1 200 OKDate: Sun, 02 Nov 2025 11:44:34 GMTContent-Type: text/html; charsetUTF-8Transfer-Encoding: chunkedConnection: keep-alivex-powered-by: PHP/8.1.33Nel: {report_to:cf-nel,success_fraction:0.0,max_age:604800}expires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatepragma: no-cacheReport-To: {group:cf-nel,max_age:604800,endpoints:{url:https://a.nel.cloudflare.com/report/v4?s3A%2FYuzBaaJq0cNdG3G0N8LJfWVP4vve1QtxJtHcivPlwRBj9pgx4LTVa9JXPFvRmXc1sbfCPd9Z4xI0JUOopVzT%2FHVLIZGxJVmKc3AyvkzXDznAmLPbMA1o%3D}}vary: Accept-EncodingServer: cloudflareaccess-control-allow-origin: *access-control-allow-methods: GET, POST, OPTIONSaccess-control-allow-headers: Content-Type, Authorizationx-turbo-charged-by: LiteSpeedcf-cache-status: DYNAMICSet-Cookie: PHPSESSIDvspfqgq3chpra6fsfj8uhscka0; Secure; Path/CF-RAY: 99836177aa6fe6e0-PDXalt-svc: h3:443; ma86400 !DOCTYPE html>html langen>head> meta charsetutf-8> meta http-equivX-UA-Compatible contentIEedge> meta nameviewport contentwidthdevice-width, initial-scale1> title>Bright Current Power Hub/title> link relpreconnect hrefhttps://fonts.googleapis.com> link relpreconnect hrefhttps://fonts.gstatic.com crossorigin> link relstylesheet typetext/css href./config/css/bootstrap.min.css?v1762083874> link relstylesheet typetext/css hrefstyle.css?v1762083874> link relstylesheet hrefhttps://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css> link relstylesheet hrefhttps://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css> link relstylesheet hrefhttps://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css> script srchttps://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js>/script> link hrefhttps://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css relstylesheet> link relstylesheet typetext/css href./config/css/animate.css?v1762083874> link relstylesheet hrefhttps://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css /> link relstylesheet hrefhttps://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css> link relstylesheet hrefhttps://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css> link relstylesheet hrefhttps://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.min.css> link relstylesheet hrefconfig/css/swiper-bundle.min.css /> link relstylesheet hrefhttps://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css /> link relstylesheet hrefhttps://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css /> link relstylesheet hrefhttps://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css /> link relstylesheet hrefconfig/css/site_custom.css?v1762083874 /> script srcconfig/js/swiper-bundle.min.js>/script> script srchttps://cdnjs.cloudflare.com/ajax/libs/chroma-js/2.1.1/chroma.min.js>/script>/head>style>.slick-slide { outline: none;}.thumbnail-slider .slick-slide { margin: 0 5px;}.thumbnail-slider .slick-slide img { cursor: pointer;} #loading-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 1000; background: rgba(255, 255, 255, 0.8); padding: 20px; border-radius: 10px;}.spinner { border: 4px solid #f3f3f3; border-top: 4px solid #3498db; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto;}@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); }}.product-wrapper { position: relative; min-height: 300px; }/style>script> function getCookie(name) { const cookies document.cookie.split(;); const sanitizedCookieName name.replace(/,; \t\r\n\013\014/g, _); for (let cookie of cookies) { const cookieName, cookieValue cookie.trim().split(); if (cookieName sanitizedCookieName) { return decodeURIComponent(cookieValue); } } return null; // Cookie not found } function setCookieWithExpiration(name, value, seconds) { const sanitizedCookieName name.replace(/,; \t\r\n\013\014/g, _); // Calculate expiration time const expirationTime new Date(); expirationTime.setTime(expirationTime.getTime() + (seconds * 1000)); // Convert seconds to milliseconds // Construct the cookie string const cookieString `${name}${encodeURIComponent(sanitizedCookieName)}; expires${expirationTime.toUTCString()}; path/`; // Set the cookie document.cookie cookieString; }/script>body> div classnav-home> /div> script srcminiCart.js>/script> section classnotification-bar_11 topbar-background-color py-1 stylemargin: auto;> div class row w-100 styleoverflow:hidden;position:relative;> div classcol-12> div classswiper-containerNB11 swiper-notification> div classswiper-wrapper> div classswiper-slide w-100> p classmb-0 topbar-text-color notification-bar6-font-size text-base>Shop now and save big! Limited time offer./p> /div> div classswiper-slide w-100> p classmb-0 topbar-text-color notification-bar6-font-size text-base>Discover What’s New Today!/p> /div> div classswiper-slide w-100> p classmb-0 topbar-text-color notification-bar6-font-size text-base>Get Them Before Theyre Gone!/p> /div> /div> div classswiper-button-prev swiper-button-prev-notification custom-swiper-button> /div> div classswiper-button-next swiper-button-next-notification custom-swiper-button> /div> /div> /div> /div>/section>section class header_section header_section76 idheader_section> header> div classheader-wrap> div classnavbar nav-color > div classcontainer w-100 d-flex justify-content-start align-items-center nav-text-color styleposition:relative;> div classcol col-lg-4 col-xl-3 h-100> a classheader_brand nav-text-color text-md hrefindex.php> Bright Current Power Hub /a> /div> div classcol-2 col-lg-5 col-xl-6 d-flex h-100 style justify-content: center;> button classnavbar-toggler m-auto nav-icon-color text-md idtoggle typebutton data-bs-togglecollapse data-bs-target#navbarTogglerDemo01 aria-controlsnavbarSupportedContent aria-expandedfalse aria-labelToggle navigation> i classbi bi-menu-button-wide>/i> /button> div classprimary-navigation nav-color d-none d-lg-block> nav classnavbar navbar-expand-lg p-0 nav-color> div classcontainer p-0> div classcollapse navbar-collapse idnavbarTogglerDemo01> ul classnavbar-nav me-auto mb-2 mb-lg-0> li classnav-item active > a classnav-link nav-text-color hrefindex.php> Homepage /a> /li> li classnav-item > a classnav-link nav-text-color hrefcart> My Goods /a> /li> li classnav-item > a classnav-link nav-text-color hrefcontact> Support /a> /li> li classnav-item dropdown> a classnav-link nav-text-color dropdown-toggle href# data-bs-toggledropdown aria-expandedfalse> Latest Products /a> ul classnav-color dropdown-menu> li classdropdown-item> a class hrefproduct/surface-mount-component-organizer-box> Surface Mount Component Organizer Box /a> /li> li classdropdown-item> a class hrefproduct/1/2-inch-non-metallic-liquid-tight-conduit-kit> 1/2-Inch Non-Metallic Liquid-Tight Conduit Kit /a> /li> li classdropdown-item> a class hrefproduct/20a-gfci-electrical-outlet-%E2%80%93-2-pack> 20A-GFCI Electrical Outlet – 2-Pack /a> /li> li classdropdown-item> a class hrefproduct/standard-electrical-wall-outlet-%E2%80%93-20-pack> Standard Electrical Wall Outlet – 20 Pack /a> /li> li classdropdown-item> a class hrefproduct/black-open-splice-junction-box-%E2%80%93-10-pack> Black Open Splice Junction Box – 10 Pack /a> /li> li classdropdown-item> a class hrefproduct/plastic-waterproof-junction-box> Plastic Waterproof Junction Box /a> /li> li classdropdown-item> a class hrefproduct/ceramic-terminal-block-strip-%E2%80%93-12-position> Ceramic Terminal Block Strip – 12 Position /a> /li> li classdropdown-item> a class hrefproduct/15a-decorator-usb-c-duplex-receptacle-outlet> 15A Decorator USB-C Duplex Receptacle Outlet /a> /li> /ul> /li> li classnav-item > a classnav-link nav-text-color hrefshop> Commerce /a> /li> li class wish-list-icon d-lg-none> a hrefwishlist class nav-icon-color text-base>i classbi bi-heart>/i>/a> /li> /ul> /div> /div> /nav> /div> /div> div classcol col-lg-3 col-xl-3 h-100 d-none d-xl-flex contact-btns-main ms-auto stylejustify-content: end;> div classd-lg-flex align-items-center d-none header-content text-left px-2> div classheader-icon nav-text-color p-2 d-none d-lg-flex> div class> div classcall-us align-items-center > form idsearch_form namesearch_form methodGET actionsearch/ classsearch-form m-0> div classinput-group fieldgroup2> input typetext classinput2 nameq value idsearchBarInput placeholderSearch aria-labelSearch aria-describedbybasic-addon1 search the artist marketplace> button idsearch-product classborder-none buttonsubmit2 typesubmit> i classbi bi-search>/i> /button> /div> /form> /div> /div> /div> div classheader-icon px-2 style align-items: center;> span classwish-list-icon px-2> a hrefwishlist classnav-icon-color text-md>i classbi bi-heart>/i>/a> /span> /div> ul classnavbar-nav navbar-nav4 nav-color> li classcart_link> a hrefjavascript:void(0);> div classd-flex px-2 shopping-cart-btn > div classcart-container> span classnav-icon-color text-md>i classbi bi-cart>/i>/span> span idcart_count classcart-count >/span> /div> div classcart-text-wrap d-flex flex-column align-items-start> span classcart_amt text-sm nav-text-color bottom-text> span classcart_amt text-sm nav-text-color d-none> $ p idcart_amt classsubtotalAmount text-sm nav-text-color style-d-inline-navbar>/p> /span> /span> /div> /div> /a> div classmini-cart-content > button classmini-cart-close text-md>i classbi bi-x-lg>/i>/button> div classminicart_inner> div classminicart_table table-responsive> table classtable minicart_details > tbody idminicartRow> tr classemptyRow>td colspan3>p classcart_empty >Cart is Empty/p>/td>/tr> /tbody> /table> /div> div classmini-cart-action stylewidth:62%;> div classsubtotal_column> p class text-base> Subtotal: $span classsubtotalAmount text-base idsubtotalAmount>/span> /p> /div> div classminicart_buttons buttonparentdiv3> a hrefcart.php classbutton-primary w-100 mt-3 text-sm stylepadding: 12px;min-height: 40px;> View Cart /a> a hrefcheckout.php classbutton-primary w-100 mt-3 text-sm stylepadding: 12px;min-height: 40px;> Checkout /a> /div> /div> /div> /div> /li> /ul> /div> /div> /div> div classprimary-navigation nav-color d-lg-none > nav classnavbar navbar-expand-lg p-0 nav-color> div classcontainer p-0> div classcollapse navbar-collapse idnavbarTogglerDemo01> ul classnavbar-nav me-auto mb-2 mb-lg-0> li classnav-item active > a classnav-link nav-text-color hrefindex.php> Homepage /a> /li> li classnav-item > a classnav-link nav-text-color hrefcart> My Goods /a> /li> li classnav-item > a classnav-link nav-text-color hrefcontact> Support /a> /li> li classnav-item dropdown> a classnav-link nav-text-color dropdown-toggle href# data-bs-toggledropdown aria-expandedfalse> Latest Products /a> ul classnav-color dropdown-menu> li classdropdown-item> a class hrefproduct/metal-clad-cable-connectors-%E2%80%93-(60-pack)> Metal-Clad Cable Connectors – (60 Pack) /a> /li> li classdropdown-item> a class hrefproduct/15a-decorator-usb-c-duplex-receptacle-outlet> 15A Decorator USB-C Duplex Receptacle Outlet /a> /li> li classdropdown-item> a class hrefproduct/10-gauge-50ft-tinned-copper-parallel-wire> 10-Gauge 50FT Tinned Copper Parallel Wire /a> /li> li classdropdown-item> a class hrefproduct/black-open-splice-junction-box-%E2%80%93-10-pack> Black Open Splice Junction Box – 10 Pack /a> /li> li classdropdown-item> a class hrefproduct/rv-air-conditioner-motor-with-capacitor> RV Air Conditioner Motor with Capacitor /a> /li> /ul> /li> li classnav-item > a classnav-link nav-text-color hrefshop> Commerce /a> /li> li classnav-item wish-list-icon d-lg-none> a hrefwishlist class nav-icon-color text-base>i classbi bi-heart>/i>/a> /li> /ul> /div> /div> /nav> /div> /div> /div> /header> /section>section classZKoMJKCDzOx pt-0 GOmwfcVo> div classrow p-0 m-0> div classcol-12 col-md-6 p-0 m-0 position-relative overlay-background> img classimage1 srcimg/iEFjOh2Q22ZBlGIp6PCdjvxqfhNnYtJFFhVXBB8L.jpg alt> div classcontentbox> div> h4 classbrandName text-xl>Bright Current Power Hub/h4> p classtagline text-md>Where Style Meets Savings./p> a classbutton-primary mt-3 text-sm styledisplay: inline-block;padding: 13px 20px;min-height: 40px;text-align: center; width:unset hrefshop.php>View Product/a> /div> /div> /div> div classcol-12 col-md-6 p-0 m-0 position-relative overlay-background > img classimage2 srcimg/KqTBgKFN4qVEmXIiZqAVljFlvjW0jw8bGiFdOnbg.jpg alt> div classcontentbox> div> h4 classbrandName text-xl>Bright Current Power Hub/h4> p classtagline text-md>Empowering your shopping experience, one bright current at a time./p> a classbutton-primary mt-3 text-sm styledisplay: inline-block;padding: 13px 20px;min-height: 40px;text-align: center; width:unset hrefshop.php>View Product/a> /div> /div> /div> /div>/section>section classprodcatnav17 GOmwfcVo section-max-width styleoverflow:hidden;> div classrelative max-w-screen-xl mx-auto py-10 px-4> div classswiper mySwiperMainCategory> div classswiper-wrapper> div classswiper-slide> div class flex flex-col > a hrefproduct-category/electrical-boxes-&-component-mounting> img src./config/images/products/3.png altSurface Mount Component Organizer Box classimg-fluid> h5 classprodtitle1 d-flex text-base>Electrical Boxes & Component Mounting span classiconLibrary17> i classbi bi-arrow-right>/i> /span> /h5> /a> /div> /div> div classswiper-slide> div class flex flex-col > a hrefproduct-category/power-&-outlet-devices> img src./config/images/products/5.png alt20A-GFCI Electrical Outlet – 2-Pack classimg-fluid> h5 classprodtitle1 d-flex text-base>Power & Outlet Devices span classiconLibrary17> i classbi bi-arrow-right>/i> /span> /h5> /a> /div> /div> div classswiper-slide> div class flex flex-col > a hrefproduct-category/electrical-wiring-&-cable-solutions> img src./config/images/products/10.png altMetal-Clad Cable Connectors – (60 Pack) classimg-fluid> h5 classprodtitle1 d-flex text-base>Electrical Wiring & Cable Solutions span classiconLibrary17> i classbi bi-arrow-right>/i> /span> /h5> /a> /div> /div> /div> div classswiper-button-next swiper-button-next-cat17 > /div> div classswiper-button-prev swiper-button-prev-cat17 > /div> /div> /div>/section>div idproductContainer>/div>section classabout03 GOmwfcVo> div classcontainer > div classrow> div class col-12 col-md-6 col-lg-4 p-0> div classleft-about-content> /div> /div> div classcol-12 col-md-6 col-lg-8 RightContainer03> div classright-about-content> h2 classtext-xl>Your Gateway to Innovation and Quality/h2> p classtext-md>Welcome to Bright Current Power Hub, your one-stop shop for all your electrical needs! Were a team of passionate individuals who are dedicated to providing top-quality C - Electrical Parts & Equipment. Our goal is to make your shopping experience easy and enjoyable, so kick back, relax, and let us take care of your power needs./p> a classbutton-primary mt-3 text-sm styledisplay: inline-block;padding: 13px 20px;min-height: 50px;text-align: center; display: inline-block;width:unset hrefshop>View Product/a> /div> /div> /div> /div>/section>footer classfooter35 footer-background-color idfooter> div classcontainer> div classrow pb-lg-5 pb-1 firstSec> div classcol-lg-3 col-md-6 col-12> div classmb-5 mb-md-4> h5 class text-md>COMPANY/h5> div> ul> li class text-base>Bright Current Power Hub/li> li class text-base>Sweetest Deals, LLC/li> li class text-base style word-break: break-all;>6525 Tara Blvd Suite F9 STE 1001, Jonesboro, GA, 30236, USA/li> /ul> /div> div classfooter-cc mt-2> /div> /div> /div> div classcol-lg-3 col-md-6> div classmb-5 mb-lg-0> h5 class text-md>SHOP/h5> div> ul> li> a class text-base hrefshop>Market/a> /li> li> a class text-base hrefcart>My Goods/a> /li> /ul> /div> /div> /div> div classcol-lg-3 col-md-6 col-12> div classmb-5 mb-md-4> h5 class text-md>ABOUT/h5> div class> ul> li> a classtext-base hrefindex.php>Homepage/a> /li> li> a classtext-base hrefprivacy>Privacy Policy/a> /li> li> a classtext-base hrefterms>Terms Compliance/a> /li> li> a classtext-base hrefcontact>Support Center/a> /li> /ul> /div> /div> /div> div classcol-lg-3 col-md-6 col-12> div classmb-5 mb-md-4 > h5 class text-md>SUPPORT/h5> div> p class text-base> a class href/cdn-cgi/l/email-protection#21525451514e53556143534846495542545353444f55514e5644534954430f424e4c style word-break: break-all;>span class__cf_email__ data-cfemail582b2d2828372a2c183a2a313f302c3b2d2a2a3d362c28372f3d2a302d3a763b3735>email protected/span>/a> /p> p class text-base> a class hreftel:(855) 549-2103>(855) 549-2103/a> /p> p class text-base>8 am to 4 pm | Mon - Fri/p> /div> /div> /div> /div> /div> div class> div classcontainer > div classrow pb-2 > div classcol-12 text-center> div classmb-1> ul classlistitem> li> a class text-base hrefterms>Terms Compliance/a> /li> li> a class text-base hrefprivacy>Privacy Policy/a> /li> /ul> /div> /div> div classcol-12 text-center> div classmb-lg-0> p class text-base>© 2025 Bright Current Power Hub. All Rights Reserved/p> /div> /div> /div> /div> /div>/footer> div classmodal fade emailpop5 idmarketingPopup> div classmodal-dialog modal-lg> div classmodal-content p-0 styleborder:none;> div classmodal-header styleborder-bottom:none;> button typebutton classclosebtn data-bs-dismissmodal aria-labelClose> span aria-hiddentrue classtext-base stylecolor:#000;> i classbi bi-x-lg>/i> /span> /button> /div> div classmodal-body > div classrow m-0 > div classcol-12 p-0 m-0 > div classimagBackground> /div> /div> div classcol-12 p-0 m-0> div classrightContainer > h1 classtitleContents text-xl>Save More. Shop More./h1> p idbtn1 classparatext text-base>Join the list and get instant savings on your next order./p> form classform idmarketingPopupForm> div classform-group> input typetext classform-control emailinput text-base required idname placeholderName> input typeemail classform-control emailinput text-base required idemail placeholderEmail Address> span classtext-danger error-email text-base styledisplay: none;>Email is required/span> button typesubmit idsaveButton classbutton-primary w-100 mt-2 text-sm styledisplay: flex;justify-content: center;align-items: center;padding: 12px;min-height: 45px;>Subscribe/button> /div> p idbtn1 classparatext mt-3 text-base>By entering your email, you agree to our a hrefprivacy.php stylecolor: blue;>Privacy Policy/a>./p> /form> /div> /div> /div> /div> /div> /div>/div> section> div idCookieBanner classsection-consent4 > p class text-base>By using our site, you agree to our use of cookies. Learn more about how we use them to enhance your browsing experience./p> div classbtn-container styledisplay: flex;gap: 20px;justify-content: center;> button classbutton-primary buttoncookies4 text-sm onclickacceptCookies() stylewidth:unset;padding: 12px;min-height: 50px;>Accept Cookies/button> button classbutton-primary buttoncookies4 text-sm onclickrejectCookies() stylewidth:unset;padding: 12px;min-height: 50px;>Reject Cookies/button> button classcross-btn text-base onclickrejectCookies()> /button> /div> /div>/section> div classmodal fade idquickViewModal tabindex-1 aria-labelledbyquickViewModalLabel aria-hiddentrue> div classmodal-dialog modal-lg> div classmodal-content > div classmodal-header> h5 classmodal-title text-center idquickViewModalLabel>/h5> button typebutton classbtn-close data-bs-dismissmodal aria-labelClose>/button> /div> div classmodal-body> div classrow idquickViewModalContent> /div> /div> /div> /div> /div> script data-cfasyncfalse src/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js>/script>script srchttps://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js>/script> script typetext/javascript src./config/js/include/index.js>/script> script typetext/javascript src./config/js/include/custom.js>/script> script typetext/javascript srchttps://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js>/script> script srcjs/wow.min.js>/script> script> new WOW().init(); /script> script srchttps://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.1/TweenMax.min.js> /script> style>@import url(https://fonts.googleapis.com/css2?familyFigtree:ital,wght@0,300..900;1,300..900&displayswap);/style>style>@import url(https://fonts.googleapis.com/css2?familyUltra&displayswap);/style>style> *{ font-family: Figtree, sans-serif; } h1, h2, h3, h4, h5, h6 { font-family: Ultra, sans-serif; }/style> script> function cookiesResponse(cookieResponse){ $.ajax({ url: config/ajax.php?actioncookie_response, type: POST, data: { cookieResponse: cookieResponse }, success: function(response) { if(response){ $(#CookieBanner).hide(); } localStorage.setItem(cookie_answer,1); }, error: function(xhr, status, error) { alert(An error occurred: + xhr.responseText); } }); } function closeBanner() { $(#CookieBanner).hide(); localStorage.setItem(cookie_answer,1); } function acceptCookies() { $(#CookieBanner).hide(); cookiesResponse(accept); } function rejectCookies() { $(#CookieBanner).hide(); cookiesResponse(reject); } $(document).ready(function() { $(#loadingMask).fadeOut(); $(#marketingPopup .close).click(function() { setCookieWithExpiration(Bright Current Power Hub-marketingPopupShown, 1, 1440 * 60); // set cookie for one day $(#marketingPopup).modal(hide); // Manually close the modal }); let showPopup 1; let showPopupOption scroll; let showPopupValue ; let showPopupScrollValue 2; if(!localStorage.getItem(Bright Current Power Hub-marketingPopup) && getCookie(Bright Current Power Hub-marketingPopupShown) null && showPopup 1){ if(showPopupOption time){ setTimeout(() > { $(#marketingPopup).modal(show) }, showPopupValue * 1000); }else{ var desiredDepthPercentage showPopupScrollValue; // Adjust this value as needed // Function to show the popup when the user scrolls to the desired depth percentage $(window).scroll(function() { var windowHeight $(window).height(); var documentHeight $(document).height(); var scrollDepth (documentHeight - windowHeight) * (desiredDepthPercentage / 100); if ($(window).scrollTop() > scrollDepth) { $(#marketingPopup).modal(show) // You may also want to unbind the scroll event after showing the popup $(window).off(scroll); } }); } } $(#marketingPopupForm).on(submit, function(event) { event.preventDefault(); $(.error-message).hide(); var email $(#email).val().trim(); var isValid true; if (email ) { $(.email-error).show(); isValid false; } if (isValid) { submitMarketingForm(); } }); if(localStorage.getItem(cookie_answer)){ $(#cookieBanner).hide(); } }); function submitMarketingForm(){ var formData { email: $(#email).val() }; $.ajax({ url: config/ajax.php?actionmarketing_popup, type: POST, data: { formData: formData }, success: function(response) { if(response){ $(#marketingPopup).modal(hide); localStorage.setItem(Bright Current Power Hub-marketingPopup,1); } }, error: function(xhr, status, error) { alert(An error occurred: + xhr.responseText); } }); } /script> script srchttps://code.jquery.com/jquery-3.6.4.min.js>/script> script srchttps://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js>/script> script srchttps://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js>/script> script srcscript.js>/script>script srcconfig/js/site_custom.js>/script>script> /script>script> const productsPerPage 10; let currentPage 1; let isLoading false; // Prevent multiple AJAX calls let paginationType infinite_scroll; loadProducts(paginationType none ? 1 : currentPage, false, paginationType none); function loadProducts(page 1, append false, fetchAll false) { if (isLoading) return; isLoading true; // Set loading state let requestData fetchAll ? { all: true } : { page, limit: productsPerPage }; // Get the current URL search parameters const urlParams new URLSearchParams(window.location.search); // Check if sort parameter exists or if you want to add all parameters if (urlParams.has(sort) || true) { // Remove || true if you only want to add when sort exists // Object to hold grouped parameters (for arrays) const groupedParams {}; // Group parameters that end with (array parameters) urlParams.forEach((value, key) > { // Check if this is an array parameter (ends with ) const isArrayParam key.endsWith(); const baseKey isArrayParam ? key.slice(0, -2) : key; if (isArrayParam) { // Initialize array if not exists if (!groupedParamsbaseKey) { groupedParamsbaseKey ; } // Add the value to the array groupedParamsbaseKey.push(value); } else { // For non-array parameters, just add the value if (!groupedParamskey) { groupedParamskey value; } } }); // Merge the grouped parameters into requestData Object.assign(requestData, groupedParams); } // Show the loading spinner inside the product section $(#loading-spinner).show(); $.ajax({ url: fetch_products.php, type: POST, data: requestData, success: function(response) { const data JSON.parse(response); $(.load-more-div).remove(); if (append) { $(.product-wrapper).append(data.html); } else { $(#productContainer).html(data.html); } console.log(page,page); // Hide the loading spinner $(#loading-spinner).hide(); if (!fetchAll) { currentPage page + 1; $(#load-more).attr(data-page, currentPage); } // Generate pagination numbers if pagination type is number // if (paginationType number) { // generatePaginationNumbers(page, data.totalPages); // } $(#productContainer).trigger(productsLoaded); if(page data.totalPages){ isLoading false; // Reset loading state } }, error: function(xhr, status, error) { console.error(AJAX Error:, error); // Hide the loading spinner in case of error $(#loading-spinner).hide(); isLoading false; // Reset loading state } }); } // Function to check if sort parameters exist in the URL function hasSortParameters() { const urlParams new URLSearchParams(window.location.search); // List of sort-related parameters you want to check const sortParams sort, order, sort_by, order_by; // Add any other sort params you use return sortParams.some(param > urlParams.has(param)); } if(infinite_scroll infinite_scroll){ // Infinite Scroll // Function to check if the product section is visible function isProductSectionInView() { const productWrapper $(.product-wrapper); if (productWrapper.length 0) return false; const windowHeight $(window).height(); const scrollTop $(window).scrollTop(); const elementOffset productWrapper.offset().top; const elementHeight productWrapper.outerHeight(); return scrollTop + windowHeight > elementOffset + elementHeight + 200; } // Scroll event to load more products when near the product section $(window).on(scroll, function() { if (!hasSortParameters() && isProductSectionInView()) { loadProducts(currentPage, true); } }); }else if(infinite_scroll load_button){ // Load More Button Click $(document).on(click, #load-more, function() { let nextPage $(this).attr(data-page) || 1; loadProducts(parseInt(nextPage), true); }); }else if(infinite_scroll number){ // function generatePaginationNumbers(currentPage, totalPages) { // const paginationContainer $(div classpagination-container>/div>); // const paginationList $(ul classpagination>/ul>); // // Add Previous button // if (currentPage > 1) { // paginationList.append(` // li classpage-item> // a href# classpage-link-btn page-link data-page${currentPage - 1}>Previous/a> // /li> // `); // } // // Add page numbers // for (let i 1; i totalPages; i++) { // const isActive i currentPage ? btn-primary : btn-secondary; // paginationList.append(` // li classpage-item> // a href# classpage-link-btn btn ${isActive} data-page${i}>${i}/a> // /li> // `); // } // // Add Next button // if (currentPage totalPages) { // paginationList.append(` // li classpage-item> // a href# classpage-link-btn page-link data-page${currentPage + 1}>Next/a> // /li> // `); // } // // Append pagination to the container // paginationContainer.append(paginationList); // $(#productContainer).append(paginationContainer); // } // Handle click events on pagination numbers $(document).on(click, .page-link-btn, function(e) { e.preventDefault(); const page $(this).data(page); loadProducts(page); }); } var quickViewProdId ; function ProductQuickView(index,id) { $(#quickViewModalContent).html(); $.ajax({ url: product_quick_view.php, type: POST, data: { productId: index}, success: function(response) { const data JSON.parse(response); $(#quickViewModalContent).html(data.html); $(#quickViewModal).modal(show); const $product $(`data-product-id${id}`); quickViewProdId id; initProduct($product,id); }, error: function(xhr, status, error) { console.error(AJAX Error:, error); } }); } // Clear modal content & remove product data on modal close $(#quickViewModal).on(hidden.bs.modal, function () { $(#quickViewModalContent).empty(); // Clear modal removeProductFromSessionStorage(quickViewProdId); // Remove product from storage quickViewProdId ; }); $(document).ready(function() { // Handle form submission $(#subscription-form).on(submit, function(e) { e.preventDefault(); // Prevent the default form submission // You can add form validation here if needed // Simulate an AJAX call (replace this with your actual AJAX call) // For demonstration, well just show the success message after a short delay setTimeout(function() { // Hide the form $(#subscription-form).hide(); // Show success message $(#success-message).show(); // Scroll to the newsletter section scrollToSection(#newsletter, 3); }, 500); }); // Robust scrolling function with retry capability function scrollToSection(selector, retriesLeft) { const element $(selector); if (element.length > 0 && element.is(:visible)) { const offset 100; // Adjust as needed const position element.offset().top - offset; $(html, body).stop(true).animate({ scrollTop: position }, { duration: 800, easing: swing, complete: function() { console.log(Successfully scrolled to section); } }); } else if (retriesLeft > 0) { console.log(Element not ready, retrying...); setTimeout(function() { scrollToSection(selector, retriesLeft - 1); }, 500); } else { console.error(Failed to scroll to section after multiple attempts); } } $(document).on(submit, #filterSortForm, function(event) { event.preventDefault(); // Prevent the default form submission // Use serializeArray() instead of serialize() to properly handle arrays var formDataArray $(this).serializeArray(); var formData $.param(formDataArray); // This properly handles arrays var newUrl window.location.pathname + ? + formData; // Change the URL without reloading the page history.pushState(null, , newUrl); isLoading false; loadProducts(currentPage-1,false) }); }); /script>script srchttps://cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs@3/dist/fp.min.js>/script>script>const fpPromise FingerprintJS.load();fpPromise.then(fp > fp.get()).then(result > { const visitorId result.visitorId; // Send visitorId to the server via AJAX fetch(store_visitor.php, { method: POST, headers: { Content-Type: application/json, }, body: JSON.stringify({ visitorId: visitorId }), }) .then(response > response.json()) .then(data > { console.log(data.message); // Success or error message }) .catch(error > { console.error(Error:, error); });});/script>script>// Get all products data from session storagefunction getAllProductsData() { return JSON.parse(sessionStorage.getItem(productsData)) || {};}// Get specific product data by IDfunction getProductData(productId) { const products getAllProductsData(); return productsproductId || null;}// Use a structured approach:function updateProductSessionData(productId, data) { // Get existing products data or initialize empty object const productsData JSON.parse(sessionStorage.getItem(productsData)) || {}; // Initialize this products data if it doesnt exist if (!productsDataproductId) { productsDataproductId {}; } // Merge new data with existing data productsDataproductId { ...productsDataproductId, ...data }; // Save back to sessionStorage sessionStorage.setItem(productsData, JSON.stringify(productsData));}// Helper function to remove product from sessionStoragefunction removeProductFromSessionStorage(productKey) { // 1. Get current data const storedData sessionStorage.getItem(productsData); if (!storedData) return; try { // 2. Parse and verify structure const productsData JSON.parse(storedData); if (typeof productsData ! object || Array.isArray(productsData)) { throw new Error(Expected an object, got something else); } // 3. Delete the key if it exists if (productsDataproductKey) { delete productsDataproductKey; // 4. Save back to sessionStorage sessionStorage.setItem(productsData, JSON.stringify(productsData)); console.log(Removed:, productKey); // Debug log } } catch (e) { console.error(Error updating sessionStorage:, e); }}// Main document ready handler$(document).ready(function() { // Initialize each product $(.product-detail-section).each(function() { const $product $(this); const productId $product.data(product-id); // Initialize product-specific functionality initProduct($product, productId); });});/script>script> //fetch size options for each products var variantsArray ; $(document).ready(function() { var displayVariantType dropdown; // Remove any existing handlers first $(document).off(change, .proSize-ul inputtyperadio, .proSize-ul select, .proSize-ul inputtypetext); $(document).on(change, .proSize-ul inputtyperadio, .proSize-ul select, .proSize-ul inputtypetext, function() { const $product $(this).closest(.product-detail-section); const productId $product.data(product-id); const productData getProductData(productId); if(displayVariantType dropdown){ var size_val $product.find(.proSize-ul select) .map(function() { return $(this).find(option:selected).val(); }) .get() .filter(function(id) { return id; // Exclude null or empty IDs }) .join(-); var size_key $product.find(.proSize-ul select) .map(function() { return $(this).find(option:selected).attr(data-size); }) .get() .filter(function(id) { return id; // Exclude null or empty IDs }) .join(-); }else if(displayVariantType counter){ var size_val $product.find(.proSize-ul inputtypetext).map(function() { return $(this).data(value); }).get().join( - ); var size_key $product.find(.proSize-ul inputtypetext).map(function() { return $(this).data(size); }).get().join(-); }else{ var size_val $product.find(.proSize-ul inputtyperadio:checked).map(function() { return $(this).val(); }).get().join( - ); var size_key $product.find(.proSize-ul inputtyperadio:checked).map(function() { return $(this).attr(data-size); }).get().join(-); } updateProductSessionData(productId, { data_product_selected_size: size_val, data_product_selected_size_key: size_key }); $product.find(.pdt-button).find(button).prop(disabled,true); var displayVariantType dropdown; if(displayVariantType dropdown){ // Handle dropdowns var selectedId $(this).find(option:selected).attr(data-id); $product.find(.proSize-ul select).find(option).removeAttr(disabled); }else{ // Collect selected variation IDs var selectedId $(this).attr(data-id); $product.find(.proSize-ul inputtyperadio).removeAttr(disabled); } // console.log(selectedId,selectedId); var prod_id_inner productData.id; var prod_index productData.index; sale_type productData.data_sale_type; sale_type parseInt(sale_type); console.log(sale_type); if(sale_type 1 && no yes){ $.ajax({ url: config/config.php, type: POST, data: { type: 9, prod_id_inner: prod_id_inner, prod_index:prod_index, variation_id: selectedId }, cache: false, success: function(result) { var response JSON.parse(result); if(response.length 0){ getSelectedVariationsAndPrice($product,productId); }else{ // response is the list of variation IDs to disable response.forEach(function(variationID) { // Find input fields with the matching data-id and disable them if(displayVariantType dropdown){ // Handle dropdowns $product.find(select optiondata-id + variationID + ) .prop(disabled, true) .prop(selected, false); }else{ // Collect selected variation IDs $product.find(inputdata-id + variationID + ) .prop(disabled, true) .prop(checked, false); } }); } } }); }else{ getSelectedVariationsAndPrice($product,productId); } }); $(document).off(change, .prod-optionstypecheckbox); $(document).on(change, .prod-optionstypecheckbox, function() { const $product $(this).closest(.product-detail-section); const productId $product.data(product-id); const productData getProductData(productId); const value $(this).attr(value); // Get group value const isChecked $(this).is(:checked); // Check if the clicked option is checked var currentPriceType $(this).attr(data-price-type); // Get the price type (fixed/percentage) var productPrice productData.data_product_price_variant; let price value; if (isChecked) { if (currentPriceType percentage) { price (price / 100) * parseFloat(productPrice); } var subTotalPrice parseFloat($product.find(.subtotal_price).text()); // Convert to float var pdtPrice subTotalPrice + parseFloat(price); // Ensure value is also a number $product.find(.subtotal_price).text(pdtPrice.toFixed(2)); if(parseInt($product.find(.qty).val()) > 1){ $product.find(.single_pdt_price).text( (parseInt($product.find(.qty).val()) * $product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); }else{ $product.find(.single_pdt_price).text(($product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); } updateProductSessionData(productId, { data_product_price: pdtPrice, data_total_price: pdtPrice, }); } else { var subTotalPrice parseFloat($product.find(.subtotal_price).text()); // Convert to float if (currentPriceType percentage) { price (price / 100) * parseFloat(productPrice); } var pdtPrice subTotalPrice - parseFloat(price); // Ensure value is also a number $product.find(.subtotal_price).text(pdtPrice.toFixed(2)); if(parseInt($product.find(.qty).val()) > 1){ $product.find(.single_pdt_price).text( (parseInt($product.find(.qty).val()) * $product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); }else{ $product.find(.single_pdt_price).text(($product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); } updateProductSessionData(productId, { data_product_price: pdtPrice, data_total_price: pdtPrice, }); } var optionsValue $product.find(.prod-optionstypecheckbox:checked, .prod-optionstyperadio:checked) .map(function() { return $(this).attr(data-value); }) .get() .join(,); updateProductSessionData(productId, { data_product_selected_option: optionsValue, }); }); let previousValues {}; $(document).off(change, .prod-optionstyperadio); $(document).on(change, .prod-optionstyperadio, function() { const $product $(this).closest(.product-detail-section); const productId $product.data(product-id); const productData getProductData(productId); var currentRadioValue $(this).val(); // The value of the newly selected radio button var groupName $(this).attr(name); // Get the name of the radio group (this groups them) var currentPriceType $(this).attr(data-price-type); // Get the price type (fixed/percentage) var productPrice productData.data_product_price_variant; // If there is a previous value for this group if (previousValuesgroupName ! undefined) { var previousRadioButton $product.find(inputtyperadioname + groupName + value + previousValuesgroupName + ); // If there was a previous selection, subtract its price if (previousRadioButton.length > 0) { var prevPrice parseFloat(previousRadioButton.val()); var prevPriceType previousRadioButton.attr(data-price-type); // Adjust subtotal based on the previous price type if (prevPriceType percentage) { prevPrice (prevPrice / 100) * parseFloat(productPrice); } var subTotalPrice parseFloat($product.find(.subtotal_price).text()); var pdtPrice subTotalPrice - parseFloat(prevPrice); // Subtract previous selected options price $product.find(.subtotal_price).text(pdtPrice.toFixed(2)); // Update subtotal price } } // Add the price of the newly selected radio button var currentPrice parseFloat($(this).val()); if (currentPriceType percentage) { currentPrice (currentPrice / 100) * parseFloat(productPrice); } var subTotalPrice parseFloat($product.find(.subtotal_price).text()); var pdtPrice subTotalPrice + parseFloat(currentPrice); // Add the new selected radio options price $product.find(.subtotal_price).text(pdtPrice.toFixed(2)); // Update subtotal price if(parseInt($product.find(.qty).val()) > 1){ $product.find(.single_pdt_price).text( (parseInt($product.find(.qty).val()) * $product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); }else{ $product.find(.single_pdt_price).text(($product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); } // Update session storage with the new price updateProductSessionData(productId, { data_product_price: pdtPrice, data_total_price: pdtPrice }); var optionsValue $(.prod-optionstypecheckbox:checked, .prod-optionstyperadio:checked) .map(function() { return $(this).attr(data-value); }) .get() .join(,); updateProductSessionData(productId, { data_product_selected_option: optionsValue, }); sessionStorage.setItem(data_product_selected_option, optionsValue); // Store the current selected radio button value to use as the previous value for next change previousValuesgroupName currentRadioValue; }); }); function fetchSizes($product, productId) { const productData getProductData(productId); var checksizeoption productData.sizeOption; var prod_id_inner productData.id; var prod_index productData.index; var displayVariantType dropdown; if (checksizeoption yes) { $.ajax({ url: config/config.php, type: POST, data: { type: 5, prod_id_inner: prod_id_inner, prod_index:prod_index }, cache: false, success: function(result) { // console.log(result); $product.find(p.proSize-ul).html(result); var size_val $product.find(.first-size-option).val(); var size_key $product.find(.first-size-option).attr(data-size); updateProductSessionData(productId, { data_product_selected_size: size_val, data_product_selected_size_key: size_key, data_product_shipping: 0 }); // Trigger the change event only once for the first checked input if(displayVariantType dropdown){ const firstSelectedDropdown $product.find(.proSize-ul select).filter(function() { return $(this).val() ! && $(this).val() ! null; }).first(); var firstCheckedInput firstSelectedDropdown.find(option:selected); }else if(displayVariantType counter){ var firstCheckedInput $product.find(.proSize-ul inputtypetext).first(); }else{ var firstCheckedInput $product.find(.proSize-ul inputtyperadio:checked).first(); } if (firstCheckedInput.length) { firstCheckedInput.trigger(change); } } }); }else{ $product.find(div.size-options-text).hide(); $product.find(div.size-opts).hide(); updateProductSessionData(productId, { data_product_selected_size: , data_product_selected_size_key: }); } } function priceFixesAccordingToBilling($product, productId) { const productData getProductData(productId); var bill_model productData.billingModel; if(bill_model 8){ $max_qty productData.trialMaxqty; $is_show_max_qty productData.trialMaxqty; }else{ $max_qty productData.maxQuantity; $is_show_max_qty productData.enableMaxqty; } var max_qty $max_qty; var is_show_max_qty $is_show_max_qty; $product.find(.pdt-button).find(button).prop(disabled,true); // Run Preloader $(#loadingMask).fadeIn(); if (bill_model 4 || bill_model 5 || bill_model 6 || bill_model 7) { var subtotal $(span.subtotal_price).html(); var shipping $(span.shipping_price).html(); var total $(span.single_pdt_price).html(); updateProductSessionData(productId, { data_product_price: subtotal, data_product_shipping: shipping, data_total_price: total, data_product_type: , }); } else { updateProductSessionData(productId, { data_product_type: , }); } $(#loadingMask).fadeOut(); let getPdtType $product.find(.pdt_type+bill_model+ .selectbox).val(); if (getPdtType undefined && bill_model 1) { getPdtType 1; } if(getPdtType 1 && is_show_max_qty > 0){ if(max_qty 1){ $product.find(.qty-col .increase).prop(disabled, true); } $product.find(.qty-col).css(display, flex); $product.find(.select-qty-text).css(display, block); }else{ $product.find(.qty-col).css(display, none); $product.find(.select-qty-text).css(display, none); } setTimeout(function(){ getSelectedVariationsAndPrice($product,productId); },2000); } function getSelectedVariationsAndPrice($product, productId) { const productData getProductData(productId); var displayVariantType dropdown; if(displayVariantType dropdown){ // Handle dropdowns var selectedIds $product.find(.proSize-ul select) .map(function() { return $(this).find(option:selected).attr(data-id); }) .get() .filter(function(id) { return id; // Exclude null or empty IDs }) .join(,); }else if(displayVariantType counter){ var selectedIds $product.find(.proSize-ul inputtypetext).map(function() { return $(this).data(id); }).get().join(,); }else{ // Collect selected variation IDs var selectedIds $product.find(.proSize-ul inputtyperadio:checked).map(function() { return $(this).attr(data-id); }).get().join(,); } var checksizeoption productData.sizeOption; var prod_id_inner productData.id; var prod_index productData.index; sale_type productData.data_sale_type; sale_type parseInt(sale_type); if(sale_type 1){ $.ajax({ url: config/config.php, type: POST, data: { type: 7, prod_id_inner: prod_id_inner, prod_index:prod_index, variation_ids: selectedIds }, cache: false, success: function(result) { var response JSON.parse(result); if(no yes && responsepdt_price > 0){ $product.find(.subtotal_old_price).show(); $product.find(span.subtotal_old_price_symbol).show(); $product.find(.subtotal_price).text(responsepdt_price); $product.find(.subtotal_old_price).text(responsepdt_old_price); }else{ $product.find(.subtotal_old_price).hide(); $product.find(span.subtotal_old_price_symbol).hide(); $product.find(.subtotal_price).text(responsepdt_old_price); responsepdt_price responsepdt_old_price; } $product.find(.subtotal_price).text(responsepdt_price); if(responsepdt_sku ! && responsepdt_sku ! null){ $product.find(.product-sku).text(responsepdt_sku); $product.find(.sku-col).show(); }else if((responsepdt_sku || responsepdt_sku null) && selectedIds ! ){ $product.find(.product-sku).text(); $product.find(.sku-col).hide(); } updateProductSessionData(productId, { data_product_price_variant: responsepdt_price, }); var subtotal parseFloat($product.find(.subtotal_price).text()); // Current subtotal price // Sum for checkboxes var selectedValuesSumCheckbox $product.find(.prod-optionstypecheckbox:checked).map(function () { var value parseFloat($(this).val()); // Get the value var priceType $(this).attr(data-price-type); // Get the price type (fixed/percentage) if (priceType percentage) { return (value / 100) * subtotal; // Calculate percentage of the subtotal } else { return value; // Fixed price } }).get().reduce(function (acc, value) { return acc + value; // Sum all the selected values }, 0); // Sum for radio buttons var selectedValuesSumRadio $product.find(.prod-optionstyperadio:checked).map(function () { var value parseFloat($(this).val()); // Get the value var priceType $(this).attr(data-price-type); // Get the price type (fixed/percentage) if (priceType percentage) { return (value / 100) * subtotal; // Calculate percentage of the subtotal } else { return value; // Fixed price } }).get().reduce(function (acc, value) { return acc + value; // Sum all the selected values }, 0); if(selectedValuesSumCheckbox > 0){ responsepdt_price (parseFloat(responsepdt_price) + parseFloat(selectedValuesSumCheckbox.toFixed(2))).toFixed(2); } if(selectedValuesSumRadio > 0){ responsepdt_price (parseFloat(responsepdt_price) + parseFloat(selectedValuesSumRadio.toFixed(2))).toFixed(2); } $product.find(.subtotal_price).text(responsepdt_price); if(parseInt($product.find(.qty).val()) > 1){ $product.find(.single_pdt_price).text( (parseInt($product.find(.qty).val()) * $product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); }else{ $product.find(.single_pdt_price).text(($product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); } updateProductSessionData(productId, { data_product_price: response.pdt_price, data_total_price : response.pdt_price }); $product.find(.pdt-button).find(button).prop(disabled,false); } }); }else{ var subtotal parseFloat($product.find(.subtotal_price).text()); // Current subtotal price updateProductSessionData(productId, { data_product_price_variant: subtotal, }); // Sum for checkboxes var selectedValuesSumCheckbox $product.find(.prod-optionstypecheckbox:checked).map(function () { var value parseFloat($(this).val()); // Get the value var priceType $(this).attr(data-price-type); // Get the price type (fixed/percentage) if (priceType percentage) { return (value / 100) * subtotal; // Calculate percentage of the subtotal } else { return value; // Fixed price } }).get().reduce(function (acc, value) { return acc + value; // Sum all the selected values }, 0); // Sum for radio buttons var selectedValuesSumRadio $product.find(.prod-optionstyperadio:checked).map(function () { var value parseFloat($(this).val()); // Get the value var priceType $(this).attr(data-price-type); // Get the price type (fixed/percentage) if (priceType percentage) { return (value / 100) * subtotal; // Calculate percentage of the subtotal } else { return value; // Fixed price } }).get().reduce(function (acc, value) { return acc + value; // Sum all the selected values }, 0); if(selectedValuesSumCheckbox > 0){ var currentPrice parseFloat(selectedValuesSumCheckbox); var subTotalPrice parseFloat($product.find(.subtotal_price).text()); var pdtPrice subTotalPrice + currentPrice; // Add the new selected radio options price $product.find(.subtotal_price).text(pdtPrice.toFixed(2)); // Update subtotal price if(parseInt($product.find(.qty).val()) > 1){ $product.find(.single_pdt_price).text( (parseInt($product.find(.qty).val()) * $product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); }else{ $product.find(.single_pdt_price).text(($product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); } // Update session storage with the new price updateProductSessionData(productId, { data_product_price: pdtPrice, data_total_price : pdtPrice }); } if(selectedValuesSumRadio > 0){ var currentPrice parseFloat(selectedValuesSumRadio); var subTotalPrice parseFloat($product.find(.subtotal_price).text()); var pdtPrice subTotalPrice + currentPrice; // Add the new selected radio options price $product.find(.subtotal_price).text(pdtPrice.toFixed(2)); // Update subtotal price if(parseInt($product.find(.qty).val()) > 1){ $product.find(.single_pdt_price).text( (parseInt($product.find(.qty).val()) * $product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); }else{ $product.find(.single_pdt_price).text(($product.find(.subtotal_price).text() * 1 + $product.find(.shipping_price).text() * 1).toFixed(2)); } // Update session storage with the new price updateProductSessionData(productId, { data_product_price: pdtPrice, data_total_price : pdtPrice }); } $product.find(.pdt-button).find(button).prop(disabled,false); } } function setSaleType($product, productId){ const productData getProductData(productId); var prod_id productData.data_product; var multiPrice productData.data_product_MultiPrice; var billmod productData.data_product_billing_model; if (billmod 4 || billmod 5 || billmod 6 || billmod 7) { if (billmod 4) { updateProductSessionData(productId, { data_sale_type: 2, }); var getid .pdt_type4; } if (billmod 5) { updateProductSessionData(productId, { data_sale_type: 1, }); var getid .pdt_type5; } if (billmod 6) { updateProductSessionData(productId, { data_sale_type: 2, }); var getid .pdt_type6; } if (billmod 7) { updateProductSessionData(productId, { data_sale_type: 1, }); var getid .pdt_type7; } //need to retreive which type of product is selected on page load and showing the plus minus button or dropdown var firstpdt $product.find(getid + option:first).val(); $product.find(.qty-col).css(display, flex); $product.find(.select-qty-text).css(display, block); // var isexectued; // for bill model 4,5,6,7 get the price and pass it to the next page $product.find(.selectbox).on(change, function() { var model_id $(this).val(); if (model_id 1) { updateProductSessionData(productId, { data_sale_type: 1, data_product_type: 1 }); } if (model_id 2) { updateProductSessionData(productId, { data_sale_type: 2, data_product_type: }); } if (model_id 3) { updateProductSessionData(productId, { data_sale_type: 3, data_product_type: }); } $.ajax({ url: config/config.php, type: POST, data: { type: 4, model_id: model_id, prod_id: prod_id, multiPrice: multiPrice, }, cache: false, success: function (data) { var response JSON.parse(data); var pdt_special_price parseFloat(response.pdt_special_price); var pdt_price parseFloat(response.pdt_price); var shipping_price parseFloat(response.shipping_price); if(no yes && pdt_special_price > 0){ $product.find(span.subtotal_old_price).show(); $product.find(span.subtotal_old_price_symbol).show(); var totalPrice pdt_special_price + shipping_price; $product.find(span.subtotal_price).html(pdt_special_price.toFixed(2)); $product.find(span.subtotal_old_price).html(pdt_price.toFixed(2)); $product.find(span.shipping_price).html(shipping_price.toFixed(2)); $product.find(span.single_pdt_price).html(totalPrice.toFixed(2)); updateProductSessionData(productId, { data_product_price: pdt_special_price, data_product_shipping: shipping_price, data_total_price : totalPrice }); }else{ $product.find(span.subtotal_old_price).hide(); $product.find(span.subtotal_old_price_symbol).hide(); var totalPrice pdt_price + shipping_price; $product.find(span.subtotal_price).html(pdt_price.toFixed(2)); $product.find(span.shipping_price).html(shipping_price.toFixed(2)); $product.find(span.single_pdt_price).html(totalPrice.toFixed(2)); updateProductSessionData(productId, { data_product_price: pdt_price, data_product_shipping: shipping_price, data_total_price : totalPrice }); } }, }); $product.find(.qty-col).css(display, flex); $product.find(.select-qty-text).css(display, block); //set if the product is ss or trl or cntnty if (model_id 1) { updateProductSessionData(productId, { data_sale_type: 1, }); } if (model_id 2) { updateProductSessionData(productId, { data_sale_type: 2, }); } if (model_id 3) { updateProductSessionData(productId, { data_sale_type: 3, }); } priceFixesAccordingToBilling($product, productId); }); } //set if the product is ss or trl or cntnty if (billmod 1) { updateProductSessionData(productId, { data_sale_type: 1, }); } else if (billmod 2 || billmod 8) { updateProductSessionData(productId, { data_sale_type: 2, }); } else if (billmod 3) { updateProductSessionData(productId, { data_sale_type: 3, }); } } function fetchOptions($product, productId) { const productData getProductData(productId); var prod_id_inner productData.id; var prod_index productData.index; $.ajax({ url: config/config.php, type: POST, data: { type: 8, prod_id_inner: prod_id_inner, prod_index:prod_index }, cache: false, success: function(result) { $product.find(p.proOption-ul).html(result); } }); } function handleQtyChange($product, productId, type) { var $qtyInput $product.find(.qty); const productData getProductData(productId); var bill_model productData.billingModel; if(bill_model 8){ $max_qty productData.trialMaxqty; }else{ $max_qty productData.maxQuantity; } //enable & disble qty in product & cart page depend on enableMaxqty key var max_qty $max_qty; let qty parseInt($qtyInput.val()); if (type increase) { qty++; } else if (type decrease && qty > 1) { qty--; } $qtyInput.val(qty); var billmodel productData.billingModel; $pdt_price parseFloat(productData.data_product_price); $tot_price parseFloat(productData.data_total_price); $pdt_qty parseFloat(qty); if (type increase) { $new_pdt_price $pdt_price * $pdt_qty if (qty max_qty) { $product.find(.qty-col .increase).attr(disabled, disabled); } if (qty > 1) { $product.find(.decrease).removeAttr(disabled); } }else{ $product.find(.qty-col .increase).removeAttr(disabled); $new_pdt_price $tot_price - $pdt_price; if (qty 1) { $product.find(.decrease).attr(disabled, disabled); } if (qty 2) { // $(.qty-col #decrease).css(display,none); $product.find(.decrease).prop(disabled, true); } } updateProductSessionData(productId, { data_total_price: $new_pdt_price.toFixed(2), data_pdt_qty: $pdt_qty, }); $product.find(.single_pdt_price).text($new_pdt_price.toFixed(2)); } function showErrorAttributes($product, productId){ const productData getProductData(productId); var not_selected {}; var displayVariantType dropdown; if(displayVariantType dropdown){ // Handle dropdowns $product.find(.proSize-ul select).each(function() { var name $(this).attr(name); if (!not_selectedname) { // If no value is selected in the dropdown if (!$(this).val() || $(this).val() ) { // Get the placeholder or label associated with the dropdown var placeholder $(this).find(option:first).val().split(:)0.trim(); not_selectedname placeholder || No selection; } } }); }else{ $product.find(.proSize-ul inputtyperadio).each(function() { var name $(this).attr(name); if (!not_selectedname) { // If the radio button is not checked and there are no checked radio buttons with the same name if (!$(this).prop(checked) && $product.find(inputname + name + :checked).length 0) { // Extract the text before the comma and trim whitespace var valueText $(this).val().split(:)0.trim(); not_selectedname valueText; } } }); } // Display name and value for each group for (var name in not_selected) { if (not_selected.hasOwnProperty(name)) { var errorMsg Please select the +not_selectedname+.; if(inline inline){ $product.find(.error-message-attr).append(div classerror-message stylefont-size:16px;>+errorMsg+/div>); }else if(inline popup){ $(#error_pop).append(errorMessageVariable.replace(errorMessageVariable, errorMsg)); } } } if(inline inline){ $product.find(.error-message).show(); }else if(inline popup){ $(#error_modal).show(); } } var shoppingCart ; function AddtoCart(productId) { // Scope all selectors to this specific product const $product $(`data-product-id${productId}`); const productData getProductData(productId); var enable_custom_checkout productData.enable_custom_checkout; var custom_checkout_link productData.custom_checkout_link; if(enable_custom_checkout yes){ window.location.href custom_checkout_link; return true; } $product.find(.error-message).remove(); var displayVariantType dropdown; if(productData.isProductAttributes > 0){ if(displayVariantType dropdown){ if(productData.isProductAttributes ! $product.find(.proSize-ul select).filter(function() { return $(this).val() ! null && $(this).val() ! ; }).length){ showErrorAttributes($product,productId); return true; } }else{ if(productData.isProductAttributes ! $product.find(.proSize-ul inputtyperadio:checked).length){ showErrorAttributes($product,productId); return true; } } } let errorMessages ; $product.find(.proOption-ul inputdata-requiredtrue).each(function () { let name $(this).attr(name); // Check if this group has already been validated if (!$product.find(`inputname${name}:checked`).length) { if (!errorMessages.includes(name)) { errorMessages.push(name); } } }); if (errorMessages.length > 0) { $product.find(.error-message-opt).html(div classerror-message stylefont-size:16px;>Please select required options./span>) $product.find(.error-message).show(); return true; } var data_qty $product.find(.qty).val(); var singleProduct {}; var bill_mod productData.billingModel; var selected_size_key productData.data_product_selected_size_key; console.log(selected_size_key,selected_size_key); //Fill the product object with data if(selected_size_key ! && 0 0){ singleProduct.Id productData.data_product_id + - + selected_size_key.replace(/\s+/g, -); }else{ singleProduct.Id productData.data_product_id; } singleProduct.Image productData.data_product_link; singleProduct.Saletype productData.data_sale_type; singleProduct.SelectedSize productData.data_product_selected_size; singleProduct.SelectedOption productData.data_product_selected_option; //new condition for diffrent type of products singleProduct.Price productData.data_product_price; singleProduct.Ship productData.data_product_shipping; singleProduct.Rbllprice productData.data_product_rbllprice; singleProduct.billModel productData.billingModel; var prod_type productData.data_product_type; var selected_size productData.data_product_selected_size; if ((prod_type && selected_size ) || bill_mod 2 || bill_mod 8) { var pickedSize $product.find(inputnameprod-sizes:checked).val(); singleProduct.Name productData.data_product_title + + (pickedSize ? - + pickedSize : ); } else if (prod_type ! && selected_size ) { singleProduct.Name productData.data_product_title + (prod_type ? ( + prod_type + ) : ); } else if (prod_type && selected_size ! ) { singleProduct.Name productData.data_product_title + - + productData.data_product_selected_size; } else if (prod_type ! && selected_size ! ) { singleProduct.Name productData.data_product_title + ( + prod_type + ) - + productData.data_product_selected_size; } singleProduct.Alias productData.data_product_alias; singleProduct.Qty data_qty; singleProduct.Type prod_type; singleProduct.Total productData.data_total_price; singleProduct.Multiprice productData.data_product_MultiPrice; singleProduct.EnableMaxqty productData.data_product_enableMaxqty; singleProduct.StickyId $product.find(.product-sticky-id).val(); singleProduct.productType productData.data_product_type_1; singleProduct.digitalFile productData.data_product_digital_file; var flag 0; var productCart ; var tot_pdt_count 12; if (flag 0) { shoppingCart.push(singleProduct); sessionStorage.setItem(singleProduct.Id, JSON.stringify(singleProduct)); let items Object.keys(sessionStorage).filter(key > key.trim().match(/^product-/)); items.forEach(function(v, i) { var shopCart JSON.parse(sessionStorage.getItem(v)); productCart.push(shopCart); }); //console.log(productCart); var cartPdtArrNew productCart.filter(function(el) { return el ! null && el ! ; }); // Send the data to the server using fetch fetch(update_cart_session.php, { method: POST, headers: { Content-Type: application/json, }, body: JSON.stringify(cartPdtArrNew) }) .then(response > response.json()) .then(data > { window.location cart; }) .catch((error) > { console.error(Error:, error); }); console.log(shoppingCart); //return; } else { $product.find(.error-message-main).after(div classerror-message stylefont-size:16px;>Product is Already Added in The Cart/div>); $product.find(.error-message).show(); } } // Initialize a single products functionality function initProduct($product, productId) { const productData getProductData(productId); const variations productData.variations.variations || ; const variantTypeCount Object.keys(productData.variations.variations).length; updateProductSessionData(productId, { isProductAttributes: variantTypeCount }); var product_id productData.id; var billing_model productData.billingModel; $data_product productData.index; // If productData has a category array, pick a random category $data_product_category productData.category ? productData.categoryMath.floor(Math.random() * productData.category.length).replace(/'/g, ) : ; // Fallback if no category exists $data_product_title productData.name; $data_product_alias ; $priceMin productData.ssPrice; if (productData.straightSaleMultiPrice yes && productData.billingModel 1){ $priceMin productData.shop_option.shop_option1.option_price; }else if(productData.billingModel 2 || productData.billingModel 6 || productData.billingModel 7 || productData.billingModel 8){ $priceMin productData.trialPrice; }else if(productData.billingModel 3){ $priceMin productData.continuityPrice; } if (billing_model 1) { $data_product_price $priceMin ; } if (billing_model 2 || billing_model 8) { $data_product_price productData.trialShipping; } if (billing_model 3) { let cntntyprice productData.continuityPrice; let cntntyshipping productData.continuityShipping; $data_product_price_cont +cntntyprice + +cntntyshipping; $data_product_price $data_product_price_cont.toFixed(2); } if (billing_model 4) { $data_product_price productData.trialShipping; } if (billing_model 5) { $data_product_price $priceMin; } if (billing_model 6) { $data_product_price productData.trialShipping; } if (billing_model 7) { $data_product_price $priceMin; } $data_product_shipping productData.ssShipping; $data_product_rbllprice productData.trialRebillPrice; $data_product_trlshipping productData.trialShipping; $data_product_cntntyprice productData.continuityPrice; $data_product_cntntyshipping productData.continuityShipping; $data_product_billing_model productData.billingModel; $data_product_size_option productData.sizeOption; $data_product_MultiPrice productData.straightSaleMultiPrice; $data_product_id $product.find(.pdt-button).data(product-id); // First pass the PHP path to JavaScript (put this in your template/header) var phpImagesPath ./config/images; // Then in your JavaScript code: $data_product_link productData.image.startsWith(http://) || productData.image.startsWith(https://) ? productData.image : phpImagesPath + / + productData.image; $data_product_qty $product.find(.pdt-button).data(product-quantity); updateProductSessionData(productId, { data_product: $data_product, data_product_category: $data_product_category, data_product_title: $data_product_title, data_product_alias: $data_product_alias, data_product_price: $data_product_price, data_product_shipping: $data_product_shipping, data_product_rbllprice: $data_product_rbllprice, data_product_trlshipping: $data_product_trlshipping, data_product_cntntyprice: $data_product_cntntyprice, data_product_cntntyshipping: $data_product_cntntyshipping, data_product_billing_model: $data_product_billing_model, data_product_size_option: $data_product_size_option, data_product_MultiPrice: $data_product_MultiPrice, data_product_id: $data_product_id, data_product_link: $data_product_link, data_pdt_qty: $data_product_qty, data_total_price: $data_product_price, data_product: $data_product, data_product_price_variant: }); $product.find(.single_pdt_cat).text($data_product_category); // Replace ' in product_category items before checking product_cat (productData.product_category && $data_product_category && productData.product_category.some(cat > cat.replace(/'/g, ) $data_product_category)) ? $data_product_category : ; if(product_cat ! ){ $(.product-category-bd).text(product_cat); }else{ $(.product-category-bd-sp).hide(); } var bill_model productData.billingModel; var multiPrice productData.straightSaleMultiPrice; var prod_id productData.id; // fetch pricing for ss dropdown and pass it to the next page if (bill_model 1 && multiPrice no) { var subPrice1 $product.find(.subtotal_price).text() * 1; var shipPrice1 $product.find(.shipping_price).text() * 1; updateProductSessionData(productId, { data_product_price: subPrice1, data_total_price: subPrice1 + shipPrice1, }); } if(bill_model 8){ $max_qty productData.trialMaxqty; $is_show_max_qty productData.trialMaxqty; }else{ $max_qty productData.maxQuantity; $is_show_max_qty productData.enableMaxqty; } //enable & disble qty in product & cart page depend on enableMaxqty key var max_qty $max_qty; var is_show_max_qty $is_show_max_qty; var productType productData.productType; var digitalFile productData.digitalFile; updateProductSessionData(productId, { data_product_enableMaxqty: max_qty, data_product_type_1: productType, data_product_digital_file: digitalFile, }); if (is_show_max_qty > 0) { $product.find(.select-qty-text).css(display, block); $product.find(.qty-col).css(display, flex); } var b_model productData.billingModel; var pdt_id productData.id; if (b_model 1) { $product.find(.bill_model).html(One Time Sale); } if (b_model 4) { $product.find(.pdt_type4).show(); $product.find(.bill_model).hide(); } if (b_model 5) { $product.find(.pdt_type5).show(); $product.find(.bill_model).hide(); } if (b_model 6) { $product.find(.pdt_type6).show(); $product.find(.bill_model).hide(); } if (b_model 7) { $product.find(.pdt_type7).show(); $product.find(.bill_model).hide(); } priceFixesAccordingToBilling($product,productId); setSaleType($product,productId); updateProductSessionData(productId, { data_product_selected_option: , }); fetchSizes($product,productId); fetchOptions($product,productId); $product.find(.increase).on(click, function() { handleQtyChange($product, productId, increase); }); $product.find(.decrease).on(click, function() { handleQtyChange($product, productId, decrease); }); setTimeout(function(){ var $mainSlider $product.find(.main-slider); var $thumbnailSlider $product.find(.thumbnail-slider); // Initialize main slider with reference to THIS products thumbnail slider $mainSlider.slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, fade: true, asNavFor: $thumbnailSlider // Pass the jQuery object directly }); // Initialize thumbnail slider with reference to THIS products main slider $thumbnailSlider.slick({ slidesToShow: 4, slidesToScroll: 1, asNavFor: $mainSlider, // Pass the jQuery object directly dots: false, centerMode: false, focusOnSelect: true }); $product.find(data-fancyboxgallery).fancybox({}); },1000); } // Helper function to remove product from sessionStorage function removeProductFromSessionStorage(productKey) { // 1. Get current data const storedData sessionStorage.getItem(productsData); if (!storedData) return; try { // 2. Parse and verify structure const productsData JSON.parse(storedData); if (typeof productsData ! object || Array.isArray(productsData)) { throw new Error(Expected an object, got something else); } // 3. Delete the key if it exists if (productsDataproductKey) { delete productsDataproductKey; // 4. Save back to sessionStorage sessionStorage.setItem(productsData, JSON.stringify(productsData)); console.log(Removed:, productKey); // Debug log } } catch (e) { console.error(Error updating sessionStorage:, e); } } /script>script srchttps://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js>/script>script srchttps://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js>/script>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]