News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Smart search in Virtuemart for Joomla 4

Started by bestcons, December 25, 2021, 22:29:07 PM

Previous topic - Next topic

JoomlaGeek.com

Quote from: pinochico on July 12, 2023, 22:34:05 PM
gek-elastic search we implemented on shop in 2016 with custom developping...

After 4 months we make off, because amazon DB cost 150 EUR per month.

Now we use Elastic search as Search Ready - https://www.searchready.cz - on the shop - www.karcher-satter.cz
Or Ajax Search from Rupostel - look at the www.zelenazeme.cz or www.cannadorra.hu

If you use dedicated server or VPS, you can free download Elasticsearch and install it to your server. It's totally free without any monthly cost.
You can use Searchly replace for AWS in case you are not able to install Elasticsearch to the server, Searchly is very reasonable price cloud Elasticsearch service.
FYI.

Dud3

#16
Since nobody wanted to do this, I've made it on my own.

Here is the github link to the package which contains all plugins needed to use the smart search aka finder:
https://github.com/Dudebaker/Virtuemart-Finder

The Virtuemart-Core is missing some events, so these had to be done with an additional system plugin.

Maybe the Virtuemart dev-team can add these events (would only be 4 lines of code) and maybe they can use this package as base to add it to the Virtuemart-Package.

Roderic

Thanks for your work! I've tested it in Joomla 5.1 and VM 4.2.8. Seems to work, it just runs into this error when there is characters in the product name like ß. Duplicate entry 'set weiss-de' for key 'idx_term_language'

But I think that is a Smart Search (Finder) issue, not per se your plug-in. Or maybe the collation setting. I've currently set it to: utf8mb4_unicode_520_ci

What I am missing however, is the incorporation of searching for SKU, GTIN and MPN. Currently I am using Custom Filters Pro search from Breakdesigns. Here you can also set the search to look in those fields. Would it be hard to implement this into your plug-in?

Dud3

SKU and GTIN is already included in indexing.
I've now added MPN in v1.0.1.

And you're right, this issue seems to be a bug in the finder.

balai

Thanks Dud3!
I urge @milbo to have a look at that and add the required event triggers.

depika

Your plugin is great. But I just installed the latest version of VM (4.2.16) and upon save of products I am getting the following error. When I disabled the plugin plgVmCustomFinder the error was gone. I would appreciate your help.

An error has occurred.      
0 Joomla\CMS\Event\Model\SaveEvent::onSetSubject(): Argument #1 ($value) must be of type object, string given, called in /home/depikabi/jmakdepika/libraries/src/Event/AbstractEvent.php on line 227      
Call Stack      
#   Function   Location
1   ()   JROOT/libraries/src/Event/Model/SaveEvent.php:42
2   Joomla\CMS\Event\Model\SaveEvent->onSetSubject()   JROOT/libraries/src/Event/AbstractEvent.php:227
3   Joomla\CMS\Event\AbstractEvent->setArgument()   JROOT/libraries/src/Event/AbstractEvent.php:115
4   Joomla\CMS\Event\AbstractEvent->__construct()   JROOT/libraries/src/Event/AbstractImmutableEvent.php:51
5   Joomla\CMS\Event\AbstractImmutableEvent->__construct()   JROOT/libraries/src/Event/Model/ModelEvent.php:55
6   Joomla\CMS\Event\Model\ModelEvent->__construct()   JROOT/libraries/src/Application/EventAware.php:106
7   Joomla\CMS\Application\WebApplication->triggerEvent()   JROOT/plugins/vmcustom/finder/finder.php:34
8   plgVmCustomFinder->plgVmAfterStoreProduct()   JROOT/libraries/src/Plugin/CMSPlugin.php:289
9   Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}()   JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:454
10   Joomla\Event\Dispatcher->dispatch()   JROOT/libraries/src/Application/EventAware.php:111
11   Joomla\CMS\Application\WebApplication->triggerEvent()   JROOT/administrator/components/com_virtuemart/helpers/vdispatcher.php:41
12   vDispatcher::trigger()   JROOT/administrator/components/com_virtuemart/models/product.php:2903
13   VirtueMartModelProduct->store()   JROOT/administrator/components/com_virtuemart/helpers/vmcontroller.php:178
14   VmController->save()   JROOT/administrator/components/com_virtuemart/controllers/product.php:72
15   VirtuemartControllerProduct->save()   JROOT/libraries/src/MVC/Controller/BaseController.php:730
16   Joomla\CMS\MVC\Controller\BaseController->execute()   JROOT/administrator/components/com_virtuemart/virtuemart.php:77
17   require_once()   JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
18   Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}()   JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
19   Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()   JROOT/libraries/src/Component/ComponentHelper.php:361
20   Joomla\CMS\Component\ComponentHelper::renderComponent()   JROOT/libraries/src/Application/AdministratorApplication.php:150
21   Joomla\CMS\Application\AdministratorApplication->dispatch()   JROOT/libraries/src/Application/AdministratorApplication.php:195
22   Joomla\CMS\Application\AdministratorApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:306
23   Joomla\CMS\Application\CMSApplication->execute()   JROOT/administrator/includes/app.php:58
24   require_once()   JROOT/administrator/index.php:32

depika

Quote from: depika on June 25, 2024, 20:13:56 PMYour plugin is great. But I just installed the latest version of VM (4.2.16) and upon save of products I am getting the following error. When I disabled the plugin plgVmCustomFinder the error was gone. I would appreciate your help.

An error has occurred.      
0 Joomla\CMS\Event\Model\SaveEvent::onSetSubject(): Argument #1 ($value) must be of type object, string given, called in /home/depikabi/jmakdepika/libraries/src/Event/AbstractEvent.php on line 227      
Call Stack      
#   Function   Location
1   ()   JROOT/libraries/src/Event/Model/SaveEvent.php:42
2   Joomla\CMS\Event\Model\SaveEvent->onSetSubject()   JROOT/libraries/src/Event/AbstractEvent.php:227
3   Joomla\CMS\Event\AbstractEvent->setArgument()   JROOT/libraries/src/Event/AbstractEvent.php:115
4   Joomla\CMS\Event\AbstractEvent->__construct()   JROOT/libraries/src/Event/AbstractImmutableEvent.php:51
5   Joomla\CMS\Event\AbstractImmutableEvent->__construct()   JROOT/libraries/src/Event/Model/ModelEvent.php:55
6   Joomla\CMS\Event\Model\ModelEvent->__construct()   JROOT/libraries/src/Application/EventAware.php:106
7   Joomla\CMS\Application\WebApplication->triggerEvent()   JROOT/plugins/vmcustom/finder/finder.php:34
8   plgVmCustomFinder->plgVmAfterStoreProduct()   JROOT/libraries/src/Plugin/CMSPlugin.php:289
9   Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}()   JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:454
10   Joomla\Event\Dispatcher->dispatch()   JROOT/libraries/src/Application/EventAware.php:111
11   Joomla\CMS\Application\WebApplication->triggerEvent()   JROOT/administrator/components/com_virtuemart/helpers/vdispatcher.php:41
12   vDispatcher::trigger()   JROOT/administrator/components/com_virtuemart/models/product.php:2903
13   VirtueMartModelProduct->store()   JROOT/administrator/components/com_virtuemart/helpers/vmcontroller.php:178
14   VmController->save()   JROOT/administrator/components/com_virtuemart/controllers/product.php:72
15   VirtuemartControllerProduct->save()   JROOT/libraries/src/MVC/Controller/BaseController.php:730
16   Joomla\CMS\MVC\Controller\BaseController->execute()   JROOT/administrator/components/com_virtuemart/virtuemart.php:77
17   require_once()   JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
18   Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}()   JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
19   Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()   JROOT/libraries/src/Component/ComponentHelper.php:361
20   Joomla\CMS\Component\ComponentHelper::renderComponent()   JROOT/libraries/src/Application/AdministratorApplication.php:150
21   Joomla\CMS\Application\AdministratorApplication->dispatch()   JROOT/libraries/src/Application/AdministratorApplication.php:195
22   Joomla\CMS\Application\AdministratorApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:306
23   Joomla\CMS\Application\CMSApplication->execute()   JROOT/administrator/includes/app.php:58
24   require_once()   JROOT/administrator/index.php:32


Noone is having this issue?

Dud3

Sorry for the late answer... that had do to with newer Joomla 5 Versions and how they handle now the Finder-Events.

I've updated the package to v1.1.0:
Made compatible to Joomla 5.1.2
Removed all code-parts which where deprecated and would get removed with Joomla 6.