Skip to content

Commit

Permalink
Merge dev into main
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-pm committed Feb 24, 2023
2 parents 73477fb + c9ac139 commit a3c01c8
Show file tree
Hide file tree
Showing 60 changed files with 6,311 additions and 2,325 deletions.
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"env": {
"browser": true,
"es2021": true
},
"rules": {
"indent": ["error", 4],
"@typescript-eslint/no-unused-vars": "error"
}
}
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
# Instant Search plugin 3.0 for Zen Cart 1.5.7 and 1.5.8
# Instant Search plugin 4.0 for Zen Cart 1.5.7 and 1.5.8
Show autocomplete search results while the user is typing. Show relevant search results in a listing page with
infinite scroll.

# Features
This plugin uses a combination of MySQL Full-Text Search and LIKE/REGEXP queries to quickly find and sort products,
brands, and categories based on their relevance to the user query.

With the [Typesense add-on](https://github.com/marco-pm/zencart_typesense), Typesense can be used as a search
engine in place of MySQL.

The results can be displayed in an autocomplete dropdown as the user types in a search box and/or as a search
results page with a sortable product list and infinite scroll once the user submits the search form, providing an
alternative to the classic Zen Cart search results page.

Version 3.0 of the plugin brings new features and substantial improvements to previous versions.
Version 4.0 of the plugin brings new and improved features:
- Refactor of the search class to allow the use of different search engines (with automatic fallback to MySQL
if the search engine is unavailable)
- Support for using Typesense as a search engine (with the [Typesense add-on](https://github.com/marco-pm/zencart_typesense))
- Improved display of categories and brands in the dropdown
- Search in the product category and brand
- Complete rewrite of the JavaScript code of dropdown and results page with React and TypeScript
- Improved dropdown accessibility and keyboard navigation
- Various bug fixes and improvements

These add to the features and improvements of version 3.0:
- Faster and better searches, with MySQL Full-Text search and Query Expansion
- New, additional search results page with sortable product list and infinite scroll
- New admin settings, including control of which fields to search and their order
- New admin settings, including control of which product fields to search and their order
- More robust dropdown auto-positioning
- Support for Zen Cart 1.5.8 language files and plugin upgrade functionality
- Integration with Search Log plugin
- Responsive Classic and Bootstrap template files included
- Code almost entirely rewritten, removed jQuery dependency, and many other improvements
- No modifications to Zen Cart core files
- More features coming in the next versions!

There are no modifications to Zen Cart core files.

# Prerequisites
- Zen Cart 1.5.7 or 1.5.8
Expand All @@ -34,6 +47,18 @@ See the [readme.html](https://htmlpreview.github.io/?https://github.com/marco-pm

See also the FAQS & troubleshooting section in the [readme.html](https://htmlpreview.github.io/?https://github.com/marco-pm/zencart_instantsearch/blob/main/readme.html).

# Development
To build the `.js` files from the `.tsx` sources, install Node.js and NPM, then run:
```
npm install
# dropdown:
npm run build-instant_search_dropdown
# results page:
npm run build-instant_search_results
```

# Testing
Unit and integration tests use the [Test Framework](https://docs.zen-cart.com/dev/testframework/) of Zen Cart 1.5.8.
Place the content of the `tests` directory of this repo under `/not_for_release/testFramework`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package Instant Search Plugin for Zen Cart
* @author marco-pm
* @version 3.0.1
* @version 4.0.0
* @see https://github.com/marco-pm/zencart_instantsearch
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package Instant Search Plugin for Zen Cart
* @author marco-pm
* @version 3.0.1
* @version 4.0.0
* @see https://github.com/marco-pm/zencart_instantsearch
* @license GNU Public License V2.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package Instant Search Plugin for Zen Cart
* @author marco-pm
* @version 3.0.1
* @version 4.0.0
* @see https://github.com/marco-pm/zencart_instantsearch
* @license GNU Public License V2.0
*/
Expand All @@ -23,19 +23,7 @@
<?php echo '</form>'; ?>
<?php } ?>

<div id="instantSearchResults__noResultsFoundWrapper">
<?php echo TEXT_NO_PRODUCTS_FOUND; ?>
</div>

<div id="productListing" class="group">
</div>

<div id="instantSearchResults__loadingWrapper">
<?php echo TEXT_LOADING_RESULTS; ?>
<div class="spinner"></div>
</div>

<?php // don't remove this div ?>
<div id="instantSearchResults__end"></div>

</div>
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"description": "Instant Search plugin for Zen Cart",
"homepage": "https://github.com/marco-pm/zencart_instantsearch",
"license": "GPL-2.0",
"authors": [
{
"name": "marco-pm"
}
],
"require": {
"php": "^7.4|^8.0|^8.1|^8.2",
"zencart/zencart": "^v1.5.7|^v1.5.8"
"php": "7.4 - 8.2"
},
"require-dev": {
"php": "^7.4|^8.0|^8.1|^8.2",
"phpunit/phpunit": "^9.5"
"php": "8.0 - 8.2"
}
}
}
Loading

0 comments on commit a3c01c8

Please sign in to comment.