Bulk Plush Toys | A&A Global Industries (2024)

'};// Show the loading spinner$('body').modalmanager('loading');// Get all selected facets and their data.var aSelectedAll = getSelectedFacets();var sKeyword = '',sSearchTermString = fncCreateSearchTermString(aSelectedAll), // create the search stringsMultiId = '',sMulti = '';// Gather multi-select data on selected options for the query stringif ($this !== undefined) {// If this submit call was triggered by a dropdown change event, we have direct access// to the modified multi-selectsMultiId = $this.parents('.nys_options').attr('id');sMulti = fncGetMultiselectData(sMultiId, 5);} else {// If this submit was not the result of a dropdown change, we still need to check if a// dropdown was already filled out and then keep the data.sMultiId = $('.nys_options').has('select:last-child option:selected[data-groupid]').attr('id')if (sMultiId !== undefined) {sMulti = fncGetMultiselectData(sMultiId, 5);}}var url;if (sSearchResultsPath === '') {// If sSearchResultsPath is empty then use the current URL.url = window.location.href.split('?')[0];} else {url= sSearchResultsPath;}var oQs = {pc_id: 'AD02E7BEBE094359A3B72601B0F6FA8B',search_keyword: sKeyword,opts: sMulti};// preserve some important querystring variablesif (sSortBy !== '') oQs.sortby = sSortBy;if (sFilters !== '') oQs.filters = sFilters;if (sFlKey !== '') oQs.fl_key = sFlKey;if (sRange !== '') oQs.range = sRange;oQs[sSearchTermQueryString] = sSearchTermString;// This scenario occurs when a user uses the style dropdown (example AmericanFasteners)// and there is no keyword but search_prod is updated with a search string. In this case,// choosing a facet should clear the style search since it cannot be replicated. Only// keyword searches can be replicated because they have a keyword that can be// run against the faceted search XML files. Style searches have their own custom// search strings against custom fields and are not currently supported by FS.if (sKeyword !== '') {oQs.search_prod = '';}window.location = url + '?' + $.param(oQs);} // fncSubmit()// This function returns the value for the new search terms query string that must be created// any time a facet is selected in the sidebar. This function may be called as a result of// selecting or deselecting something. Thus, the query string must be completely rebuilt// looking only at the currently selected facets, NOT the previous search string.//// @param aSelected = array of javascript objects, each representing selected facets and each// containing a groupid and std_key.function fncCreateSearchTermString(aSelected) {var sSearchTermString = '';var i;var sSelectedGroup;var sSelectedSearchTerm;var sPrevGroup;var $group;var sParentIds;var $parents;var bHasParent;var bParentHasSelections;// Loop over the currently selected facetsfor (i = 0; i < aSelected.length; i++) {sSelectedGroup = aSelected[i].groupid;sSelectedSearchTerm = aSelected[i].std_key;$group = $('.nys_section' + createAttrSelector('data-groupid', sSelectedGroup));bHasParent = ($group.attr('data-displaywhen') === 'conditional');// A search group can have multiple parent's, they are separated by the pipe.sParentIds = $group.attr('data-parent').split('|');var sParentsSelector = '';var j;// Loop over each parent id to create the full selector.for (j = 0; j < sParentIds.length; j++) {if (j > 0) {sParentsSelector += ', ';}sParentsSelector += '.nys_section' + createAttrSelector('data-groupid', sParentIds[j]);}$parents = $(sParentsSelector);// Check for any checked checkboxes OR if the last option of the last select in a// search group is selected (data-opno must be something other than 0 since that is// the default option).bParentHasSelections = ($parents.find('input[type=checkbox]:checked,' + 'select:last-child option:selected[data-optno!=0]').length > 0);// If a parent search group exists, make sure it still has something selected otherwise// we should not include any child selections in the new query stringif (!bHasParent || bParentHasSelections) {if (sPrevGroup !== sSelectedGroup) {sSearchTermString += '|' + sSelectedGroup;}sSearchTermString += '~' + sSelectedSearchTerm;sPrevGroup = sSelectedGroup;}}// The substring(1) is to remove the leading pipe (|)return sSearchTermString.substr(1);}/** * Prepend a plus sign to non-selected options within groups * that have at least one option selected to indicate how many products * will be added to result set if selected * * @author jonr * @since 3/10/2014 */function fncUpdateSelectedItemsQtyDisplay() {$('.nys_filter input:checked').closest('.nys_section').find('input:not(:checked)').next('small').children('.plus').removeClass('hide');} // fncUpdateSelectedItemsQtyDisplay()function fncRegisterAjaxHandlers() {// On select change, update with latest choices$wrapper.on('change', '[data-inputtype="multiselect"] select', function (e) {fncAjaxCall(e);});} // fncRegisterAjaxHandlers()function createAttrSelector(sAttribute, sValue) {if (sValue !== undefined) {return '[' + sAttribute + '="' + escapeQuotes(sValue) + '"]';} else {return '[' + sAttribute + ']';}}// Given an element representing a search term (or a list of such elements), this function// gets the reverse sort attribute of the parent container and sets the global variable// so comparator functions use the updated value.function setReverseSort($items) {var $searchGroupSection = $items.parents('.nys_section');bReverseSort = ($searchGroupSection.attr('data-reverse_sort') === 'True');}function fncAjaxCall(e) {// Setup variablesvar $target = $(e.target),sSelectGroupId = $target.closest('.nys_options').attr('id'),sWrapperSelector = sSelectGroupId + ' .nys_search_terms', // Selector of element to replace htmlsWrapperGroupId = '#nys_section_' + sSelectGroupId,sGroupName = $.trim($(sWrapperGroupId).data('groupid')),iOptSelected = parseInt($target.children('option:selected').attr('data-optno')),sValues = fncGetMultiselectData(sSelectGroupId, iOptSelected),$button = $(sWrapperGroupId + ' .multiselect'),sKeyword = '',aSelectedAll = getSelectedFacets(),sSearchTermString = fncCreateSearchTermString(aSelectedAll), // create the search stringaValues,oData;// Set up data for the ajax call.oData = {'ajax' : 'faceted_search','ajax_type' : 'multiselect','opts' : sValues,'multigroupname' : sGroupName,'pc_id' : 'AD02E7BEBE094359A3B72601B0F6FA8B','search_prod' : '','search_keyword' : sKeyword,sSearchTermQueryString : sSearchTermString};// This is the only way to set a key-value pair with a variable// value for the key.oData[sSearchTermQueryString] = sSearchTerms;// Setup ajaxcall$.ajax({url: 'i_i_faceted_search_window.asp',cache: false,data: oData,dataType: 'text',success: function (sResponse) {// sort the options in each

Bulk Plush Toys | A&A Global Industries (2024)

References

Top Articles
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 5938

Rating: 4 / 5 (51 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.