コード例 #1
0
 public function __construct()
 {
     \AlgoliaSearch\Version::$custom_value = " Magento (1.4.2)";
     $this->algolia_helper = Mage::helper('algoliasearch/algoliahelper');
     $this->page_helper = Mage::helper('algoliasearch/entity_pagehelper');
     $this->category_helper = Mage::helper('algoliasearch/entity_categoryhelper');
     $this->product_helper = Mage::helper('algoliasearch/entity_producthelper');
     $this->suggestion_helper = Mage::helper('algoliasearch/entity_suggestionhelper');
     $this->additionalsections_helper = Mage::helper('algoliasearch/entity_additionalsectionshelper');
     $this->config = Mage::helper('algoliasearch/config');
 }
コード例 #2
0
 public function __construct()
 {
     \AlgoliaSearch\Version::$custom_value = ' Symfony';
 }
コード例 #3
0
 Author: Algolia
 Author URI: http://www.algolia.com
 Copyright: Algolia
*/
defined('ABSPATH') or die('Not Allowed');
require_once plugin_dir_path(__FILE__) . '/lib/algolia/algoliasearch.php';
require_once plugin_dir_path(__FILE__) . '/lib/dom/simple_html_dom.php';
require_once plugin_dir_path(__FILE__) . '/core/Indexer.php';
require_once plugin_dir_path(__FILE__) . '/core/AlgoliaHelper.php';
require_once plugin_dir_path(__FILE__) . '/core/Registry.php';
require_once plugin_dir_path(__FILE__) . '/core/WordpressFetcher.php';
require_once plugin_dir_path(__FILE__) . '/core/TemplateHelper.php';
require_once plugin_dir_path(__FILE__) . '/core/QueryReplacer.php';
require_once plugin_dir_path(__FILE__) . '/AlgoliaPlugin.php';
require_once plugin_dir_path(__FILE__) . '/AlgoliaPluginAuto.php';
\AlgoliaSearch\Version::$custom_value = " WORDPRESS (0.0.9)";
new AlgoliaPlugin();
new AlgoliaPluginAuto();
/**
 * Variables Definition
 */
$batch_count = 100;
$attributesToSnippet = array("content");
/**
 * Defaults Variables
 */
$attributesToIndex = array("title", "excerpt", "content", "author", "type");
/** Woo Commerce Handling */
add_filter('prepare_algolia_record', function ($data) {
    if (class_exists('WC_Product_Factory') && $data->type == 'product') {
        $algolia_registry = \Algolia\Core\Registry::getInstance();