![](http://docs.cs-commerce.com/media_storage/8a2dd8e4-655f-4acb-a3dd-a5a019032512/projects/b1e9762e-2aeb-4da8-80df-1bcea5e5e657/uploads/logo.png)
Live search addon for cs-cart
Live search add-on
Live search add-on
A powerful and functional set of search tools for your website. It is a worthy alternative to cloud-based site search services, while having unique functionality.
Key features of the add-on:
- Search for products, brands, categories, text pages and sellers (for multivendor edition) on your website;
- Browse products by category directly in the search popup block;
- Keyboard navigation through the search results;
- Settings of the fields for which you want to search;
- Correction of spelling errors or phrases using the built-in Yandex Speller service;
- Select of two pre-installed themes with the ability to change the color scheme of each of them;
- Maintaining search history with the ability to view in 4 slices:
- by requests
- by search phrases
- by cliecked products
- by users - "Synonyms" functionality;
- "Stop Words" functionality;
- "Search motivation" functionality;
- Search phrases management;
- Build in search speed-up functionality (for hardloaded projects with more than 100 000 products).
The add-on is compatible with the entire cs-cart 4.x branch with such editions as CS-Cart, CS-Cart Ultimate, Multivendor, Multivendor Plus, Multivendor Ultimate. At the moment there is no information about the complete incompatibility with any theme. If an add-on conflicts with your theme, please contact via our Help Center.
The add-on is incompatible with any other search add-on.
After success payment, your order will be automatically marked as Paid within a few minutes. Once order changed to Paid status - add-on License activation passed success and you will received an e-mail with confirmation the receipt of payment and a second e-mail with a download add-on link. You can also download the add-on in our License Management section of our website. To install the add-on on your website, please follow these steps:
- Download the latest version of the add-on on our website in the "License Management" section or via the link sent by e-mail.
- Go to Add-ons → Manage Add-ons and in the gear button, select Manual Installation.
- Select the downloaded file and complete the installation of the add-on.
Add-on installation is completed. To go to the add-on settings page, select the installed add-on in the top menu Add-ons → CS-Commerce add-on
After add-on installation, its settings are set to default values. To access the add-on settings in the admin panel, go to the Add-ons → CS-Commerce add-ons section and select installed add-on from the drop-down list.
Setup search objects
Main settings tab of the add-on allows you to select search objects and set display limits. There are several settings that we want to focus on:
- "Display out of stock products on end of the list" - Enabling this option will force Display out of stock products on end of the list independent of selection sorting.
- "Automatically increase the search popularity of a product" - This option allows you to automatically increase the rank of a product to a specific search query. The more users click on a product from a specific search phrase, the higher this product will be displayed for this search phrase. This option works only for sorting "By relevance based on popularity"
- "Show search based categories filter" - Select this option to display categories filter block directly in the search window. User can filter by several categories at once.
- "Suggest corrections" - Enable this option to suggest corrections of typos, incorrect layout, etc. Powered by Yandex Speller service.
Product search settings
In this section of settings, you can select the fields by which the search will be carried out. Check the boxes you want to search for. If you mark the search by features, you will be asked to select specific features by which you want to search.
Additional search fields are placed in a separate group. Search will not work on them if you enable the "Search Accelerator" function.
Tip: Check only the required fields for your search. Select only those search ауфегкуы that contain information useful to the buyer. The fewer fields for search are marked, the less the load on the server and, as a result, the search results are displayed faster.
The "Extra settings" group allows you:
- set the minimum number of characters to start searching for products;
- enable automatic redirection to the product page if only one product was found;
- block the user's redirection to the search results page by pressing the "Enter" button.
Supported search fields:
- Product Name, description and short description;
- Product Code and Product ID;
- Search keywords;
- Product features and options;
- Meta title, Meta description, Meta keywords;
- Product tags.
Multivendor settings
For Multivendor, Multivendor PLUS and Multivendor ULTIMATE editions, an additional settings tab will be displayed. It collects settings that are relevant only for these editions. You can enable the search by seller stores and set a limit to display. You can also set access rights to the history of product search for vendors.
The add-on has a built-in styles editor with a preview of the search results block. Admin is offered several themes for displaying the search window (Modern and Classic), and it is also possible to change the color palette of the selected theme. In addition, in this section of settings, the administrator can show or hide individual elements of the search window, such as:
- The price of the product
- Product code
- Add to cart button
- Add to favorites button
- Add to Compare List button
- Quick View button
This section is intended for the analysis of search queries and the analysis of user preferences. The search history is presented in four groups:
- All search queries with user information, selected language and timestamp.
- By search phrases. This section contains all search phrases, displaying information about the number of requests for a search phrase and the number of clicks on products.
- By product. A list of products will be displayed, to which customers moved from the search with clicks info on each of the products, and what search phrases were used to find this product.
- User search history. Allows you to see the search history for specific user, if the user was logged in.
For search phrases or parts of them, you can set synonyms. Sometimes, the same products can have different names due to language dialects or word abbreviations. For example, on a website you sell laptops, and some customers type in "workstation". In order for the buyer to finally see the Laptops, you need to add a synonym for the search phrase "Workstation". You can set an unlimited number of synonyms for one search phrase.
Tip: Use only relevant synonyms. Otherwise, in the search results, the buyer will not see what he is really looking for. Also, the more synonyms for a search phrase, the slower the search for such phrase.
Synonyms can be added using the admin panel interface, as well as through data import/export.
You can globally enable or disable Synonyms function in the search using the switch located at the top of the side menu.
In some cases, products do not need to be displayed for some search queries. For example, on the website you sell Oil and Broilers. Thus, it is not logical to display Broilers products for the search phrase "Oil". To prevent such products from being displayed, you can add the stop word "Broiler" to the search phrase "Oil". You can add multiple stop words for one search phrase. A stop word is not necessarily a single word, it can be a whole phrase or a sentence.
Tip: Do not set too short stop words or words that can be part of the relevant word of other products. You can inadvertently blocking relevant search results.
Stop words can be added using the admin panel interface, as well as through data import/export.
You can globally enable or disable stop words function in search with the switch located at the top of the side menu.
You can use the Search Motivation feature to encourage search usage on your site. Create messages or suggestions for buyers that might interest them. You can set an unlimited number of messages, all of them will be displayed by typing emulation in the search field one by one.
You can turn the search motivation on or off with the switch located at the top of the side menu.
The "Search phrases" section is designed to manage suggestions when you start typing a search phrase in the search window, as well as to display the featured products set by the administrator for a specific search phrase. Recommended products are displayed regardless of whether they are relevant to the search query or not.
Create popular search terms for your website and save your customers' time.
On/Off toggle suggestions and Featured products are located at the top of the sidebar.
You can manage search phrases using the admin panel interface, as well as through data import / export.
The search speed-up is devepoped for highly loaded projects with a more than 100 thousand products and search results are given slowly. How the Search Speed-up works:
- Product indexing makes product clusters based on the first letters of all words of the indexed product fields.
- The cluster size is the number of letters that will form the cluster. Recommended setting for Latin and Cyrillic layouts is 2.
- During a search query, the speed-up function determines which clusters the search phrase is related to and searches for products only within these clusters.
Thus, the amount of data for search is reduced by several times, and often by dozens of times.
The search speed-up has limitations on search results. It doesn't look for a search phrase in the middle or end of a word. The search will always work based on the first letters of the search phrase. For example, if a user types "amsung", then products with the word "Samsung" in their names will not be found. At the same time, the search will successfully return such products to the request "Sams".
Indexation is automatically on updating products in the admin panel, but before you enable the speed-up function for the first time, please, don't forget to start indexing products.
In order to have access to add-on upgrades, you must have an active upgrade subscription. If the subscription period has expired, you will only have access to upgrades released before the expiration date of your subscription. You can renew your upgrades subscription in the "License Management" section on our website.
The add-on supports instant upgrades via the CS-Cart Upgrade Center. The built-in CS-Cart Notification Center (bell) will notify you about new versions release of the add-on. Upgrades via Upgrades Center will allow you to switch to a newer version without losing add-on data and settings.
Before start an upgrade process, it is highly recommended to make a full backup of the site (database and files) of your store using the server or hosting methods.
Upgrade through the Upgrade Center
- In the top menu, go to Administration → Upgrade Center;
- In the gear menu, click "Refresh available upgrades"
- Find and add-on on list of available upgrades and click the Download button and than Install button;
- Follow all the instructions that will be shown during the upgrade process;
- It is recommended to clear the CS-Cart templates cache after the upgrades are installed by deleting the var/cache folder on your server or adding the ctpl parameter to the address bar (example: https://domain.com/admin.php?ctpl).
Addon Reinstallation by uninstall old and install new:
Reinstalling an add-on means deleting the add-on's settings and data. Reinstallation will allow you to get a clean installation of the latest addon version. To reinstall the add-on with saving the add-on settings and data, please contact us via our Support Center to provide this service.
To completely reinstall an add-on without saving data, follow these steps:
- Go to Add-ons → Manage add-ons and find the old installed add-on.
- Click the delete button in the gear menu of the add-on.
- Download the latest version of the add-on on our website in the "License Management" section.
- Go to Add-ons → Manage add-ons and in the gear menu select Manual Installation. Select the previously downloaded file and complete the installation of the add-on.
The technical support of the add-on is already included in its price. Before contacting the support center, please make sure you are using the latest released version of the add-on. Old versions of the add-on are not supported by technical support.
To use our technical support, follow these steps:
- On our support center site https://helpdesk.cs-commerce.com/, log in with your account;
- Click on the "Create ticket" button;
- Fill in all the required fields and create ticket (you will receive a confirmation email);
- Expect a response from a specialist (a notification will be sent to your e-mail about the response) in accordance with the regulations of the technical support service.
If you have not received an answer within the time frame specified in the regulations, write us a message to the e-mail [email protected] with the subject of the ticket and we will try to resolve your issue as soon as possible.
Technical support via chat on the site, direct phone calls or e-mail letters is not provided. All help discuss goes through the support center. Carefully study the documentation for the add-on and the terms of technical support before creating a ticket.
We recommend that you familiarize with the general restrictions:
- Fragments of code or some files of an add-on may have a private (encoded) part. The coded part does not create problems on add-on customizations;
- The add-on will work only on those domains that are specified in the user's license. If you try to use the solution the domains of which are not included in the license, the add-on will be automatically disabled;
- Installing on local machines is not allowed by the licensing system. For the add-on to work on an additional domain (alias), specify this alias on the license management page. Up to three aliases are allowed per domain for testing and development purposes. You can change the main license domain yourself on the license management page.
To have possibility to add or change license domains and aliases, the upgrade subscription must be active. To change the license domain of an expired upgrades subscription, you must first renew your subscription.
PHP Hooks
The add-on does not support cs-cart php hooks, therefore, its own connection scheme was developed, which fits into the cs-cart connections.
The add-on has 3 built-in hooks:
- hooks_get_products Variables:
$ls_settings - array() addon settings
$company_id - int() current storefront ID
$params - array() query data
$fields - array() fields to display
$join - string() Join data
$condition - string() conditions string
$sorting - string() sorting
$limit - string() products limit - hooks_get_joins Variables:
$ls_settings - array() addon settings
$params - array() query data
$join - string() Join data - hooks_get_conditions Variables:
$ls_settings - array() addon settings
$params - array() query data
$condition - string() conditions string - hooks_get_fields Variables:
$ls_settings - array() addon settings
$params - array() query data
$fields - array() fields array - hooks_before_response Variables:
$ls_settings - array() addon settings
$company_id - int() current storefront ID
$params - array() query data
$response - array() data to response
Using the built-in add-on my_changes as an example, let's connect to the hooks_get_products hook, which is located before the request to receive products:
- Create a hooks.post.php file in the add-on's directory app/addons/my_changes/schemas/csc_live_search;
- Add value to the $schema['developers']['hooks_get_products']['variants'] array, the key of which is the directory of the function file. Sample code for the hooks.post.php file:
<?php if (!defined('BOOTSTRAP')) { die('Access denied'); } $schema['developers']['hooks_get_products']['variants']['/app/addons/my_changes/fn_file_name_same_as_function_name.php']='My changes hook function'; return $schema;
- Create the appropriate file referred from the hooks.post.php file and create one function in it, the name of which is the same as the file name. In our case, this is fn_file_name_same_as_function_name, accept the sent variables and modify to get the necessary search conditions. Example file content:
<?php if (!defined('BOOTSTRAP')) { die('Access denied'); } function fn_file_name_same_as_function_name($ls_settings, $company_id, $params, $fields, $join, &$condition, $sorting, $limit){ }
- Clear the admin panel cache, then go to the settings page of the live search add-on to the developers section and select the hook that you added in the selectbox. Save the settings.
Integration with the hook of the live search add-on is completed.
JQUERY Event
To have possibility to change product list, or add additional elements on search results popup we have added custom events. You can catch this event and make needed changes. There are two events:
- cls.after.insert - is triggered when user types and we insert html into search popup block.
- cls.after.append - is triggered when user press show more button and data is appended to search popup block.
How to use: Use $(document).on()) construction to catch event and make needed changes:
$(document).on( "cls.after.insert", function(event, data, elm) {
});
$(document).on( "cls.after.append", function(event, data, elm) {
});
Where data - is array of all items data, received from request, and elm - is block, where data was inserted.
Example, where we adding product code to end of product name:
$(document).on( "cls.after.insert", function(event, data, elm) {
if (data.items){
$.each(data.items, function(i, product){
$(elm).find('li[pid="' + product.product_id + '"] .clsProduct').append(" " + product.product_code);
});
}
});
Version 7.2.0 October 21 2021
What's new:
- Added additional php hooks for developers
- Added JQUERY events to have possibility to change data on search results popup.
- Added antibot protection
- Optimized loading function
- Added possibility to search an all products features
- More than 10 small bugs fixed
Version 7.0.8 August 16 2021
What's new:
- Added additional hooks for developers hoosk_get_fields
- Added max-width param of search window for desktop devices
- Added search variations mode
- Multivendor: Added possibility to get access for vendors on search histrory
Version 7.0 August 1 2021
The 7.x version branch is the new generation of the live search add-on. Everything has been changed, from the internal architecture of the add-on to the appearance. The add-on was developed from scratch, relying on the accumulated experience of the old 5.x branch, so all the functions is preserved, and at the same time new ones have been added. Changing the architecture of the add-on has made possibility to achieve a significant acceleration of the search and unlimited possibilities for further expanding the functionality of the add-on.
So what's new in version 7.0:
- Filter search results by categories directly in the search popup;
- Keyboard Navigation on search results in popup;
- Search synonyms;
- Ability to choose a theme (Modern and Classic) and change color schemes for each of them
- Built-in search speed-up (for high-load projects);
- Search motivation;
- Search phrases;
- Search history by user.
- Quick view and add to the compare list buttons.