TERMS AND CONDITIONS FOR THE ONLINE SALE OF GOODS

Last modified: June 30, 2020

1. Introduction

THIS DOCUMENT CONTAINS VERY IMPORTANT INFORMATION REGARDING YOUR RIGHTS AND OBLIGATIONS, AS WELL AS CONDITIONS, LIMITATIONS AND EXCLUSIONS THAT MIGHT APPLY TO YOU. PLEASE READ IT CAREFULLY.

THESE TERMS REQUIRE THE USE OF ARBITRATION ON AN INDIVIDUAL BASIS TO RESOLVE DISPUTES, RATHER THAN JURY TRIALS OR CLASS ACTIONS.

BY PLACING AN ORDER FOR PRODUCTS FROM THIS WEBSITE, YOU ACCEPT AND ARE BOUND BY THESE TERMS AND CONDITIONS.

YOU MAY NOT ORDER OR OBTAIN PRODUCTS FROM THIS WEBSITE IF YOU (A) DO NOT AGREE TO THESE TERMS, (B) ARE NOT THE OLDER OF (i) AT LEAST 18 YEARS OF AGE OR (ii) LEGAL AGE TO FORM A BINDING CONTRACT WITH ALL FILTERS LLC, OR (C) ARE PROHIBITED FROM ACCESSING OR USING THIS WEBSITE OR ANY OF THIS WEBSITE'S CONTENTS, GOODS OR SERVICES BY APPLICABLE LAW.


These terms and conditions (these "Terms") apply to the purchase and sale of products through allfilters.com (the "Site"). These Terms are subject to change by All Filters LLC (referred to as "us", "we", or "our" as the context may require) without prior written notice at any time, in our sole discretion. The latest version of these Terms will be posted on this Site, and you should review these Terms prior to purchasing any product that is available through this Site. All changes are effective immediately when we post them, and apply to all access to and use of the Website thereafter. The date these Terms were last revised is identified at the top of these Terms. Your continued use of this Site after a posted change in these Terms will constitute your acceptance of and agreement to such changes.

These Terms are an integral part of the Website terms of use that apply generally to the use of our Site. You should also carefully review our Privacy Policy before placing an order for products through this Site (see Section 9).

2. Order Acceptance and Cancellation

You agree that your order is an offer to buy, under these Terms, all products listed in your order. All orders must be accepted by us or we will not be obligated to sell the products to you. We may choose not to accept any orders in our sole discretion. After having received your order, we will send you a confirmation e-mail with your order number and details of the items you have ordered. Acceptance of your order and the formation of the contract of sale between All Filters LLC and you will not take place unless and until you have received your order confirmation e-mail. You have the option to cancel your order at any time as described in our Order Cancellation Policy , which appears further below.

3. Prices and Payment Terms

(a) All prices posted on this Site are subject to change without notice. The price charged for a product will be the price in effect at the time the order is placed and will be set out in your order confirmation e-mail. Price increases will only apply to orders placed after such changes. Posted prices do not include taxes or charges for shipping and handling. All such taxes and charges will be added to your merchandise total and will be itemized in your shopping cart and in your order confirmation e-mail. We are not responsible for pricing, typographical or other errors in any offer by us and we reserve the right to cancel any orders arising from such errors.

(b) Terms of payment are within our sole discretion and payment must be received by us before our acceptance of an order. For a list of credits cards and other payment methods that have been approved for all purchases made through this Site, view the footer of any page on our website. You represent and warrant that (i) the credit card information you supply to us is true, correct and complete, (ii) you are duly authorized to use such credit card for the purchase, (iii) charges incurred by you will be honored by your credit card company, and (iv) you will pay charges incurred by you at the posted prices, including all applicable taxes, if any.

4. Shipments; Delivery; Title and Risk of Loss

(a) We will arrange for shipment of the products to you in accordance with our Shipping and Delivery Policy. You will pay all shipping and handling charges as specified in the Shipping and Delivery Policy.

(b) Title and risk of loss pass to you upon our transfer of the products to the carrier. Shipping and delivery dates are estimates only and cannot be guaranteed. We are not liable for any delays in shipments.

5. Returns and Exchanges

Returns and exchanges may be obtained only in accordance with our Return, Exchange, and Cancellation Policy.

6. LIMITED WARRANTY

YOU MAY HAVE SPECIFIC LEGAL RIGHTS IN REGARDS TO WARRANTIES, WHICH VARY FROM STATE TO STATE. WE MAKE OUR PRODUCTS AVAILABLE ON AN "AS IS" AND "AS AVAILABLE" BASIS; WE MAKE NO WARRANTY WHATSOEVER WITH RESPECT TO PRODUCTS AND, TO THE FULL EXTENT PERMISSIBLE BY LAW, WE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY (a) WARRANTY OF MERCHANTABILITY; (b) WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE; (c) WARRANTY OF TITLE; OR (d) WARRANTY AGAINST INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OF A THIRD PARTY; WHETHER EXPRESS OR IMPLIED BY LAW, COURSE OF DEALING, COURSE OF PERFORMANCE, USAGE OF TRADE OR OTHERWISE.

NEITHER ANY PERFORMANCE OR OTHER CONDUCT, NOR ANY ORAL OR WRITTEN INFORMATION, STATEMENT OR ADVICE PROVIDED BY US OR ANY OF OUR SUPPLIERS, AGENTS OR EMPLOYEES WILL CREATE A WARRANTY.

THE FOREGOING DOES NOT AFFECT ANY WARRANTIES WHICH CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW.


(a) Limitation of Liability

THE REMEDIES DESCRIBED IN OUR WARRANTY POLICY ABOVE ARE YOUR SOLE AND EXCLUSIVE REMEDIES AND OUR ENTIRE OBLIGATION AND LIABILITY (AND THE ENTIRE LIABILITY OF OUR SUPPLIERS) FOR ANY BREACH OF THE WARRANTIES DESCRIBED IN THE WARRANTY POLICY. TO THE FULL EXTENT PERMISSIBLE BY LAW, OUR LIABILITY WILL UNDER NO CIRCUMSTANCES EXCEED THE ACTUAL AMOUNT PAID BY YOU FOR THE DEFECTIVE PRODUCT THAT YOU HAVE PURCHASED THROUGH THE SITE, NOR WILL WE UNDER ANY CIRCUMSTANCES BE LIABLE FOR ANY LOSS OF PRODUCTION, WORK, DATA, USE, BUSINESS, GOODWILL, REPUTATION, REVENUE OR PROFIT, ANY DIMINUTION IN VALUE, COSTS OF REPLACEMENT GOODS , OR ANY CONSEQUENTIAL, INCIDENTAL, SPECIAL OR PUNITIVE DAMAGES OR LOSSES, WHETHER DIRECT OR INDIRECT.

SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU.


7. Goods Not for Resale or Export

You agree to comply with all applicable laws and regulations of the various states and of the United States including all Export Regulations, as defined below. You represent and warrant that you are buying products from the Site for your own personal or household use only, and not for resale or export. Products purchased from the Site may be controlled for export purposes by export regulations, including but not limited to, the Export Administration Act of 1979 (50 U.S.C. 2401-2410), the Export Administration Regulations promulgated thereunder (15 C.F.R. 768-799), the International Traffic in Arms Regulations (22 C.F.R. 120-128 and 130) and their successor and supplemental regulations (collectively, "Export Regulations").

8. Intellectual Property Use and Ownership

You acknowledge and agree that: All Filters LLC, its supplier(s), and its licensor(s) are and will remain the sole and exclusive owners of all intellectual property rights in and to each product made available on this Site and any related specifications, instructions, documentation or other materials, including, but not limited to, all related copyrights, patents, and trademarks and other intellectual property rights. You do not and will not have or acquire any ownership of these intellectual property rights in or to the products made available through this Site, or of any intellectual property rights relating to those products.

9. Privacy

Our Privacy Policy governs the processing of all personal data collected from you in connection with your purchase of products through the Site.

10. Force Majeure

We will not be liable or responsible to you, nor be deemed to have defaulted or breached these Terms, for any failure or delay in our performance under these Terms when and to the extent such failure or delay is caused by or results from acts or circumstances beyond our reasonable control, including, without limitation, acts of God, flood, fire, earthquake, explosion, governmental actions, war, invasion or hostilities (whether war is declared or not), terrorist threats or acts, riot or other civil unrest, national emergency, revolution, insurrection, epidemic, lockouts, strikes or other labor disputes (whether or not relating to our workforce), or restraints or delays affecting carriers or inability or delay in obtaining supplies of adequate or suitable materials, materials or telecommunication breakdown or power outage.

11. Governing Law and Jurisdiction

All matters arising out of or relating to these Terms are governed by and construed in accordance with the internal laws of the State of Utah without giving effect to any choice or conflict of law provision or rule (whether of the State of Utah or any other jurisdiction) that would cause the application of the laws of any jurisdiction other than those of the State of Utah.

12. Dispute Resolution and Binding Arbitration

(a) YOU AND ALL FILTERS LLC ARE AGREEING TO GIVE UP ANY RIGHTS TO LITIGATE CLAIMS IN A COURT OR BEFORE A JURY, OR TO PARTICIPATE IN A CLASS ACTION OR REPRESENTATIVE ACTION WITH RESPECT TO A CLAIM. OTHER RIGHTS THAT YOU WOULD HAVE IF YOU WENT TO COURT MAY ALSO BE UNAVAILABLE OR MAY BE LIMITED IN ARBITRATION.

ANY CLAIM, DISPUTE OR CONTROVERSY (WHETHER IN CONTRACT, TORT OR OTHERWISE, WHETHER PRE-EXISTING, PRESENT OR FUTURE, AND INCLUDING STATUTORY, CONSUMER PROTECTION, COMMON LAW, INTENTIONAL TORT, INJUNCTIVE AND EQUITABLE CLAIMS) BETWEEN YOU AND US ARISING FROM OR RELATING IN ANY WAY TO YOUR PURCHASE OF PRODUCTS THROUGH THE SITE, WILL BE RESOLVED EXCLUSIVELY AND FINALLY BY BINDING ARBITRATION.


(b) The arbitration will be administered by the American Arbitration Association ("AAA") in accordance with the Commercial Arbitration Rules or, if applicable, the Consumer Arbitration Rules (the "AAA Rules") then in effect, except as modified by this Section 12. (The AAA Rules are available at www.adr.org/arb_med or by calling the AAA at 1-800-778-7879.) The Federal Arbitration Act will govern the interpretation and enforcement of this section.

The arbitrator will have exclusive authority to resolve any dispute relating to arbitrability and/or enforceability of this arbitration provision, including any unconscionability challenge or any other challenge that the arbitration provision or the Agreement is void, voidable or otherwise invalid. The arbitrator will be empowered to grant whatever relief would be available in court under law or in equity. Any award of the arbitrator(s) will be final and binding on each of the parties, and may be entered as a judgment in any court of competent jurisdiction.

We will be responsible for paying any individual consumer's arbitration/arbitrator fees. If you prevail on any claim that affords the prevailing party attorneys' fees, the arbitrator may award reasonable fees to you under the standards for fee shifting provided by law.

(c) You may elect to pursue your claim in small-claims court rather than arbitration if you provide us with written notice of your intention do so within 60 days of your purchase. The arbitration or small-claims court proceeding will be limited solely to your individual dispute or controversy.

(d) You agree to an arbitration on an individual basis. In any dispute, NEITHER YOU NOR ALL FILTERS LLC WILL BE ENTITLED TO JOIN OR CONSOLIDATE CLAIMS BY OR AGAINST OTHER CUSTOMERS IN COURT OR IN ARBITRATION OR OTHERWISE PARTICIPATE IN ANY CLAIM AS A CLASS REPRESENTATIVE, CLASS MEMBER OR IN A PRIVATE ATTORNEY GENERAL CAPACITY. The arbitral tribunal may not consolidate more than one person's claims, and may not otherwise preside over any form of a representative or class proceeding. The arbitral tribunal has no power to consider the enforceability of this class arbitration waiver and any challenge to the class arbitration waiver may only be raised in a court of competent jurisdiction.

If any provision of this arbitration agreement is found unenforceable, the unenforceable provision will be severed and the remaining arbitration terms will be enforced.

13. Assignment

You will not assign any of your rights or delegate any of your obligations under these Terms without our prior written consent. Any purported assignment or delegation in violation of this Section 13 is null and void. No assignment or delegation relieves you of any of your obligations under these Terms.

14. No Waivers

The failure by us to enforce any right or provision of these Terms will not constitute a waiver of future enforcement of that right or provision. The waiver of any right or provision will be effective only if in writing and signed by a duly authorized representative of All Filters LLC.

15. No Third Party Beneficiaries

These Terms do not and are not intended to confer any rights or remedies upon any person other than you.

16. Notices

(a) To You. We may provide any notice to you under these Terms by: (i) sending a message to the e-mail address you provide or (ii) by posting to the Site. Notices sent by e-mail will be effective when we send the e-mail and notices we provide by posting will be effective upon posting. It is your responsibility to keep your e-mail address current.

(b) To Us. To give us notice under these Terms, you must contact us as follows: (i) by submitting a ticket via the Contact Us page and selecting "Other - Feedback, Comments, or Other Questions" from the dropdown menu or (ii) by personal delivery, overnight courier or registered or certified mail to

All Filters LLC 1991 W Parkway Blvd Salt Lake City, UT 84119

We may update the facsimile number or address for notices to us by posting a notice on the Site. Notices provided by personal delivery will be effective immediately. Notices provided by facsimile transmission or overnight courier will be effective one business day after they are sent. Notices provided by registered or certified mail will be effective three business days after they are sent.

17. Severability

If any provision of these Terms is invalid, illegal, void or unenforceable, then that provision will be deemed severed from these Terms and will not affect the validity or enforceability of the remaining provisions of these Terms.

18. Entire Agreement

Our order confirmation, these Terms, the license agreement relating to any product you obtain on or through this Site, our Website Terms of Use and our Privacy Policy will be deemed the final and integrated agreement between you and us on the matters contained in these Terms. These Terms prevail over any of your general terms and conditions of purchase regardless whether or when you submitted your purchase order or such terms. Fulfillment of your order does not constitute acceptance of any of your terms and conditions and does not serve to modify or amend these Terms.
'; var thumbnailTemplate = '
'; var contentTemplate = '

[title]

[description]

[metaContentTemplate]
'; var contentWithoutImageTemplate = '

[title]

[description]

[metaContentTemplate]'; var metaContentTemplate = '
[ratingTemplate]
'; var ratingReviewTemplate = ''; var priceTemplate = '

[price] [inStock]

'; searchResult.items.forEach((item, index) => { var description = ''; var thumbnailTemplate1 = thumbnailTemplate; var contentTemplate1 = contentTemplate; var searchResultTemplate1 = searchResultTemplate; var metaContentTemplate1 = metaContentTemplate; var ratingReviewTemplate1 = ratingReviewTemplate; var templateVariableList = {}; var contentTemplateItems = {}; description = item.snippet; contentTemplateItems['[title]'] = item.title; contentTemplateItems['[titleURL]'] = item.link; contentTemplateItems['[description]'] = description; if (item.pagemap != undefined) { var aggregateRating = item.pagemap.aggregaterating; if (aggregateRating != null && aggregateRating != undefined && aggregateRating.length > 0) { var ratingvalue = parseFloat(aggregateRating[0].ratingvalue); var reviewcount = aggregateRating[0].reviewcount; ratingReviewTemplate1 = ratingReviewTemplate1.replace('[rateIndex]', index); ratingReviewTemplate1 = ratingReviewTemplate1.replace('[reviewCount]', reviewcount); var ratingIndex = 0; if (ratingvalue >= 4.5) { ratingReviewTemplate1 = ratingReviewTemplate1.replace('[isChecked5]', 'checked'); } else if (ratingvalue >= 3.5 && ratingvalue < 4.5) { ratingReviewTemplate1 = ratingReviewTemplate1.replace('[isChecked4]', 'checked'); } else if (ratingvalue >= 2.5 && ratingvalue < 3.5) { ratingReviewTemplate1 = ratingReviewTemplate1.replace('[isChecked3]', 'checked'); } else if (ratingvalue >= 1.5 && ratingvalue < 2.5) { ratingReviewTemplate1 = ratingReviewTemplate1.replace('[isChecked2]', 'checked'); } else if (ratingvalue >= 0.5 && ratingvalue < 1.5) { ratingReviewTemplate1 = ratingReviewTemplate1.replace('[isChecked1]', 'checked'); } // Replace rest values with ''. for (var i = 1; i <= 5; i++) { ratingReviewTemplate1 = ratingReviewTemplate1.replace('[isChecked' + i + ']', ''); } metaContentTemplate1 = metaContentTemplate1.replace('[ratingTemplate]', ratingReviewTemplate1); contentTemplateItems['[metaContentTemplate]'] = metaContentTemplate1; } else { contentTemplateItems['[metaContentTemplate]'] = ''; } var source = (item.pagemap == undefined && item.pagemap.thumbnail == undefined) ? (item.pagemap == undefined && item.pagemap.cse_thumbnail == undefined) ? undefined : item.pagemap.cse_thumbnail : item.pagemap.thumbnail; if (source != null && source != undefined && source.length > 0) { // Replacing thumbnail. thumbnailTemplate1 = thumbnailTemplate1.replace('[imageURL]', source[0].src); templateVariableList['[thumbnailTemplate]'] = thumbnailTemplate1; // Replacing content template. Object.keys(contentTemplateItems).forEach((key) => { //console.log(key, contentTemplateItems[key]); contentTemplate1 = contentTemplate1.replace(key, contentTemplateItems[key]); }); templateVariableList['[contentTemplate]'] = contentTemplate1; templateVariableList['[contentWithoutImageTemplate]'] = ''; } else { contentTemplate1 = contentWithoutImageTemplate; // Replacing content template. Object.keys(contentTemplateItems).forEach((key) => { //console.log(key, contentTemplateItems[key]); contentTemplate1 = contentTemplate1.replace(key, contentTemplateItems[key]); }); templateVariableList['[contentTemplate]'] = ''; templateVariableList['[contentWithoutImageTemplate]'] = contentTemplate1; templateVariableList['[thumbnailTemplate]'] = ''; } // Replacing content template. Object.keys(templateVariableList).forEach((key) => { //console.log(key, templateVariableList[key]); searchResultTemplate1 = searchResultTemplate1.replace(key, templateVariableList[key]); }); finalResult += searchResultTemplate1; } }); resultSection.innerHTML = finalResult; document.querySelector('#emptySearch').style.display = 'none'; document.querySelector('#search.new').style.display = 'block'; } else { document.querySelector('#emptySearch').innerHTML = 'No result found'; } } const autocompleteHandler = (autocompleteResult) => { if (autocompleteResult.items != null) { if (autocompleteResult.items.length > 0) { var ulStart = ''; if (isMobile) { autoCompleteId = 'suggestM'; } else { autoCompleteId = 'suggest'; } $('.' + autoCompleteId).show(); $(".suggest_overlay").show(); $('.' + autoCompleteId).html(ulStart + autocompleteHtml + ulEnd); } else { if (isMobile) { autoCompleteId = 'suggestM'; } else { autoCompleteId = 'suggest'; } $('.' + autoCompleteId).hide(); $(".suggest_overlay").hide(); } } else { if (isMobile) { autoCompleteId = 'suggestM'; } else { autoCompleteId = 'suggest'; } $('.' + autoCompleteId).hide(); $(".suggest_overlay").hide(); } } function loadClient() { if (gapi != null && gapi != undefined && gapi.client != null && gapi.client != undefined) { gapi.client.setApiKey('AIzaSyD_MFQlsRaD4jc4i9Nsrfgi5Hh8l0M6sWc'); //"AIzaSyDOXLbD-j9ROkEYEAHZxJ0JTPOZrjVJH-M" return gapi.client.load("https://content.googleapis.com/discovery/v1/apis/customsearch/v1/rest") .then(function () { console.log("GAPI client loaded for API"); let searchParams = new URLSearchParams(window.location.search); const hasQuery = searchParams.has('q'); const hasStart = searchParams.has('start'); let query = ''; let start = 0; if (hasQuery & hasStart) { query = searchParams.get('q'); start = searchParams.get('start'); } else if (hasQuery) { if (hasQuery) { query = searchParams.get('q'); } } if (hasQuery) { $('.st-default-search-input').val(query); execute(query, start, false); } }, function (err) { console.error("Error loading GAPI client for API", err); }); } } // Make sure the client is loaded before calling this method. function execute(query, start, isAutocomplete) { if (query != '' && gapi != null && gapi != undefined) { if (gapi.client != null && gapi.client != undefined) { if (gapi.client.search != null && gapi.client.search != undefined && gapi.client.search.cse != null && gapi.client.search.cse != undefined) { return gapi.client.search.cse.siterestrict.list({ "cx": "cd28f151c55f365c5",//"e653019e2a972ddf2",// "q": query, "start": start, "filter": "1", //"fileType": "-filetype:pdf" }).then(function (response) { // Handle the results here (response.result has the parsed body). if (!isAutocomplete) { searchResultHandler(response.result); } else { autocompleteHandler(response.result); } }, function (err) { console.error("Execute error", err); }); } } } else { document.querySelector('#emptySearch').innerHTML = 'No result found.'; } } $('.st-default-search-input').on("keyup", (e) => { query = $('#' + e.target.id).val(); if (query.length > 2) { if (e.target.id == 'search') { isMobile = false; } else { isMobile = true; } execute(query, 0, true); } else { if (e.target.id == 'search') { $('.suggest').hide(); $(".suggest_overlay").hide(); } else { $('.suggestM').hide(); $(".suggest_overlay").hide(); } } }); $('.st-default-search-input').on("focus", (e) => { query = $('#' + e.target.id).val(); if (query.length > 0) { if (e.target.id == 'search') { isMobile = false; } else { isMobile = true; } var html = $('.suggest').html().trim(); var htmlM = $('.suggestM').html().trim(); if (!isMobile) { if (html != '') { $('.suggest').show(); $(".suggest_overlay").show(); } } else { if (htmlM != '') { $('.suggestM').show(); $(".suggest_overlay").show(); } } } }); $('.suggest_overlay').on("click", (e) => { $(".suggest_overlay").hide(); $('.suggest').hide(); $('.suggestM').hide(); }); function loadPage(ele, event) { event.preventDefault(); var spanEle = ele.getElementsByTagName('span'); var btnIndex = ''; if (spanEle.length > 0) { if (ele.classList.contains('movestepbackward')) { btnIndex = pagination.currentPage - 1; } else { btnIndex = pagination.currentPage + 1; } } else { var id = ele.id; var index = id.split('-')[1]; //var el = ele.getElementsByTagName('a'); btnIndex = parseInt(index); } pagination.currentPage = btnIndex; pagination.startNumber = ((btnIndex - 1) * pagination.pageSize) + 1; pagination.currentpageClicked(); } onLoadCallback = function () { if (gapi != null && gapi != undefined) { gapi.load('client:auth2"', { callback: () => { console.log("gapi callback"); loadClient(); }, onerror: (msg) => { console.log('gapi.client failed to load!'); }, timeout: 20000, // 5 seconds. ontimeout: function () { console.log('gapi.client could not load in a timely manner!'); onLoadCallback(); } }); } }; var pagination = { totalPages: 0, totalCount: 0, pageSize: 10, currentPage: 0, startNumber: 0, endNumber: 0, searchText: "", calculateVariables: (googleSearchPageRequest) => { pagination.totalCount = googleSearchPageRequest.totalResults; pagination.totalPages = Math.ceil(pagination.totalCount / pagination.pageSize); // <= 1 ? 1 : (pagination.totalCount / pagination.pageSize); pagination.currentPage = parseInt(googleSearchPageRequest.startIndex / pagination.pageSize) + 1; pagination.searchText = googleSearchPageRequest.searchTerms; var total = ((parseInt(pagination.currentPage) - 1) * pagination.pageSize) + pagination.pageSize; var start = ((parseInt(pagination.currentPage) - 1) * pagination.pageSize) + 1; if (pagination.totalCount >= total) { pagination.startNumber = start; //((parseInt(request.startIndex) - 1) * pagination.pageSize) + 1; } else { if (pagination.currentPage == 1) { pagination.startNumber = 1; } else { pagination.startNumber = start; //((parseInt(request.startIndex) - 1)) * pagination.pageSize + 1; } } if (pagination.totalCount >= total) { pagination.endNumber = total; } else { if (pagination.currentPage == 1) { pagination.endNumber = googleSearchPageRequest.count; } else { pagination.endNumber = (parseInt(pagination.currentPage) - 1) * pagination.pageSize + googleSearchPageRequest.count; } } pagination.createPagination(); }, nextPage: (event) => { }, previousPage: (event) => { }, currentpageClicked: () => { execute(pagination.searchText, pagination.startNumber, false); //document.body.scrollTop = 0; //document.documentElement.scrollTop = 0; window.scroll({ top: 0, left: 0, behavior: 'smooth' }); }, getNumberOfPages: (event) => { pagination.totalPages = (pagination.totalCount / pagination.pageSize) <= 1 ? 1 : (pagination.totalCount / pagination.pageSize); return pagination.totalPages; }, gotFirst: (event) => { //query = document.querySelector('.st-default-search-input').value; execute(pagination.searchText, 1, false); }, gotoLast: (event) => { //query = document.querySelector('.st-default-search-input').value; var startIndex = ((pagination.totalPages - 1) * pagination.pageSize) + 1; execute(pagination.searchText, startIndex, false); }, createPagination: () => { var paginationArray = pagination.createPaginationArray(pagination.currentPage, pagination.totalPages); console.log(paginationArray); var pagingEle = document.querySelector('.pagination'); var moveStepBackward = '
  • '; var moveStepForward = '
  • '; //pagingEle.append(moveStepBackward); var ele = ''; //if (pagination.currentPage != 1) { ele = moveStepBackward; //} //var breakPaginationLoopAt = (pagination.totalPages - pagination.currentPage) > 8 ? pagination.currentPage + 7 : (pagination.totalPages - pagination.currentPage) > 0 ? pagination.currentPage + (pagination.totalPages - pagination.currentPage) : 1; //for (var i = pagination.currentPage; i <= pagination.totalPages; i++) { // ele += '
  • ' + i + '
  • '; // if (breakPaginationLoopAt == i) { break; } //} //if ((pagination.totalPages - breakPaginationLoopAt) > 0) { // ele += '
  • ...
  • '; //} paginationArray.forEach((item, index) => { var i = item; if (item == '...') { i = paginationArray[index - 1] + 1; } ele += '
  • ' + item + '
  • '; }); //if (pagination.currentPage != pagination.totalPages) { ele += moveStepForward; //} pagingEle.innerHTML = ele; }, createPaginationArray: (currentPage, LastPage) => { var current = currentPage, last = LastPage, delta = 3, left = current - delta, right = current + delta + 1, range = [], rangeWithDots = [], l; for (let i = 1; i <= last; i++) { if (i == 1 || i == last || i >= left && i < right) { range.push(i); } } for (let i of range) { if (l) { if (i - l === 2) { rangeWithDots.push(l + 1); } else if (i - l !== 1) { rangeWithDots.push('...'); } } rangeWithDots.push(i); l = i; } return rangeWithDots; } } window.fcSettings = { token: "97829940-75e5-47b4-a5a2-6b9a146d761e", host: "https://wchat.freshchat.com", config: { headerProperty: { hideChatButton: true } }, onInit: function () { window.fcWidget.on("widget:loaded", function () { document.getElementById('custom_fc_button').style.visibility = 'visible'; window.fcWidget.on("unreadCount:notify", function (resp) { $(".newChatCount").html(resp.count); if (resp.count > 0) { $(".newChatCount").show(); } else { $(".newChatCount").hide(); } }); window.fcWidget.on("widget:closed", function () { document.getElementById('fc_frame').style.visibility = 'hidden'; document.getElementById('open_fc_widget').style.visibility = 'visible'; }); window.fcWidget.on("widget:opened", function (resp) { document.getElementById('open_fc_widget').style.visibility = 'hidden'; $(".newChatCount").html(""); $(".newChatCount").hide(); }); }); } }; var openWidget = function () { document.getElementById('fc_frame').style.visibility = 'visible'; $(".newChatCount").html(""); $(".newChatCount").hide(); window.fcWidget.open(); };