Code Monkey home page Code Monkey logo

doofinder-magento's Introduction

Doofinder for Magento

Doofinder is an excellent on-site search service that integrates in any website with very little configuration.

This extension:

  • Allows you to easily populate your products to feed Doofinder with data
  • Allows you to integrate the Doofinder Layer easily into your site
  • Allows you to integrate the Doofinder Search with Magento's default internal search.

More information:

Thanks to:

  • @magently for almost all the development
  • @KarlDeux for #114

doofinder-magento's People

Contributors

carlosescri avatar dawidmaczynski avatar dominikklemetowski avatar ecoslado avatar lykhouzov avatar mingoarte avatar paweltatarczuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doofinder-magento's Issues

Uncaught TypeError: this.element.forEach is not a function

Hello,
After Updating Doofinder to version 1.8.7 the following javascript error message appear at the Magentos product page after page loading.
The Homepage and categorie pages works without error.

doofinder-classic.latest.min.js:1 Uncaught TypeError: this.element.forEach is not a function
    at a.each (doofinder-classic.latest.min.js:1)
    at a.on (doofinder-classic.latest.min.js:1)
    at d.start (doofinder-classic.latest.min.js:8)
    at a.configure (doofinder-classic.latest.min.js:6)
    at doofinder-classic.latest.min.js:8
    at c.IncomingMessage.<anonymous> (doofinder-classic.latest.min.js:1)
    at c.IncomingMessage.d.emit (doofinder-classic.latest.min.js:4)
    at A (doofinder-classic.latest.min.js:4)
    at doofinder-classic.latest.min.js:5
    at j.run (doofinder-classic.latest.min.js:4)

Doofinder script //cdn.doofinder.com/media/js/doofinder-classic.latest.min.js

Magento Version CE v1.9.3.1

Magento Doofinder v1.8.7

Add an admin interface to configure the plugin (Part 1)

The configuration must be persisted in db and removed if the user removes the plugin.

Layer Options

For each store view, let the user paste the script inside a textarea and save it to db. The script must be added to the user template if defined for the current store view.

Feed Status cron message incorrect if no finished_at date set

In app/code/community/Doofinder/Feed/Block/Settings/Panel/File.php, the getCronMessage() function does not take into account that the cron schedule record might not have a finished_at value (either hasn't finished executing or failed due to some error).

In such circumstances, the admin will show the following message:

Cron was run for the last time at . Taking into account the settings of the step delay option, there might be problems with the cron's configuration.

While this error is technically correct, it's not very user friendly, as it does not show a last executed date. A possibly better approach would be to determine whether the cron schedule record has a valid finished_at value and if it doesn't, assess whether the cron has failed and show a different error message, like:

Cron task registered but has not completed yet. There is a chance that something is wrong with the execution of the cron. Please check the cron errors.

Cron error message in Admin

Product Data Feed > Feed Status: Always shows a message saying There are no registered cron tasks. Please, check your system's crontab configuration. Seem to be an issue with the way in which the $lastSchedule record is accessed. I have patched this locally on my site, so I will submit a fix for it that you can review

Investigate this error.

2018-01-17T10:53:05+00:00 ERR (3): Warning: Illegal offset type in isset or empty in /.../public_html/app/code/community/Doofinder/Feed/Model/Map/Product/Abstract.php on line 121

Add an admin interface to configure the plugin (Part 2)

Data Feed Options

  • Allow users to choose which fields they want to export in the data feed.
  • Allow users decide which fields will be used for the product description. Mandatory fields like id, title, link, image_link and so on will be obtained from standard fields.

Related to: #3

Notice: Undefined variable: storeCode

version 1.8.1 has issue in the helper:

<pre>Notice: Undefined variable: storeCode  in /var/github/mageeu_stage/webroot/app/code/community/Doofinder/Feed/Helper/Data.php on line 414

#0 /var/github/mageeu_stage/webroot/app/code/community/Doofinder/Feed/Helper/Data.php(414): mageCoreErrorHandler(8, 'Undefined varia...', '/var/github/mag...', 414, Array)
#1 /var/github/mageeu_stage/webroot/app/code/community/Doofinder/Feed/Helper/Data.php(397): Doofinder_Feed_Helper_Data->_processXmlName('doofinder-{stor...', 'de', true)
#2 /var/github/mageeu_stage/webroot/app/code/community/Doofinder/Feed/Model/Observers/Schedule.php(103): Doofinder_Feed_Helper_Data->getStoreConfig('de')
#3 /var/github/mageeu_stage/webroot/app/code/community/Doofinder/Feed/controllers/DoofinderFeedFeedController.php(38): Doofinder_Feed_Model_Observers_Schedule->updateProcess('de', true, true, true)
#4 /var/github/mageeu_stage/webroot/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Doofinder_Feed_DoofinderFeedFeedController->generateAction()
#5 /var/github/mageeu_stage/webroot/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('generate')
#6 /var/github/mageeu_stage/webroot/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /var/github/mageeu_stage/webroot/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#8 /var/github/mageeu_stage/webroot/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /var/github/mageeu_stage/webroot/index.php(83): Mage::run('', 'store')
#10 {main}</pre>

it blocks to use Start Feed Generation Now button in admin panel.

convert html entities when using API

use case:
some product described like this in the product feed (generated by our plugin):

<item>
 <id><![CDATA[8596]]></id>
 <brand><![CDATA[L&#039;Outil Parfait]]></brand>
</item>

As can be seen the "brand" value (L'Outil Parfait) is html-escaped (L&#039;Outil Parfait)

when processing this as an file feed, the html_entities filter takes care of that, but:

when using the reindex feature of our magento plugin, our plugin uses php-doofinder to access doofinder's API, and uploads everything again via API. And there's no html_entities filter in that scenario.

I guess our plugin should either doesn't produce html-escaped values, or unescaping then when reading from the magento products database, or taking care of unescaping them before submitting them via API.

@carlosescri

let know Adrien about this when it's done

https://doofinder.freshdesk.com/a/tickets/14230

Use Magento's CRON capabilities to generate the data feed

  • Users will be able to define the time or times at which they want to generate the data feed.
  • The data feed will be saved into a file in a public path. It will be the data feed URL the user will configure in the Doofinder control panel (at doofinder.com).
  • There will be one file per store view. The user should be able to find and copy the feed URLs to the clipboard in an easy way.

The client made a bad request: Some items were not indexed.

Hello,
I update the Magento Doofinder Module and after I had to do some product change I always got these error message after saving and Magento don´t save anything.

After comment out line 37 in Utils.php I works.

2017-06-01T00:00:00+00:00 ERR (3): 
exception 'Doofinder\Api\Management\Errors\BadRequest' with message 'The client made a bad request: Some items were not indexed. Please check items with ids: [u'50845']' in /var/www/share/htdocs/lib/php-doofinder/src/Management/Errors/Utils.php:37
Stack trace:
#0 /var/www/share/htdocs/lib/php-doofinder/src/Management/Client.php(83): Doofinder\Api\Management\Errors\Utils::handleErrors(400, '{"detail":"Some...')
#1 /var/www/share/htdocs/lib/php-doofinder/src/Management/SearchEngine.php(146): Doofinder\Api\Management\Client->managementApiCall('PUT', '051dc0edf79d025...', NULL, '[{"title":"Klim...')
#2 /var/www/share/htdocs/app/code/community/Doofinder/Feed/Model/Observers/Feed.php(115): Doofinder\Api\Management\SearchEngine->updateItems('product', Array)
#3 /var/www/share/htdocs/app/code/core/Mage/Core/Model/App.php(1358): Doofinder_Feed_Model_Observers_Feed->updateSearchEngineIndexes(Object(Varien_Event_Observer))
#4 /var/www/share/htdocs/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Doofinder_Feed_Model_Observers_Feed), 'updateSearchEng...', Object(Varien_Event_Observer))
#5 /var/www/share/htdocs/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#6 /var/www/share/htdocs/app/code/core/Mage/Core/Model/Abstract.php(466): Mage::dispatchEvent('catalog_product...', Array)
#7 /var/www/share/htdocs/app/code/core/Mage/Catalog/Model/Product.php(549): Mage_Core_Model_Abstract->_afterSave()
#8 /var/www/share/htdocs/app/code/core/Mage/Core/Model/Abstract.php(319): Mage_Catalog_Model_Product->_afterSave()
#9 /var/www/share/htdocs/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(728): Mage_Core_Model_Abstract->save()
#10 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->saveAction()
#11 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('save')
#12 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/share/htdocs/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/share/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /var/www/share/htdocs/index.php(83): Mage::run('', 'store')
#16 {main}

Magento Version CE v1.9.3.1

Magento Doofinder v1.8.7

Fallback to own Magento search in case of search API error

Seems that any API error is caught here:

try {
$queryArgs = array('rpp' => $limit, 'transformer' => 'onlyid', 'filter' => array());
// @codingStandardsIgnoreStart
$results = $client->query($queryText, null, $queryArgs);
// @codingStandardsIgnoreEnd
} catch (\Doofinder\Api\Search\Error $e) {
$results = null;
Mage::logException($e);
}

And an empty array of results is set. The method is called from here:

$helper = Mage::helper('doofinder_feed/search');
// Fetch initial results
$results = $helper->performDoofinderSearch($queryText);
$adapter = $this->_getWriteAdapter();

Instead of getting empty results would be better to log the error and fallback to the default search results.

Error with message 400 - Non allowed escape characters in query string

Hello,
I update the Magento Doofinder Module to the latest Version and until this I have this exception:

2017-06-07T00:00:04+00:00 ERR (3): 
exception 'Doofinder\Api\Search\Error' with message '400 - {"error":"Non allowed escape characters in query string"}' in /var/www/share/htdocs/lib/php-doofinder/src/Search/Client.php:172
Stack trace:
#0 /var/www/share/htdocs/lib/php-doofinder/src/Search/Client.php(231): Doofinder\Api\Search\Client->apiCall('search', Array)
#1 /var/www/share/htdocs/lib/php-doofinder/src/Search/Client.php(502): Doofinder\Api\Search\Client->query('HKK%20Aktive%20...', 2)
#2 /var/www/share/htdocs/app/code/community/Doofinder/Feed/Helper/Search.php(100): Doofinder\Api\Search\Client->nextPage()
#3 /var/www/share/htdocs/app/code/community/Doofinder/Feed/Model/CatalogSearch/Resource/Fulltext.php(104): Doofinder_Feed_Helper_Search->getAllResults()
#4 /var/www/share/htdocs/app/code/core/Mage/CatalogSearch/Model/Fulltext.php(136): Doofinder_Feed_Model_CatalogSearch_Resource_Fulltext->prepareResult(Object(Mage_CatalogSearch_Model_Fulltext), 'HKK%20Aktive%20...', Object(Mage_CatalogSearch_Model_Query))
#5 /var/www/share/htdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php(147): Mage_CatalogSearch_Model_Fulltext->prepareResult()
#6 /var/www/share/htdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php(126): Mage_CatalogSearch_Model_Resource_Fulltext_Collection->getFoundIds()
#7 /var/www/share/htdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php(113): Mage_CatalogSearch_Model_Resource_Fulltext_Collection->_applySearchFilters()
#8 /var/www/share/htdocs/lib/Varien/Data/Collection.php(225): Mage_CatalogSearch_Model_Resource_Fulltext_Collection->getSize()
#9 /var/www/share/htdocs/app/code/local/Mana/Seo/Model/Observer.php(101): Varien_Data_Collection->getLastPageNumber()
#10 /var/www/share/htdocs/app/code/core/Mage/Core/Model/App.php(1358): Mana_Seo_Model_Observer->prepareMetaData(Object(Varien_Event_Observer))
#11 /var/www/share/htdocs/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mana_Seo_Model_Observer), 'prepareMetaData', Object(Varien_Event_Observer))
#12 /var/www/share/htdocs/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#13 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(351): Mage::dispatchEvent('controller_acti...', Array)
#14 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#15 /var/www/share/htdocs/app/code/core/Mage/CatalogSearch/controllers/ResultController.php(77): Mage_Core_Controller_Varien_Action->loadLayout()
#16 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_CatalogSearch_ResultController->indexAction()
#17 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#18 /var/www/share/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /var/www/share/htdocs/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#20 /var/www/share/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /var/www/share/htdocs/index.php(83): Mage::run('', 'store')
#22 {main}

Magento Version CE v1.9.3.1

Magento Doofinder v1.8.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.