added code for promotedSuggestions & for special characters on hover … - #110
added code for promotedSuggestions & for special characters on hover …#110yuvakishore-dommaraju wants to merge 2 commits into
Conversation
| this.$input.val($(lis[this.activeRow]).data('value')); | ||
| if (this.options.filtered && this.activeColumn === 0) { | ||
| var dataValue = $(lis[this.activeRow]).attr('data-value') ? $(lis[this.activeRow]).attr('data-value') : ''; | ||
| var dataValue = $(lis[this.activeRow]).attr('data-value') ? $(lis[this.activeRow]).attr('data-value').replace('amp;', '') : ''; |
There was a problem hiding this comment.
Sanitize this in catalog.
There was a problem hiding this comment.
Integration done from on-boarding portal so we are not able to add functionality from onboarding console
| var cmpld = "" | ||
| if (self.options.popularProducts.viewMore && self.options.popularProducts.viewMore.enabled) { | ||
| cmpld = Handlebars.compile(self.preparefilteredPopularProducts() + self.options.popularProducts.viewMore.tpl); | ||
| if (this.options.popularProducts.viewMore && this.options.popularProducts.viewMore.enabled) { |
There was a problem hiding this comment.
why we replaced self with this, we are making sure of scope of options by defining self
There was a problem hiding this comment.
for self this is not assigned in this function, which is leading for errors like popularProducts are undefined
There was a problem hiding this comment.
This is fixed in master as of now
| if (typeof this.options.onItemSelect == "function" && data.type !== "POPULAR_PRODUCTS_FILTERED") { | ||
| this.options.onItemSelect.call(this, data, this.currentResults[data.type][parseInt(data['index'])]._original, e); | ||
| if (typeof this.options.onItemSelect == "function" && data.type !== "POPULAR_PRODUCTS_FILTERED" && data.type !== "POPULAR_PRODUCTS") { | ||
| this.options.onItemSelect.call(this, data, this.currentResults['COMBINE_RESULTS'][parseInt(data['index'])]._original, e); |
There was a problem hiding this comment.
do we need COMBINE_RESULTS
There was a problem hiding this comment.
added sorting functionality as well, there are customers who look for sorting irrespective of suggestions since, we are making changes in library all things can be tested once so that next time we no need to change library simply we can handle from config
There was a problem hiding this comment.
Sorting is added if infields are not present in suggestions, let's enhance on that?
Line 1597
| +'</span></li>' | ||
| +'{{/if}}' | ||
|
|
||
| // +'{{#if isInField}}' |
There was a problem hiding this comment.
why we have this comment.
| } | ||
| } | ||
|
|
||
| if(self.currentResults['POPULAR_PRODUCTS'].length == 0 && !isMobile.any()) { |
There was a problem hiding this comment.
removing, seems like it's customised for ikea
| uniqueInfields = [], | ||
| uniqueSuggestions = []; | ||
|
|
||
| var sorted_list = [], |
There was a problem hiding this comment.
Add description why we need this.
|
@yuvakishore-dommaraju why is there a question on PR description. |
| //use unbxd scope and add a version for autosuggest | ||
| window.Unbxd = window.Unbxd || {}; | ||
| Unbxd.autosuggestVersion = "1.0.1"; | ||
| Unbxd.autosuggestVersion = "1.0.1"; |
| return v1 === v2 ? options.fn(this) : options.inverse(this); | ||
| }); | ||
|
|
||
| Handlebars.registerHelper('removeDots', function(id){ |
There was a problem hiding this comment.
Why we need this helper?
| , popularProducts: { | ||
| count: 2 | ||
| , price: true | ||
| , fields:['*'] |
| var query = dataValue + (dataFiltername != '' ? ':' + dataFiltername + ':' + dataFiltervalue : '') | ||
| // updating product header while hovering on suggestions | ||
| if (this.options.filtered && this.options.popularProducts.header) { | ||
| if (this.options && this.options.popularProducts.header) { |
There was a problem hiding this comment.
why we removed filtered
There was a problem hiding this comment.
parent level If condition is checking for this.options.filtered so here If we make sure options & popularProducts pass the condition that will be enough
I'm not sure adding those parameters will impact existing clients or not who are using this library so, checking. If these changes (mentioned in comments) will not impact any clients I can change add it to the code @ganeshparsads |
added code for promotedSuggestions & for special characters on hover of suggestions
While creating autoSuggest Url: — do I need to add following params as default or not ? (I have not added for the following Items)
--> variants=true
--> variants.fields= fieldValues {{variant_products_fields ? variant_products_fields : '*’}}
--> filter=-unbxd_isSearchable_uFilter:"false"&filter=-unbxd_isSearchable_filter:”false"
--> not made changes for
relevantDocumentin processfilteredPopularProducts & processPopularProducts functions