404 Not Found


nginx/1.18.0 (Ubuntu)
span class="mo-checkbox_label check_icon">${tag.tag_name} `; wapLabelHtml+=` ` } $(".web-filter-box").eq(index).show().html(pcLabelHtml) $(".mobile-filter-box").eq(index).show().html(wapLabelHtml) }else{ // $(".collection-filter-tag-box").eq(index).find(".web-filter-box").hide() // $(".mobile-filter-tag-box").eq(index).find(".mobile-filter-box").hide() } if(current_labels && current_labels.length){ let currentLabelHtml = "" for (let i = 0; i < current_labels.length; i++) { const tag = current_labels[i]; currentLabelHtml+=`
${tag.tag_name}
`; } $(".web-filter-box input[name='webCollectionFilter']").change(webFilterChange) $(".container-label-warp").html(currentLabelHtml+'
Clear all
') $(".container-label-warp-item").click(function(){ var id = $(this).data("id"); tagIds[index] = tagIds[index].filter(el=>el!=id) var tagIdsStr = tagIds[index].length ?JSON.stringify(tagIds):"" location.href = moi.setUrlParams(location.href, { "tag_ids": tagIdsStr,"page": 1}); }) $(".container-label-warp-clear").click(function(){ location.href = moi.setUrlParams(location.href, { "tag_ids": "","page": 1}); }) } } function initFilter(){ var tagIds = moi.getUrlParam("tag_ids"); if(tagIds && tagIds != "{}"){ labelShow(tagIds,_GET_C_SETTING_("collection").labels,_GET_C_SETTING_("collection").current_labels) $(".web_filter_clear").show(); tagIds = JSON.parse(tagIds); var keys = Object.keys(tagIds); for (let i = 0; i < keys.length; i++) { const element = tagIds[keys[i]]; element.forEach(function(tagId){ $(".web-filter-box").eq(keys[i]).find('input[name="webCollectionFilter"]').each(function(index, element) { if($(this).val() == tagId){ $(this).attr('checked', true) } }); $(".mobile-filter-box").eq(keys[i]).find('input[name="mobileCollectionFilter"]').each(function(index, element) { if($(this).val() == tagId){ $(this).attr('checked', true) } }); }); } } var vendor = moi.getUrlParam("vendor"); if(vendor){ $(".web_filter_clear").show(); vendor = vendor.split(","); vendor.forEach(function(val){ $('input[name="webVendor"][value="'+val+'"]').attr('checked', true) $('input[name="mobileVendor"][value="'+val+'"]').attr('checked', true) }) } var variant_price_max = moi.getUrlParam("variant_price_max"); if(variant_price_max){ $(".web_filter_clear").show(); $('#variant_price_max').val(variant_price_max); $('#mobile_variant_price_max').val(variant_price_max); } var variant_price_min = moi.getUrlParam("variant_price_min"); if(variant_price_min){ $(".web_filter_clear").show(); $('#variant_price_min').val(variant_price_min); $('#mobile_variant_price_min').val(variant_price_min); } if($(".collection-filter-warp").html() && $(".collection-filter-warp").html().trim() == ""){ $(".collection-filter-box").hide(); } } initFilter(); $("body").on("click", ".collection_detail_default df-oemmenu df-oemmenu-label", function () { $(this).parent().find("df-oemmenu-warp").slideToggle() if($(this).parent().hasClass("df-oemmenu-acrive")){ $(this).parent().find("df-oemmenu-warp").slideUp('slow',function(){ $(this).parent().removeClass("df-oemmenu-acrive"); }); }else{ $(this).parent().find("df-oemmenu-warp").slideDown('slow',function(){ }); $(this).parent().addClass("df-oemmenu-acrive"); } }); $("body").on("click", "df-oemdrawer df-oemdrawer-label", function () { var node = $(this).parent(); node.addClass("df-oemdrawer-open"); setTimeout(function () { node.find("df-oemdrawer-popup-warp").addClass("df-oemdrawer-popup-open"); }, 100); }); $("body").on("click", ".collection_detail_default .drawer-close", function () { var node = $(this).parents("df-oemdrawer"); node.find("df-oemdrawer-popup-warp").removeClass("df-oemdrawer-popup-open"); setTimeout(function () { node.removeClass("df-oemdrawer-open"); }, 350); }); function filterParams(obj) { let _newPar = {}; for (let key in obj) { if ((obj[key] === 0 || obj[key] === false || obj[key]) && obj[key].toString().replace(/(^\s*)|(\s*$)/g, '') !== '') { _newPar[key] = obj[key]; } } return _newPar; } function getCollectionProduct(params){ var getURl = moi.setUrlParams(location.pathname + location.search,params); if(params.page > 1){ history.replaceState(null, null, moi.setUrlParams(location.href, filterParams(params))); } moi.appendLoading({container:"#collection-product-warp",theme:'white',size:32}) moi.ajax({ url: getURl, type: "get", complete:function(){ moi.removeLoading("#collection-product-warp") }, success: function (res) { if (res.code !== 0) { return moi.message({content:res.msg,type:"error"}) } var resData = res.data; if(params.page === 1){ labelShow(params.tag_ids,resData.collection.labels,resData.collection.current_labels) } if(resData.paginate){ $("#collection-product-warp").html("") engine.parseAndRender($("#id-collection-product-temp").html(), { products: resData.collection.products, collection_handle: _GET_C_SETTING_("collection").handle, data_from: "collection_detail", lang: lang }).then(function(productHtml) { $("#collection-product-warp").append('
'); $("#collection-product-warp").find(".product_view").click(quickview); $(".product_num span").text(resData.collection.all_products_count) engine.parseAndRender($("#collection-paginate-temp").html(), { paginate: resData.paginate, lang: lang }).then(function(paginateHTml) { $("#collection-product-warp").append(paginateHTml) window.productSize && window.productSize( $("#collection-product-warp").find(".product_img")) $("#collection-product-warp").find(".mo-pagination-value").click(function(){ var URL = $(this).data("https"); const urlSearchParams = new URLSearchParams(URL.split("?")[1]); const params = Object.fromEntries(urlSearchParams.entries()); getCollectionProduct(params) }) $("#collection-product-warp").find(".mo-pagination-handle").click(function(){ var URL = $(this).data("https"); const urlSearchParams = new URLSearchParams(URL.split("?")[1]); const params = Object.fromEntries(urlSearchParams.entries()); getCollectionProduct(params) }) }); }); }else{ $(".product_num span").text(0) $("#collection-product-warp").html($("#collection-product-empty-temp").html()) } } }) } function getURlTagIds(){ var oldIds = [] var tagIds = JSON.parse(moi.getUrlParam("tag_ids") || "{}"); Object.keys(tagIds).forEach(key=>oldIds.push.apply(oldIds,tagIds[key])); return oldIds } function getWebFilterParams(){ var filterIds = {}; if(sectionTagType == 1){ filterIds = JSON.parse(moi.getUrlParam("tag_ids") || "{}"); } $(".web-filter-box").each(function(index){ $(this).find("input[name='webCollectionFilter']:checked").each(function(idx) { if(!filterIds[index]){ filterIds[index] = [] } var tagId = $(this).val(); if(!filterIds[index].includes(tagId)){ filterIds[index].push($(this).val()); } }); }) var vendorIds = [] $("input[name='webVendor']:checked").each(function(idx) { vendorIds.push($(this).val()); }); var sort_by = $('#sort_by_select').val(); var variant_price_min = $('#variant_price_min').val(); var variant_price_max = $('#variant_price_max').val(); var tagIdsStr = JSON.stringify(filterIds); return { "sort_by": sort_by || "", "tag_ids": tagIdsStr, "variant_price_min":variant_price_min || "", "variant_price_max":variant_price_max || "", "currency":_GET_C_SETTING_("currency_code"), "vendor":vendorIds.join(","), "tag_linkage":"0", "page": 1 } } function getMobileFilterParams(){ var filterIds = {}; if(sectionTagType == 1){ filterIds = JSON.parse(moi.getUrlParam("tag_ids") || "{}"); } $(".mobile-filter-box").each(function(index){ $(this).find("input[name='mobileCollectionFilter']:checked").each(function(idx) { if(!filterIds[index]){ filterIds[index] = [] } filterIds[index].push($(this).val()); }); }) var vendorIds = [] $("input[name='mobileVendor']:checked").each(function(idx) { vendorIds.push($(this).val()); }); var sort_by = $('input[name="sortBy"]:checked').val(); var variant_price_min = $('#mobile_variant_price_min').val(); var variant_price_max = $('#mobile_variant_price_max').val(); var tagIdsStr = JSON.stringify(filterIds); return { "sort_by": sort_by || "", "tag_linkage":"0", "tag_ids": tagIdsStr == "{}" ? moi.getUrlParam("tag_ids"):tagIdsStr, "variant_price_min":variant_price_min || "", "variant_price_max":variant_price_max || "", "currency":_GET_C_SETTING_("currency_code"), "vendor":vendorIds.join(","), "page": 1 } } function webFilterChange(){ var filterParams = getWebFilterParams(); if(filterParams.tag_ids == "{}" && !filterParams.variant_price_min && !filterParams.variant_price_max && !filterParams.vendor){ $(".web_filter_clear").hide(); }else{ $(".web_filter_clear").show(); } // $("html,body").stop().animate({ scrollTop: $("#collection_detail_scrollTop").offset().top }, 400, "linear"); getCollectionProduct(filterParams) } $("input[name='webVendor']").change(webFilterChange) $("input[name='webCollectionFilter']").change(webFilterChange) $("#variant_price_min").bind('input propertychange',webFilterChange) $("#variant_price_max").bind('input propertychange',webFilterChange) $('#sort_by_select').change(webFilterChange) $("#filter_submit").click(function(){ var filterParams = getMobileFilterParams(); getCollectionProduct(filterParams) }) $(".filter_clear").click(function(){ location.href = moi.setUrlParams(location.href, { "tag_ids": "",variant_price_max:"",variant_price_min:"",vendor:"","page": 1}); }) })
BACK
Shopping Cart