algoliasearch - Version 1.5.2

Version Notes

===== BREAKING CHANGE =====

A full reindex of the product indexer is needed

============================

- NEW: handle multiple currencies
- UPDATED: improve errors/warnings for reindexing
- FIX: handle both secure and unsecure base url for images
- FIX: ability to have only instant search
- FIX: method to get product and categories url

Download this release

Release Info

Developer Algolia Team
Extension algoliasearch
Version 1.5.2
Comparing to
See all releases


Code changes from version 1.5.1 to 1.5.2

app/code/community/Algolia/Algoliasearch/Helper/Data.php CHANGED
@@ -25,7 +25,7 @@ class Algolia_Algoliasearch_Helper_Data extends Mage_Core_Helper_Abstract
25
 
26
  public function __construct()
27
  {
28
- \AlgoliaSearch\Version::$custom_value = " Magento (1.5.1)";
29
 
30
  $this->algolia_helper = Mage::helper('algoliasearch/algoliahelper');
31
 
25
 
26
  public function __construct()
27
  {
28
+ \AlgoliaSearch\Version::$custom_value = " Magento (1.5.2)";
29
 
30
  $this->algolia_helper = Mage::helper('algoliasearch/algoliahelper');
31
 
app/code/community/Algolia/Algoliasearch/Helper/Entity/Categoryhelper.php CHANGED
@@ -145,7 +145,7 @@ class Algolia_Algoliasearch_Helper_Entity_Categoryhelper extends Algolia_Algolia
145
  'name' => $category->getName(),
146
  'path' => $path,
147
  'level' => $category->getLevel(),
148
- 'url' => Mage::getBaseUrl() . $category->getRequestPath(),
149
  '_tags' => array('category'),
150
  'popularity' => 1,
151
  'product_count' => $category->getProductCount()
145
  'name' => $category->getName(),
146
  'path' => $path,
147
  'level' => $category->getLevel(),
148
+ 'url' => $category->getUrl(),
149
  '_tags' => array('category'),
150
  'popularity' => 1,
151
  'product_count' => $category->getProductCount()
app/code/community/Algolia/Algoliasearch/Helper/Entity/Producthelper.php CHANGED
@@ -3,6 +3,7 @@
3
  class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algoliasearch_Helper_Entity_Helper
4
  {
5
  protected static $_productAttributes;
 
6
 
7
  protected static $_predefinedProductAttributes = array(
8
  'name',
@@ -132,24 +133,34 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
132
 
133
  $facets = $this->config->getFacets();
134
 
 
 
135
  foreach($facets as $facet)
136
  {
137
  if ($facet['attribute'] === 'price')
138
  {
139
- $facet['attribute'] = 'price.default';
140
-
141
- if ($this->config->isCustomerGroupsEnabled($storeId))
142
  {
143
- foreach ($groups = Mage::getModel('customer/group')->getCollection() as $group)
 
 
144
  {
145
- $group_id = (int)$group->getData('customer_group_id');
 
 
146
 
147
- $attributesForFaceting[] = 'price.group_' . $group_id;
 
148
  }
 
 
149
  }
150
  }
 
 
 
 
151
 
152
- $attributesForFaceting[] = $facet['attribute'];
153
  }
154
 
155
 
@@ -260,12 +271,29 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
260
  return array('price' => false, 'price_with_tax' => true);
261
  }
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  private function handlePrice(&$product, $sub_products, &$customData)
264
  {
265
  $fields = $this->getFields($product->getStore());
266
  $customer_groups_enabled = $this->config->isCustomerGroupsEnabled($product->getStoreId());
267
  $store = $product->getStore();
268
  $type = $this->config->getMappedProductType($product->getTypeId());
 
 
269
 
270
  $groups = array();
271
 
@@ -274,148 +302,161 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
274
 
275
  foreach ($fields as $field => $with_tax)
276
  {
277
- $price = (double) Mage::helper('tax')->getPrice($product, $product->getPrice(), $with_tax, null, null, null, $product->getStore(), null);
278
-
279
  $customData[$field] = array();
280
 
281
- $customData[$field]['default'] = $price;
282
- $customData[$field]['default_formated'] = $product->getStore()->formatPrice($price, false);
283
-
284
- $special_price = (double) Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), $with_tax, null, null, null, $product->getStore(), null);
285
-
286
- if ($customer_groups_enabled) // If fetch special price for groups
287
  {
288
- foreach ($groups as $group)
289
- {
290
- $group_id = (int)$group->getData('customer_group_id');
291
- $product->setCustomerGroupId($group_id);
292
 
293
- $discounted_price = $product->getPriceModel()->getFinalPrice(1, $product);
 
294
 
295
- if ($discounted_price !== false)
296
- {
297
- $customData[$field]['group_' . $group_id] = (double) Mage::helper('tax')->getPrice($product, $discounted_price, $with_tax, null, null, null, $product->getStore(), null);
298
- $customData[$field]['group_' . $group_id . '_formated'] = $store->formatPrice($customData[$field]['group_' . $group_id], false);
299
- }
300
- else
301
- {
302
- $customData[$field]['group_' . $group_id] = $customData[$field]['default'];
303
- $customData[$field]['group_' . $group_id . '_formated'] = $customData[$field]['default_formated'];
304
- }
305
- }
306
 
307
- $product->setCustomerGroupId(null);
308
- }
309
 
310
- $customData[$field]['special_from_date'] = strtotime($product->getSpecialFromDate());
311
- $customData[$field]['special_to_date'] = strtotime($product->getSpecialToDate());
312
 
313
- if ($customer_groups_enabled)
314
- {
315
- foreach ($groups as $group)
316
  {
317
- $group_id = (int)$group->getData('customer_group_id');
318
-
319
- if ($special_price && $special_price < $customData[$field]['group_' . $group_id])
320
  {
321
- $customData[$field]['group_' . $group_id] = $special_price;
322
- $customData[$field]['group_' . $group_id . '_formated'] = $product->getStore()->formatPrice($special_price, false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  }
324
- }
325
- }
326
- else
327
- {
328
- if ($special_price && $special_price < $customData[$field]['default'])
329
- {
330
- $customData[$field]['default_original_formated'] = $customData[$field]['default_formated'];
331
 
332
- $customData[$field]['default'] = $special_price;
333
- $customData[$field]['default_formated'] = $product->getStore()->formatPrice($special_price, false);
334
  }
335
- }
336
 
337
- if ($type == 'configurable' || $type == 'grouped' || $type == 'bundle')
338
- {
339
- $min = PHP_INT_MAX;
340
- $max = 0;
341
 
342
- if ($type == 'bundle')
343
  {
344
- $_priceModel = $product->getPriceModel();
 
 
345
 
346
- list($min, $max) = $_priceModel->getTotalPrices($product, null, $with_tax, true);
 
 
 
 
 
347
  }
348
-
349
- if ($type == 'grouped' || $type == 'configurable')
350
  {
351
- if (count($sub_products) > 0)
352
  {
353
- foreach ($sub_products as $sub_product)
354
- {
355
- $price = (double) Mage::helper('tax')->getPrice($product, $sub_product->getFinalPrice(), $with_tax, null, null, null, $product->getStore(), null);
356
 
357
- $min = min($min, $price);
358
- $max = max($max, $price);
359
- }
360
  }
361
- else
362
- $min = $max; // avoid to have PHP_INT_MAX in case of no subproducts (Corner case of visibility and stock options)
363
  }
364
 
365
-
366
- if ($min != $max)
367
  {
368
- $dashed_format = $product->getStore()->formatPrice($min, false) . ' - ' . $product->getStore()->formatPrice($max, false);
 
369
 
370
- if (isset($customData[$field]['default_original_formated']) === false || $min <= $customData[$field]['default'])
371
  {
 
372
 
373
- $customData[$field]['default_formated'] = $dashed_format;
 
374
 
375
- //// Do not keep special price that is already taken into account in min max
376
- unset($customData['price']['special_from_date']);
377
- unset($customData['price']['special_to_date']);
378
- unset($customData['price']['default_original_formated']);
 
 
 
379
 
380
- $customData[$field]['default'] = 0; // will be reset just after
 
 
 
 
 
381
  }
382
 
383
- if ($customer_groups_enabled)
 
384
  {
385
- foreach ($groups as $group)
 
 
 
 
 
386
  {
387
- $group_id = (int)$group->getData('customer_group_id');
388
 
389
- if ($min != $max && $min <= $customData[$field]['group_' . $group_id])
 
 
 
 
 
 
 
 
 
 
 
 
390
  {
391
- $customData[$field]['group_' . $group_id] = 0;
392
- $customData[$field]['group_' . $group_id . '_formated'] = $dashed_format;
 
 
 
 
 
393
  }
394
  }
395
  }
396
- }
397
 
398
 
399
- if ($customData[$field]['default'] == 0)
400
- {
401
- $customData[$field]['default'] = $min;
402
 
403
- if ($min === $max)
404
- $customData[$field]['default_formated'] = $product->getStore()->formatPrice($min, false);
405
- }
406
 
407
- if ($customer_groups_enabled)
408
- {
409
- foreach ($groups as $group)
410
  {
411
- $group_id = (int)$group->getData('customer_group_id');
412
-
413
- if ($customData[$field]['group_' . $group_id] == 0)
414
  {
415
- $customData[$field]['group_' . $group_id] = $min;
 
 
 
 
416
 
417
- if ($min === $max)
418
- $customData[$field]['group_' . $group_id . '_formated'] = $customData[$field]['default_formated'];
 
419
  }
420
  }
421
  }
@@ -446,7 +487,7 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
446
  $customData = array(
447
  'objectID' => $product->getId(),
448
  'name' => $product->getName(),
449
- 'url' => Mage::getBaseUrl() . $product->getRequestPath(),
450
  'visibility_search' => (int) (in_array($visibility, $visibleInSearch)),
451
  'visibility_catalog' => (int) (in_array($visibility, $visibleInCatalog))
452
  );
@@ -545,8 +586,6 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
545
  try
546
  {
547
  $customData['thumbnail_url'] = $thumb->toString();
548
- $customData['thumbnail_url'] = str_replace(array('https://', 'http://'
549
- ), '//', $customData['thumbnail_url']);
550
  }
551
  catch (\Exception $e)
552
  {
@@ -564,7 +603,6 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
564
  try
565
  {
566
  $customData['image_url'] = $image->toString();
567
- $customData['image_url'] = str_replace(array('https://', 'http://'), '//', $customData['image_url']);
568
  }
569
  catch (\Exception $e)
570
  {
@@ -581,7 +619,9 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
581
  $customData['media_gallery'] = array();
582
 
583
  foreach ($product->getMediaGalleryImages() as $image)
 
584
  $customData['media_gallery'][] = str_replace(array('https://', 'http://'), '//', $image->getUrl());
 
585
  }
586
  }
587
 
3
  class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algoliasearch_Helper_Entity_Helper
4
  {
5
  protected static $_productAttributes;
6
+ protected static $_currencies;
7
 
8
  protected static $_predefinedProductAttributes = array(
9
  'name',
133
 
134
  $facets = $this->config->getFacets();
135
 
136
+ $currencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
137
+
138
  foreach($facets as $facet)
139
  {
140
  if ($facet['attribute'] === 'price')
141
  {
142
+ foreach ($currencies as $currency_code)
 
 
143
  {
144
+ $facet['attribute'] = 'price.'.$currency_code.'.default';
145
+
146
+ if ($this->config->isCustomerGroupsEnabled($storeId))
147
  {
148
+ foreach ($groups = Mage::getModel('customer/group')->getCollection() as $group)
149
+ {
150
+ $group_id = (int)$group->getData('customer_group_id');
151
 
152
+ $attributesForFaceting[] = 'price.'.$currency_code.'.group_' . $group_id;
153
+ }
154
  }
155
+
156
+ $attributesForFaceting[] = $facet['attribute'];
157
  }
158
  }
159
+ else
160
+ {
161
+ $attributesForFaceting[] = $facet['attribute'];
162
+ }
163
 
 
164
  }
165
 
166
 
271
  return array('price' => false, 'price_with_tax' => true);
272
  }
273
 
274
+ private function formatPrice($price, $includeContainer, $currency_code)
275
+ {
276
+ if (!isset(static::$_currencies[$currency_code]))
277
+ {
278
+ static::$_currencies[$currency_code] = Mage::getModel('directory/currency')->load($currency_code);
279
+ }
280
+
281
+ $currency = static::$_currencies[$currency_code];
282
+
283
+ if ($currency) {
284
+ return $currency->format($price, array(), $includeContainer);
285
+ }
286
+ return $price;
287
+ }
288
+
289
  private function handlePrice(&$product, $sub_products, &$customData)
290
  {
291
  $fields = $this->getFields($product->getStore());
292
  $customer_groups_enabled = $this->config->isCustomerGroupsEnabled($product->getStoreId());
293
  $store = $product->getStore();
294
  $type = $this->config->getMappedProductType($product->getTypeId());
295
+ $currencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
296
+ $baseCurrencyCode = $store->getBaseCurrencyCode();
297
 
298
  $groups = array();
299
 
302
 
303
  foreach ($fields as $field => $with_tax)
304
  {
 
 
305
  $customData[$field] = array();
306
 
307
+ foreach ($currencies as $currency_code)
 
 
 
 
 
308
  {
309
+ $customData[$field][$currency_code] = array();
 
 
 
310
 
311
+ $price = (double) Mage::helper('tax')->getPrice($product, $product->getPrice(), $with_tax, null, null, null, $product->getStore(), null);
312
+ $price = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $currency_code);
313
 
 
 
 
 
 
 
 
 
 
 
 
314
 
315
+ $customData[$field][$currency_code]['default'] = $price;
316
+ $customData[$field][$currency_code]['default_formated'] = $this->formatPrice($price, false, $currency_code);
317
 
318
+ $special_price = (double) Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), $with_tax, null, null, null, $product->getStore(), null);
319
+ $special_price = Mage::helper('directory')->currencyConvert($special_price, $baseCurrencyCode, $currency_code);
320
 
321
+ if ($customer_groups_enabled) // If fetch special price for groups
 
 
322
  {
323
+ foreach ($groups as $group)
 
 
324
  {
325
+ $group_id = (int)$group->getData('customer_group_id');
326
+ $product->setCustomerGroupId($group_id);
327
+
328
+ $discounted_price = $product->getPriceModel()->getFinalPrice(1, $product);
329
+ $discounted_price = Mage::helper('directory')->currencyConvert($discounted_price, $baseCurrencyCode, $currency_code);
330
+
331
+ if ($discounted_price !== false)
332
+ {
333
+ $customData[$field][$currency_code]['group_' . $group_id] = (double) Mage::helper('tax')->getPrice($product, $discounted_price, $with_tax, null, null, null, $product->getStore(), null);
334
+ $customData[$field][$currency_code]['group_' . $group_id] = Mage::helper('directory')->currencyConvert($customData[$field][$currency_code]['group_' . $group_id], $baseCurrencyCode, $currency_code);
335
+ $customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $store->formatPrice($customData[$field][$currency_code]['group_' . $group_id], false, $currency_code);
336
+ }
337
+ else
338
+ {
339
+ $customData[$field][$currency_code]['group_' . $group_id] = $customData[$field][$currency_code]['default'];
340
+ $customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $customData[$field][$currency_code]['default_formated'];
341
+ }
342
  }
 
 
 
 
 
 
 
343
 
344
+ $product->setCustomerGroupId(null);
 
345
  }
 
346
 
347
+ $customData[$field][$currency_code]['special_from_date'] = strtotime($product->getSpecialFromDate());
348
+ $customData[$field][$currency_code]['special_to_date'] = strtotime($product->getSpecialToDate());
 
 
349
 
350
+ if ($customer_groups_enabled)
351
  {
352
+ foreach ($groups as $group)
353
+ {
354
+ $group_id = (int)$group->getData('customer_group_id');
355
 
356
+ if ($special_price && $special_price < $customData[$field][$currency_code]['group_' . $group_id])
357
+ {
358
+ $customData[$field][$currency_code]['group_' . $group_id] = $special_price;
359
+ $customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $this->formatPrice($special_price, false, $currency_code);
360
+ }
361
+ }
362
  }
363
+ else
 
364
  {
365
+ if ($special_price && $special_price < $customData[$field][$currency_code]['default'])
366
  {
367
+ $customData[$field][$currency_code]['default_original_formated'] = $customData[$field][$currency_code]['default_formated'];
 
 
368
 
369
+ $customData[$field][$currency_code]['default'] = $special_price;
370
+ $customData[$field][$currency_code]['default_formated'] = $this->formatPrice($special_price, false, $currency_code);
 
371
  }
 
 
372
  }
373
 
374
+ if ($type == 'configurable' || $type == 'grouped' || $type == 'bundle')
 
375
  {
376
+ $min = PHP_INT_MAX;
377
+ $max = 0;
378
 
379
+ if ($type == 'bundle')
380
  {
381
+ $_priceModel = $product->getPriceModel();
382
 
383
+ list($min, $max) = $_priceModel->getTotalPrices($product, null, $with_tax, true);
384
+ }
385
 
386
+ if ($type == 'grouped' || $type == 'configurable')
387
+ {
388
+ if (count($sub_products) > 0)
389
+ {
390
+ foreach ($sub_products as $sub_product)
391
+ {
392
+ $price = (double) Mage::helper('tax')->getPrice($product, $sub_product->getFinalPrice(), $with_tax, null, null, null, $product->getStore(), null);
393
 
394
+ $min = min($min, $price);
395
+ $max = max($max, $price);
396
+ }
397
+ }
398
+ else
399
+ $min = $max; // avoid to have PHP_INT_MAX in case of no subproducts (Corner case of visibility and stock options)
400
  }
401
 
402
+
403
+ if ($min != $max)
404
  {
405
+ $min = Mage::helper('directory')->currencyConvert($min, $baseCurrencyCode, $currency_code);
406
+ $max = Mage::helper('directory')->currencyConvert($max, $baseCurrencyCode, $currency_code);
407
+
408
+ $dashed_format = $this->formatPrice($min, false, $currency_code) . ' - ' . $this->formatPrice($max, false, $currency_code);
409
+
410
+ if (isset($customData[$field][$currency_code]['default_original_formated']) === false || $min <= $customData[$field][$currency_code]['default'])
411
  {
 
412
 
413
+ $customData[$field][$currency_code]['default_formated'] = $dashed_format;
414
+
415
+ //// Do not keep special price that is already taken into account in min max
416
+ unset($customData['price']['special_from_date']);
417
+ unset($customData['price']['special_to_date']);
418
+ unset($customData['price']['default_original_formated']);
419
+
420
+ $customData[$field][$currency_code]['default'] = 0; // will be reset just after
421
+ }
422
+
423
+ if ($customer_groups_enabled)
424
+ {
425
+ foreach ($groups as $group)
426
  {
427
+ $group_id = (int)$group->getData('customer_group_id');
428
+
429
+ if ($min != $max && $min <= $customData[$field][$currency_code]['group_' . $group_id])
430
+ {
431
+ $customData[$field][$currency_code]['group_' . $group_id] = 0;
432
+ $customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $dashed_format;
433
+ }
434
  }
435
  }
436
  }
 
437
 
438
 
439
+ if ($customData[$field][$currency_code]['default'] == 0)
440
+ {
441
+ $customData[$field][$currency_code]['default'] = $min;
442
 
443
+ if ($min === $max)
444
+ $customData[$field][$currency_code]['default_formated'] = $this->formatPrice($min, false, $currency_code);
445
+ }
446
 
447
+ if ($customer_groups_enabled)
 
 
448
  {
449
+ foreach ($groups as $group)
 
 
450
  {
451
+ $group_id = (int)$group->getData('customer_group_id');
452
+
453
+ if ($customData[$field][$currency_code]['group_' . $group_id] == 0)
454
+ {
455
+ $customData[$field][$currency_code]['group_' . $group_id] = $min;
456
 
457
+ if ($min === $max)
458
+ $customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $customData[$field][$currency_code]['default_formated'];
459
+ }
460
  }
461
  }
462
  }
487
  $customData = array(
488
  'objectID' => $product->getId(),
489
  'name' => $product->getName(),
490
+ 'url' => $product->getProductUrl(),
491
  'visibility_search' => (int) (in_array($visibility, $visibleInSearch)),
492
  'visibility_catalog' => (int) (in_array($visibility, $visibleInCatalog))
493
  );
586
  try
587
  {
588
  $customData['thumbnail_url'] = $thumb->toString();
 
 
589
  }
590
  catch (\Exception $e)
591
  {
603
  try
604
  {
605
  $customData['image_url'] = $image->toString();
 
606
  }
607
  catch (\Exception $e)
608
  {
619
  $customData['media_gallery'] = array();
620
 
621
  foreach ($product->getMediaGalleryImages() as $image)
622
+ {
623
  $customData['media_gallery'][] = str_replace(array('https://', 'http://'), '//', $image->getUrl());
624
+ }
625
  }
626
  }
627
 
app/code/community/Algolia/Algoliasearch/Helper/Image.php CHANGED
@@ -15,7 +15,7 @@ class Algolia_Algoliasearch_Helper_Image extends Mage_Catalog_Helper_Image
15
  $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
16
 
17
  if ($model->isCached())
18
- return $model->getUrl();
19
 
20
  if ($this->_scheduleRotate)
21
  $model->rotate($this->getAngle());
@@ -26,6 +26,15 @@ class Algolia_Algoliasearch_Helper_Image extends Mage_Catalog_Helper_Image
26
  if ($this->getWatermark())
27
  $model->setWatermark($this->getWatermark());
28
 
29
- return $model->saveFile()->getUrl();
 
 
 
 
 
 
 
 
 
30
  }
31
  }
15
  $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
16
 
17
  if ($model->isCached())
18
+ return $this->getUrl($model);
19
 
20
  if ($this->_scheduleRotate)
21
  $model->rotate($this->getAngle());
26
  if ($this->getWatermark())
27
  $model->setWatermark($this->getWatermark());
28
 
29
+ return $this->getUrl($model->saveFile());
30
+ }
31
+
32
+ public function getUrl($model)
33
+ {
34
+ $baseDir = Mage::getBaseDir('media');
35
+ $path = str_replace($baseDir . DS, "", $model->getNewFile());
36
+ $url = str_replace(DS, '/', $path);
37
+
38
+ return $url;
39
  }
40
  }
app/code/community/Algolia/Algoliasearch/Model/Indexer/Algolia.php CHANGED
@@ -260,35 +260,44 @@ class Algolia_Algoliasearch_Model_Indexer_Algolia extends Mage_Index_Model_Index
260
  // Mass action
261
  else if ( ! empty($data['catalogsearch_product_ids'])) {
262
  $productIds = $data['catalogsearch_product_ids'];
263
- if ( ! empty($data['catalogsearch_website_ids'])) {
264
- $websiteIds = $data['catalogsearch_website_ids'];
265
- $actionType = $data['catalogsearch_action_type'];
266
- foreach ($websiteIds as $websiteId) {
267
- foreach (Mage::app()->getWebsite($websiteId)->getStoreIds() as $storeId) {
268
- if ($actionType == 'remove') {
269
- $this->engine
270
- ->removeProducts($storeId, $productIds);
271
- } else if ($actionType == 'add') {
272
- $this->engine
273
- ->rebuildProductIndex($storeId, $productIds);
 
 
 
 
 
 
 
274
  }
275
  }
276
  }
277
- }
278
- else if (isset($data['catalogsearch_status'])) {
279
- $status = $data['catalogsearch_status'];
280
- if ($status == Mage_Catalog_Model_Product_Status::STATUS_ENABLED) {
 
 
 
 
 
 
 
 
 
281
  $this->engine
282
  ->rebuildProductIndex(null, $productIds);
283
- } else {
284
- $this->engine
285
- ->removeProducts(null, $productIds);
286
  }
287
  }
288
- else if (isset($data['catalogsearch_force_reindex'])) {
289
- $this->engine
290
- ->rebuildProductIndex(null, $productIds);
291
- }
292
  }
293
 
294
  if ( ! empty($data['catalogsearch_update_category_id'])) {
@@ -310,21 +319,28 @@ class Algolia_Algoliasearch_Model_Indexer_Algolia extends Mage_Index_Model_Index
310
  /*
311
  * Reindex products.
312
  */
313
- if ( ! empty($data['catalogsearch_update_product_id'])) {
 
314
  $updateProductIds = $data['catalogsearch_update_product_id'];
315
  $updateProductIds = is_array($updateProductIds) ? $updateProductIds : array($updateProductIds);
316
  $productIds = $updateProductIds;
317
- foreach ($updateProductIds as $updateProductId) {
318
- if ( ! $this->_isProductComposite($updateProductId)) {
 
 
 
319
  $parentIds = $this->_getResource()->getRelationsByChild($updateProductId);
320
- if ( ! empty($parentIds)) {
 
 
321
  $productIds = array_merge($productIds, $parentIds);
322
  }
323
  }
324
  }
325
 
326
- $this->engine
327
- ->rebuildProductIndex(null, $productIds);
 
328
  }
329
  }
330
 
260
  // Mass action
261
  else if ( ! empty($data['catalogsearch_product_ids'])) {
262
  $productIds = $data['catalogsearch_product_ids'];
263
+
264
+ if (!empty($productIds))
265
+ {
266
+ if ( ! empty($data['catalogsearch_website_ids']))
267
+ {
268
+ $websiteIds = $data['catalogsearch_website_ids'];
269
+ $actionType = $data['catalogsearch_action_type'];
270
+ foreach ($websiteIds as $websiteId)
271
+ {
272
+ foreach (Mage::app()->getWebsite($websiteId)->getStoreIds() as $storeId) {
273
+ if ($actionType == 'remove')
274
+ {
275
+ $this->engine->removeProducts($storeId, $productIds);
276
+ }
277
+ else if ($actionType == 'add')
278
+ {
279
+ $this->engine->rebuildProductIndex($storeId, $productIds);
280
+ }
281
  }
282
  }
283
  }
284
+ else if (isset($data['catalogsearch_status']))
285
+ {
286
+ $status = $data['catalogsearch_status'];
287
+ if ($status == Mage_Catalog_Model_Product_Status::STATUS_ENABLED) {
288
+ $this->engine->rebuildProductIndex(null, $productIds);
289
+ }
290
+ else
291
+ {
292
+ $this->engine->removeProducts(null, $productIds);
293
+ }
294
+ }
295
+ else if (isset($data['catalogsearch_force_reindex']))
296
+ {
297
  $this->engine
298
  ->rebuildProductIndex(null, $productIds);
 
 
 
299
  }
300
  }
 
 
 
 
301
  }
302
 
303
  if ( ! empty($data['catalogsearch_update_category_id'])) {
319
  /*
320
  * Reindex products.
321
  */
322
+ if ( ! empty($data['catalogsearch_update_product_id']))
323
+ {
324
  $updateProductIds = $data['catalogsearch_update_product_id'];
325
  $updateProductIds = is_array($updateProductIds) ? $updateProductIds : array($updateProductIds);
326
  $productIds = $updateProductIds;
327
+
328
+ foreach ($updateProductIds as $updateProductId)
329
+ {
330
+ if (! $this->_isProductComposite($updateProductId))
331
+ {
332
  $parentIds = $this->_getResource()->getRelationsByChild($updateProductId);
333
+
334
+ if (! empty($parentIds))
335
+ {
336
  $productIds = array_merge($productIds, $parentIds);
337
  }
338
  }
339
  }
340
 
341
+ if (!empty($productIds)) {
342
+ $this->engine->rebuildProductIndex(null, $productIds);
343
+ }
344
  }
345
  }
346
 
app/code/community/Algolia/Algoliasearch/Model/Resource/Engine.php CHANGED
@@ -105,6 +105,10 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
105
  {
106
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
107
  {
 
 
 
 
108
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
109
  continue;
110
  }
@@ -119,6 +123,10 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
119
  {
120
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
121
  {
 
 
 
 
122
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
123
  continue;
124
  }
@@ -133,6 +141,10 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
133
  {
134
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
135
  {
 
 
 
 
136
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
137
  continue;
138
  }
@@ -160,6 +172,10 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
160
  {
161
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
162
  {
 
 
 
 
163
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
164
  continue;
165
  }
@@ -181,6 +197,10 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
181
  {
182
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
183
  {
 
 
 
 
184
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
185
  continue;
186
  }
@@ -261,7 +281,7 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
261
  public function prepareEntityIndex($index, $separator = ' ')
262
  {
263
  if ($this->config->isEnabledBackEnd(Mage::app()->getStore()->getId()) === false)
264
- return parent::rebuildIndex($index, $separator);
265
 
266
  foreach ($index as $key => $value) {
267
  if (is_array($value) && ! empty($value)) {
105
  {
106
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
107
  {
108
+ if (php_sapi_name() === 'cli')
109
+ echo '[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId())."\n";
110
+
111
+ Mage::getSingleton('adminhtml/session')->addWarning('[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
112
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
113
  continue;
114
  }
123
  {
124
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
125
  {
126
+ if (php_sapi_name() === 'cli')
127
+ echo '[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId())."\n";
128
+
129
+ Mage::getSingleton('adminhtml/session')->addWarning('[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
130
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
131
  continue;
132
  }
141
  {
142
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
143
  {
144
+ if (php_sapi_name() === 'cli')
145
+ echo '[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId())."\n";
146
+
147
+ Mage::getSingleton('adminhtml/session')->addWarning('[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
148
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
149
  continue;
150
  }
172
  {
173
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
174
  {
175
+ if (php_sapi_name() === 'cli')
176
+ echo '[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId())."\n";
177
+
178
+ Mage::getSingleton('adminhtml/session')->addWarning('[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
179
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
180
  continue;
181
  }
197
  {
198
  if ($this->config->isEnabledBackEnd($store->getId()) === false)
199
  {
200
+ if (php_sapi_name() === 'cli')
201
+ echo '[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId())."\n";
202
+
203
+ Mage::getSingleton('adminhtml/session')->addWarning('[ALGOLIA] INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
204
  $this->logger->log('INDEXING IS DISABLED FOR '. $this->logger->getStoreName($store->getId()));
205
  continue;
206
  }
281
  public function prepareEntityIndex($index, $separator = ' ')
282
  {
283
  if ($this->config->isEnabledBackEnd(Mage::app()->getStore()->getId()) === false)
284
+ return parent::prepareEntityIndex($index, $separator);
285
 
286
  foreach ($index as $key => $value) {
287
  if (is_array($value) && ! empty($value)) {
app/code/community/Algolia/Algoliasearch/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Algolia_Algoliasearch>
5
- <version>1.5.1</version>
6
  </Algolia_Algoliasearch>
7
  </modules>
8
  <frontend>
2
  <config>
3
  <modules>
4
  <Algolia_Algoliasearch>
5
+ <version>1.5.2</version>
6
  </Algolia_Algoliasearch>
7
  </modules>
8
  <frontend>
app/code/community/Algolia/Algoliasearch/etc/system.xml CHANGED
@@ -4,7 +4,7 @@
4
  <algoliasearch translate="label" module="algoliasearch">
5
  <label>
6
  <![CDATA[
7
- Algolia Search 1.5.1
8
  <style>
9
  .algoliasearch-admin-menu span {
10
  padding-left: 38px !important;
@@ -66,7 +66,7 @@
66
  <show_in_store>1</show_in_store>
67
  <comment>
68
  <![CDATA[
69
- If set to No, Algolia extension will be simply disabled.
70
  ]]>
71
  </comment>
72
  </enable_backend>
4
  <algoliasearch translate="label" module="algoliasearch">
5
  <label>
6
  <![CDATA[
7
+ Algolia Search 1.5.2
8
  <style>
9
  .algoliasearch-admin-menu span {
10
  padding-left: 38px !important;
66
  <show_in_store>1</show_in_store>
67
  <comment>
68
  <![CDATA[
69
+ If set to No, Algolia extension will simply be disabled.
70
  ]]>
71
  </comment>
72
  </enable_backend>
app/design/frontend/base/default/layout/algoliasearch.xml CHANGED
@@ -21,7 +21,6 @@
21
  <reference name="content">
22
  <block type="core/template" before="content" template="algoliasearch/beforecontent.phtml"/>
23
  </reference>
24
-
25
  </algolia_search_handle>
26
  <algolia_search_handle_with_topsearch>
27
  <reference name="top.search">
21
  <reference name="content">
22
  <block type="core/template" before="content" template="algoliasearch/beforecontent.phtml"/>
23
  </reference>
 
24
  </algolia_search_handle>
25
  <algolia_search_handle_with_topsearch>
26
  <reference name="top.search">
app/design/frontend/base/default/template/algoliasearch/beforetopsearch.phtml CHANGED
@@ -10,8 +10,9 @@ $base_url = Mage::getBaseUrl();
10
  $isSearchPage = false;
11
  $isCategoryPage = false;
12
 
 
13
  $group_id = Mage::getSingleton('customer/session')->getCustomerGroupId();
14
- $price_key = $config->isCustomerGroupsEnabled(Mage::app()->getStore()->getStoreId()) ? '.group_'.$group_id : '.default';
15
 
16
  $allDepartments = "All departments";
17
 
@@ -114,6 +115,7 @@ if ($config->isInstantEnabled() && $isSearchPage) {
114
  removeBranding: <?php echo $config->isRemoveBranding() ? "true" : "false"; ?>,
115
  priceKey: '<?php echo $price_key; ?>',
116
  currencySymbol: '<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>',
 
117
  autofocus: true,
118
  request: {
119
  query:<?php echo json_encode(array("value" => html_entity_decode($query))); ?>.value,
@@ -130,7 +132,7 @@ if ($config->isInstantEnabled() && $isSearchPage) {
130
  if (Array.isArray(hit.categories))
131
  hit.categories = hit.categories.join(', ');
132
 
133
- if (Array.isArray(hit.categories_without_path)) {
134
  hit.categories_without_path = $.map(hit._highlightResult.categories_without_path, function (category) {
135
  return category.value;
136
  });
@@ -171,8 +173,9 @@ if ($config->isInstantEnabled() && $isSearchPage) {
171
  if (Array.isArray(hit.price))
172
  hit.price = hit.price[0];
173
 
174
- if (price_key !== '.default' && hit['price'][price_key.substr(1) + '_formated'] !== hit['price']['default_formated']) {
175
- hit['price'][price_key.substr(1) + '_original_formated'] = hit['price']['default_formated'];
 
176
  }
177
 
178
  return hit;
@@ -496,6 +499,16 @@ if ($config->isInstantEnabled() && $isSearchPage) {
496
  }
497
  }
498
 
 
 
 
 
 
 
 
 
 
 
499
  window.handleInputCrossInstant = function (input) {
500
  if (input.val().length > 0) {
501
  input.closest('#instant-search-box').find('.clear-query-instant').show();
@@ -552,4 +565,4 @@ if ($config->isInstantEnabled() && $isSearchPage) {
552
  <script>
553
  algoliaConfig.autofocus = false;
554
  </script>
555
- <![endif]-->
10
  $isSearchPage = false;
11
  $isCategoryPage = false;
12
 
13
+ $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
14
  $group_id = Mage::getSingleton('customer/session')->getCustomerGroupId();
15
+ $price_key = $config->isCustomerGroupsEnabled(Mage::app()->getStore()->getStoreId()) ? '.'.$currency_code.'.group_'.$group_id : '.'.$currency_code.'.default';
16
 
17
  $allDepartments = "All departments";
18
 
115
  removeBranding: <?php echo $config->isRemoveBranding() ? "true" : "false"; ?>,
116
  priceKey: '<?php echo $price_key; ?>',
117
  currencySymbol: '<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>',
118
+ currency_code: '<?php echo $currency_code; ?>',
119
  autofocus: true,
120
  request: {
121
  query:<?php echo json_encode(array("value" => html_entity_decode($query))); ?>.value,
132
  if (Array.isArray(hit.categories))
133
  hit.categories = hit.categories.join(', ');
134
 
135
+ if (hit._highlightResult.categories_without_path && Array.isArray(hit.categories_without_path)) {
136
  hit.categories_without_path = $.map(hit._highlightResult.categories_without_path, function (category) {
137
  return category.value;
138
  });
173
  if (Array.isArray(hit.price))
174
  hit.price = hit.price[0];
175
 
176
+ if (price_key !== '.' + algoliaConfig.currency_code + '.default' &&
177
+ hit['price'][algoliaConfig.currency_code][price_key.substr(1) + '_formated'] !== hit['price'][algoliaConfig.currency_code]['default_formated']) {
178
+ hit['price'][algoliaConfig.currency_code][price_key.substr(1) + '_original_formated'] = hit['price'][algoliaConfig.currency_code]['default_formated'];
179
  }
180
 
181
  return hit;
499
  }
500
  }
501
 
502
+ window.focusInstantSearchBar = function (search, instant_search_bar) {
503
+ if ($(window).width() > 992) {
504
+ instant_search_bar.focusWithoutScrolling();
505
+ if (algoliaConfig.autofocus === false) {
506
+ instant_search_bar.focus().val('');
507
+ }
508
+ }
509
+ instant_search_bar.val(search.helper.state.query);
510
+ };
511
+
512
  window.handleInputCrossInstant = function (input) {
513
  if (input.val().length > 0) {
514
  input.closest('#instant-search-box').find('.clear-query-instant').show();
565
  <script>
566
  algoliaConfig.autofocus = false;
567
  </script>
568
+ <![endif]-->
app/design/frontend/base/default/template/algoliasearch/topsearch.phtml CHANGED
@@ -9,7 +9,11 @@
9
  <?php
10
  $config = Mage::helper('algoliasearch/config');
11
  $catalogSearchHelper = $this->helper('catalogsearch');
12
- $price_key = $config->isCustomerGroupsEnabled(Mage::app()->getStore()->getStoreId()) ? '.group_'.$group_id : '.default';
 
 
 
 
13
 
14
  $title = '';
15
  $description = '';
@@ -75,7 +79,7 @@ $placeholder = $this->__('Search for products, categories, ...');
75
  <script type="text/template" id="autocomplete_products_template">
76
  <a class="algoliasearch-autocomplete-hit" href="{{url}}">
77
  {{#thumbnail_url}}
78
- <div class="thumb"><img src="{{thumbnail_url}}" /></div>
79
  {{/thumbnail_url}}
80
 
81
  <div class="info">
@@ -115,7 +119,7 @@ $placeholder = $this->__('Search for products, categories, ...');
115
  <a class="algoliasearch-autocomplete-hit" href="{{url}}">
116
  {{#image_url}}
117
  <div class="thumb">
118
- <img src="{{image_url}}" />
119
  </div>
120
  {{/image_url}}
121
 
@@ -204,7 +208,7 @@ $placeholder = $this->__('Search for products, categories, ...');
204
  {{#findAutocomplete}}
205
  <div id="algolia-autocomplete-container"></div>
206
  {{/findAutocomplete}}
207
- <div id="algolia_instant_selector"<?php echo count($config->getFacets()) > 0 ? ' class="with-facets"' : '' ?>>
208
 
209
  <?php if ($title || $imgHtml || $description || $content): ?>
210
  <div class="row">
@@ -289,7 +293,7 @@ $placeholder = $this->__('Search for products, categories, ...');
289
  <a href="{{url}}" class="result">
290
  <div class="result-content">
291
  <div class="result-thumbnail">
292
- {{#image_url}}<img src="{{{ image_url }}}" />{{/image_url}}
293
  {{^image_url}}<span class="no-image"></span>{{/image_url}}
294
  </div>
295
  <div class="result-sub-content">
@@ -424,7 +428,18 @@ $placeholder = $this->__('Search for products, categories, ...');
424
  var wrapperTemplate = algoliaBundle.Hogan.compile($('#instant_wrapper_template').html());
425
 
426
  var findAutocomplete = algoliaConfig.autocomplete.enabled && $(algoliaConfig.instant.selector).find('#algolia-autocomplete-container').length > 0;
427
- $(algoliaConfig.instant.selector).html(wrapperTemplate.render({second_bar: algoliaConfig.autocomplete.enabled, findAutocomplete: findAutocomplete})).show();
 
 
 
 
 
 
 
 
 
 
 
428
 
429
  /** Initialise instant search **/
430
  var search = algoliaBundle.instantsearch({
@@ -455,6 +470,18 @@ $placeholder = $this->__('Search for products, categories, ...');
455
  else {
456
  data.helper.addNumericRefinement('visibility_search', '=', 1);
457
  }
 
 
 
 
 
 
 
 
 
 
 
 
458
  }
459
  });
460
 
@@ -587,14 +614,6 @@ $placeholder = $this->__('Search for products, categories, ...');
587
  })
588
  );
589
 
590
- search.addWidget({
591
- render: function (data) {
592
- if (data.results.hits.length === 0) {
593
-
594
- }
595
- }
596
- });
597
-
598
  var customAttributeFacet = {
599
  categories: function(facet, templates) {
600
  var hierarchical_levels = [];
@@ -653,6 +672,7 @@ $placeholder = $this->__('Search for products, categories, ...');
653
  container: '#instant-search-pagination-container',
654
  cssClass: 'algolia-pagination',
655
  showFirstLast: false,
 
656
  labels: {
657
  previous: '<?php echo $this->__('Previous page'); ?>',
658
  next: '<?php echo $this->__('Next page'); ?>'
@@ -661,32 +681,40 @@ $placeholder = $this->__('Search for products, categories, ...');
661
  })
662
  );
663
 
664
- search.start();
 
665
 
666
- handleInputCrossInstant($(instant_selector));
667
 
668
- var instant_search_bar = $(instant_selector);
669
- if (instant_search_bar.is(":focus") === false)
670
- {
671
- if ($(window).width() > 992) {
672
- if (algoliaConfig.autofocus === false) {
673
- instant_search_bar.focus().val('');
674
- }
675
  }
676
- instant_search_bar.val(search.helper.state.query);
 
 
 
 
 
 
 
677
  }
678
 
679
- $('#search_mini_form').addClass('search-page');
 
 
 
 
 
680
 
681
- $(document).on('click', '.ais-hierarchical-menu--link, .ais-refinement-list--checkbox', function () {
682
- if ($(window).width() > 992) {
683
- instant_search_bar.focusWithoutScrolling();
684
- if (algoliaConfig.autofocus === false) {
685
- instant_search_bar.val('');
686
- }
687
- }
688
- instant_search_bar.val(search.helper.state.query);
689
- });
690
  }
691
 
692
  /*****************
@@ -756,4 +784,4 @@ $placeholder = $this->__('Search for products, categories, ...');
756
  });
757
 
758
  //]]>
759
- </script>
9
  <?php
10
  $config = Mage::helper('algoliasearch/config');
11
  $catalogSearchHelper = $this->helper('catalogsearch');
12
+ $group_id = Mage::getSingleton('customer/session')->getCustomer()->getGroupId();
13
+ $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
14
+ $price_key = $config->isCustomerGroupsEnabled(Mage::app()->getStore()->getStoreId()) ? '.'.$currency_code.'.group_'.$group_id : '.'.$currency_code.'.default';
15
+
16
+ $image_base_url = Mage::getBaseUrl('media');
17
 
18
  $title = '';
19
  $description = '';
79
  <script type="text/template" id="autocomplete_products_template">
80
  <a class="algoliasearch-autocomplete-hit" href="{{url}}">
81
  {{#thumbnail_url}}
82
+ <div class="thumb"><img src="<?php echo $image_base_url; ?>{{thumbnail_url}}" /></div>
83
  {{/thumbnail_url}}
84
 
85
  <div class="info">
119
  <a class="algoliasearch-autocomplete-hit" href="{{url}}">
120
  {{#image_url}}
121
  <div class="thumb">
122
+ <img src="<?php echo $image_base_url; ?>{{image_url}}" />
123
  </div>
124
  {{/image_url}}
125
 
208
  {{#findAutocomplete}}
209
  <div id="algolia-autocomplete-container"></div>
210
  {{/findAutocomplete}}
211
+ <div id="algolia_instant_selector" class="<?php echo count($config->getFacets()) > 0 ? ' with-facets' : '' ?>">
212
 
213
  <?php if ($title || $imgHtml || $description || $content): ?>
214
  <div class="row">
293
  <a href="{{url}}" class="result">
294
  <div class="result-content">
295
  <div class="result-thumbnail">
296
+ {{#image_url}}<img src="<?php echo $image_base_url; ?>{{{ image_url }}}" />{{/image_url}}
297
  {{^image_url}}<span class="no-image"></span>{{/image_url}}
298
  </div>
299
  <div class="result-sub-content">
428
  var wrapperTemplate = algoliaBundle.Hogan.compile($('#instant_wrapper_template').html());
429
 
430
  var findAutocomplete = algoliaConfig.autocomplete.enabled && $(algoliaConfig.instant.selector).find('#algolia-autocomplete-container').length > 0;
431
+
432
+ if (findAutocomplete) {
433
+ $(algoliaConfig.instant.selector).find('#algolia-autocomplete-container').remove();
434
+ }
435
+
436
+ var div = document.createElement('div');
437
+ $(div).addClass('algolia-instant-results-wrapper');
438
+ $(algoliaConfig.instant.selector).addClass('algolia-instant-replaced-content');
439
+ $(algoliaConfig.instant.selector).wrap(div);
440
+ $('.algolia-instant-results-wrapper').append('<div class="algolia-instant-selector-results"></div>');
441
+
442
+ $('.algolia-instant-selector-results').html(wrapperTemplate.render({second_bar: algoliaConfig.autocomplete.enabled, findAutocomplete: findAutocomplete})).show();
443
 
444
  /** Initialise instant search **/
445
  var search = algoliaBundle.instantsearch({
470
  else {
471
  data.helper.addNumericRefinement('visibility_search', '=', 1);
472
  }
473
+ },
474
+ render: function (data) {
475
+ if (! algoliaConfig.isSearchPage) {
476
+ if (data.results.query.length === 0) {
477
+ $('.algolia-instant-replaced-content').show();
478
+ $('.algolia-instant-selector-results').hide();
479
+ }
480
+ else {
481
+ $('.algolia-instant-replaced-content').hide();
482
+ $('.algolia-instant-selector-results').show();
483
+ }
484
+ }
485
  }
486
  });
487
 
614
  })
615
  );
616
 
 
 
 
 
 
 
 
 
617
  var customAttributeFacet = {
618
  categories: function(facet, templates) {
619
  var hierarchical_levels = [];
672
  container: '#instant-search-pagination-container',
673
  cssClass: 'algolia-pagination',
674
  showFirstLast: false,
675
+ maxPages: 1000,
676
  labels: {
677
  previous: '<?php echo $this->__('Previous page'); ?>',
678
  next: '<?php echo $this->__('Next page'); ?>'
681
  })
682
  );
683
 
684
+ function startInstantSearch() {
685
+ search.start();
686
 
687
+ handleInputCrossInstant($(instant_selector));
688
 
689
+ var instant_search_bar = $(instant_selector);
690
+ if (instant_search_bar.is(":focus") === false) {
691
+ focusInstantSearchBar(search, instant_search_bar);
 
 
 
 
692
  }
693
+
694
+ if (algoliaConfig.autocomplete.enabled) {
695
+ $('#search_mini_form').addClass('search-page');
696
+ }
697
+
698
+ $(document).on('click', '.ais-hierarchical-menu--link, .ais-refinement-list--checkbox', function () {
699
+ focusInstantSearchBar(search, instant_search_bar);
700
+ });
701
  }
702
 
703
+ if (algoliaConfig.isSearchPage) {
704
+ startInstantSearch();
705
+ }
706
+ else {
707
+ (function () {
708
+ var isStarted = false;
709
 
710
+ $(instant_selector).one('focus', (function () {
711
+ if (!isStarted) {
712
+ startInstantSearch();
713
+ }
714
+ isStarted = true;
715
+ }));
716
+ })();
717
+ }
 
718
  }
719
 
720
  /*****************
784
  });
785
 
786
  //]]>
787
+ </script>
app/etc/modules/Algolia_Algoliasearch.xml CHANGED
@@ -4,7 +4,7 @@
4
  <Algolia_Algoliasearch>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
- <version>1.5.1</version>
8
  </Algolia_Algoliasearch>
9
  </modules>
10
  </config>
4
  <Algolia_Algoliasearch>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
+ <version>1.5.2</version>
8
  </Algolia_Algoliasearch>
9
  </modules>
10
  </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>algoliasearch</name>
4
- <version>1.5.1</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/algolia/algoliasearch-magento/blob/master/LICENSE.txt">MIT</license>
7
  <channel>community</channel>
@@ -11,11 +11,21 @@
11
  &#xD;
12
  This extension replaces Magento's FullText Search module and provide an as-you-type auto-completion menu in your searchbar.&#xD;
13
  </description>
14
- <notes>FIX: xss issue</notes>
 
 
 
 
 
 
 
 
 
 
15
  <authors><author><name>Algolia Team</name><user>algolia</user><email>support@algolia.com</email></author></authors>
16
- <date>2015-12-22</date>
17
- <time>08:47:44</time>
18
- <contents><target name="mageetc"><dir name="modules"><file name="Algolia_Algoliasearch.xml" hash="27e7b1384f4cefa90390c6248c3ff2ef"/></dir></target><target name="magecommunity"><dir name="Algolia"><dir name="Algoliasearch"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Custompages.php" hash="f87a9cf7b5559717cd9d6570374dcda7"/><file name="Customrankingcategory.php" hash="6d9575c12dbaecf9054de1cf12736025"/><file name="Customrankingproduct.php" hash="6d1b145e37c4f22d5b56f5783ac47511"/><file name="Customsortorder.php" hash="786c8f8fca2e4b41b8732f5fe270491b"/><file name="Customsortordercategory.php" hash="9908ea7f463138d3047c51b98591db9c"/><file name="Customsortorderproduct.php" hash="ee62901a3911bb7784467e1ca5cd8e84"/><file name="Facets.php" hash="b8c6217811a1c9afd64119d2b021cc5f"/><file name="Sections.php" hash="7aa62da4fb45f693bf81ad4aa0421ac3"/><file name="Select.php" hash="6e3cb4c1798775048bebbdc878e90aa9"/><file name="Sorts.php" hash="fede73c4ecbe39bf0344fbf6de46ed95"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Algoliahelper.php" hash="ff48a4929fffd913da57868457ace02f"/><file name="Config.php" hash="d4d0fa19e163fbb89a7420d5213420f8"/><file name="Data.php" hash="98de5155df9b05f29704e40a9ee9b37a"/><dir name="Entity"><file name="Additionalsectionshelper.php" hash="d4f67429e539e9ee9a5365ba45808770"/><file name="Categoryhelper.php" hash="fadd3225882f70e073fbb233b7cb003e"/><file name="Helper.php" hash="85d9be2a624e882996cb27fc0ff38826"/><file name="Pagehelper.php" hash="b9ccdbdc677eae9442741f96d648d991"/><file name="Producthelper.php" hash="f9ea0361c7f9685335cb36735079d62e"/><file name="Suggestionhelper.php" hash="6bbc72c1bbc17b13f8d9be1e0bb46fa2"/></dir><file name="Image.php" hash="b8df30f7df2894eff8b015f9ee9504fa"/><file name="Logger.php" hash="fede0bd23b1beff2520d361293217834"/></dir><dir name="Model"><dir name="Indexer"><file name="Algolia.php" hash="001d95cb530f2f7cda9edb0430fdb2b0"/><file name="Algoliaadditionalsections.php" hash="3113413441afccba3b8e79aa9fd8cdb1"/><file name="Algoliacategories.php" hash="2ea6c01f00d2d63d03fd0b62e6be78ae"/><file name="Algoliapages.php" hash="26ea3afee58d07b721c5cd74b3d6c4e3"/><file name="Algoliaqueuerunner.php" hash="24a0a2ed25e12ba5b9167b26c10b0add"/><file name="Algoliasuggestions.php" hash="7020d40bae60469d0acc7138ee72a419"/></dir><file name="Observer.php" hash="73ee1e9eb227085407bd130a4665a3ab"/><file name="Queue.php" hash="a0d83991ac0ea9cc66770cff9c9b9e7d"/><dir name="Resource"><file name="Engine.php" hash="35e38268af217a3c5f243a0a9b5f1474"/><dir name="Fulltext"><file name="Collection.php" hash="cf6c1b8ecaea31619db8186ccae8a2d4"/></dir><file name="Fulltext.php" hash="01d762ee24691ab5560505d94286f904"/></dir><dir name="System"><file name="Imagetype.php" hash="5fd4dbd98818a15b0253c5988a65a785"/><file name="Removewords.php" hash="25408eb3e3d278da2f2ec1a6b6e6d8e8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ea4176ed43885e531f90d1f5369f29ee"/><file name="config.xml" hash="631c7160a92ea3c5899b939918f2e0cd"/><file name="system.xml" hash="96c54bfd9c4c8a9303d541299de9c3ae"/></dir><dir name="sql"><dir name="algoliasearch_setup"><file name="mysql4-install-0.1.0.php" hash="fffd964f9c60be7909ec216260c37ba0"/><file name="mysql4-upgrade-0.1.0-1.4.8.php" hash="5224f8f1031a0659c64d393392a7f199"/><file name="mysql4-upgrade-1.4.8-1.5.0.php" hash="fa8be181b2d43e955e75dce1ed4a19ca"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="algoliasearch.xml" hash="c6cc5fb6125b2421341c7e1467677095"/></dir><dir name="template"><dir name="algoliasearch"><file name="beforecontent.phtml" hash="19f2ee9532f4e46c77ade0157976b780"/><file name="beforetopsearch.phtml" hash="f2cf955bd0cf27dc22d2e08b5ecf4774"/><file name="frontjs.phtml" hash="7d2cdf7bb5c2f47c0f118eac0ba1ead1"/><file name="topsearch.phtml" hash="f11318108073ca0801c75643dc04b5ae"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="algoliasearch"><file name="adminjs.phtml" hash="a5842a5c608c1496060dd4610c5c774f"/></dir></dir><dir name="layout"><file name="algoliasearch.xml" hash="312ecb88cb4ae694d098bda8f580d29e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="algoliasearch"><file name="algolia-admin-menu.png" hash="9202a559c30a43d4d4bbc2f9ee774fd9"/><file name="algolia-logo.png" hash="190884b3e8652f3517754ae15bca31de"/><file name="algoliasearch.css" hash="2ce306a84bcb31cdeec0e9663a83b169"/><file name="cross-circle.png" hash="a9ae2fa7ec458ffaf7c32613ca9593da"/><file name="cross.png" hash="a046cd95cba9761c824063fbd30a26b5"/><dir name="images"><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="62568c006bb1066f40fd5f9cfe4489be"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="406541454ec466d93217826588335194"/><file name="ui-bg_flat_10_000000_40x100.png" hash="85243ed808c91ae60d33bda3a6bdee3c"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="f912ffca9b1919ab26c64cf1332c5322"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="a9b41e3f4db0fb9be1cd2c649deb253f"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="ff9e9b45e03f11808144324fd5350612"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="08ece8908c07b1c0d18b8db076ff50fc"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="72fe4b0e1bbb83dfd6787989d3583fbe"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="81262299ac7f591fd1763c1ccee0691f"/><file name="ui-icons_222222_256x240.png" hash="3a3c5468f484f07ac4a320d9e22acb8c"/><file name="ui-icons_228ef1_256x240.png" hash="92b29683b6a48eae7de7eb4b1cfa039c"/><file name="ui-icons_ef8c08_256x240.png" hash="f492970693640894fb54166c75dd2925"/><file name="ui-icons_ffd27a_256x240.png" hash="dda1b6f694b0d196aefc66a1d6d758f6"/><file name="ui-icons_ffffff_256x240.png" hash="41612b0f4a034424f8321c9f824a94da"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="algoliasearch"><file name="Function.prototype.bind.js" hash="eb15975feb0cc976face88cb194294ae"/><file name="admin_scripts.js" hash="877a9fcbc5d3d627772464a9311ae0b3"/><file name="algoliaAdminBundle.min.js" hash="7cbce3614ccb065595a5c2ff56e32419"/><file name="algoliaBundle.min.js" hash="c81fc78bf11c34d73dddc5600611dc47"/></dir></dir><dir name="lib"><dir name="AlgoliaSearch"><file name="AlgoliaException.php" hash="4acaa7c9142e19d1084295a3b8ba18e2"/><file name="Client.php" hash="11ad687a9868a9f574ae6a069800dd2c"/><file name="ClientContext.php" hash="77d2449636d263162460a7ccaea4e6b6"/><file name="Index.php" hash="5c1eacc54cd503bff296e9bbbd402895"/><file name="Version.php" hash="0c37eb6324361991364e0efd2696e56d"/><dir name="resources"><file name="ca-bundle.crt" hash="47961e7ef15667c93cd99be01b51f00a"/></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>algoliasearch</name>
4
+ <version>1.5.2</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/algolia/algoliasearch-magento/blob/master/LICENSE.txt">MIT</license>
7
  <channel>community</channel>
11
  &#xD;
12
  This extension replaces Magento's FullText Search module and provide an as-you-type auto-completion menu in your searchbar.&#xD;
13
  </description>
14
+ <notes>===== BREAKING CHANGE =====&#xD;
15
+ &#xD;
16
+ A full reindex of the product indexer is needed&#xD;
17
+ &#xD;
18
+ ============================&#xD;
19
+ &#xD;
20
+ - NEW: handle multiple currencies&#xD;
21
+ - UPDATED: improve errors/warnings for reindexing &#xD;
22
+ - FIX: handle both secure and unsecure base url for images&#xD;
23
+ - FIX: ability to have only instant search&#xD;
24
+ - FIX: method to get product and categories url</notes>
25
  <authors><author><name>Algolia Team</name><user>algolia</user><email>support@algolia.com</email></author></authors>
26
+ <date>2016-01-08</date>
27
+ <time>09:44:49</time>
28
+ <contents><target name="mageetc"><dir name="modules"><file name="Algolia_Algoliasearch.xml" hash="76f2e6750adcb532438d3a9ac9b6d903"/></dir></target><target name="magecommunity"><dir name="Algolia"><dir name="Algoliasearch"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Custompages.php" hash="f87a9cf7b5559717cd9d6570374dcda7"/><file name="Customrankingcategory.php" hash="6d9575c12dbaecf9054de1cf12736025"/><file name="Customrankingproduct.php" hash="6d1b145e37c4f22d5b56f5783ac47511"/><file name="Customsortorder.php" hash="786c8f8fca2e4b41b8732f5fe270491b"/><file name="Customsortordercategory.php" hash="9908ea7f463138d3047c51b98591db9c"/><file name="Customsortorderproduct.php" hash="ee62901a3911bb7784467e1ca5cd8e84"/><file name="Facets.php" hash="b8c6217811a1c9afd64119d2b021cc5f"/><file name="Sections.php" hash="7aa62da4fb45f693bf81ad4aa0421ac3"/><file name="Select.php" hash="6e3cb4c1798775048bebbdc878e90aa9"/><file name="Sorts.php" hash="fede73c4ecbe39bf0344fbf6de46ed95"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Algoliahelper.php" hash="ff48a4929fffd913da57868457ace02f"/><file name="Config.php" hash="d4d0fa19e163fbb89a7420d5213420f8"/><file name="Data.php" hash="b2be5b2eab045fba6f69b33664c94f6c"/><dir name="Entity"><file name="Additionalsectionshelper.php" hash="d4f67429e539e9ee9a5365ba45808770"/><file name="Categoryhelper.php" hash="8a3caaa6a8e988d1ffd8c11486944535"/><file name="Helper.php" hash="85d9be2a624e882996cb27fc0ff38826"/><file name="Pagehelper.php" hash="b9ccdbdc677eae9442741f96d648d991"/><file name="Producthelper.php" hash="c0300fc18f305ee7391ccf39a4f86751"/><file name="Suggestionhelper.php" hash="6bbc72c1bbc17b13f8d9be1e0bb46fa2"/></dir><file name="Image.php" hash="876292c0612fa87194d1657a7facb916"/><file name="Logger.php" hash="fede0bd23b1beff2520d361293217834"/></dir><dir name="Model"><dir name="Indexer"><file name="Algolia.php" hash="0f8605eefc69a695a6ff7950d5f0c704"/><file name="Algoliaadditionalsections.php" hash="3113413441afccba3b8e79aa9fd8cdb1"/><file name="Algoliacategories.php" hash="2ea6c01f00d2d63d03fd0b62e6be78ae"/><file name="Algoliapages.php" hash="26ea3afee58d07b721c5cd74b3d6c4e3"/><file name="Algoliaqueuerunner.php" hash="24a0a2ed25e12ba5b9167b26c10b0add"/><file name="Algoliasuggestions.php" hash="7020d40bae60469d0acc7138ee72a419"/></dir><file name="Observer.php" hash="73ee1e9eb227085407bd130a4665a3ab"/><file name="Queue.php" hash="a0d83991ac0ea9cc66770cff9c9b9e7d"/><dir name="Resource"><file name="Engine.php" hash="d550dabcdc8ede0c96b6192e832de2a2"/><dir name="Fulltext"><file name="Collection.php" hash="cf6c1b8ecaea31619db8186ccae8a2d4"/></dir><file name="Fulltext.php" hash="01d762ee24691ab5560505d94286f904"/></dir><dir name="System"><file name="Imagetype.php" hash="5fd4dbd98818a15b0253c5988a65a785"/><file name="Removewords.php" hash="25408eb3e3d278da2f2ec1a6b6e6d8e8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ea4176ed43885e531f90d1f5369f29ee"/><file name="config.xml" hash="aa05552daa96cbdd83b9c1bd607ec365"/><file name="system.xml" hash="79d8f689d303548c37f1ba39d34e8d24"/></dir><dir name="sql"><dir name="algoliasearch_setup"><file name="mysql4-install-0.1.0.php" hash="fffd964f9c60be7909ec216260c37ba0"/><file name="mysql4-upgrade-0.1.0-1.4.8.php" hash="5224f8f1031a0659c64d393392a7f199"/><file name="mysql4-upgrade-1.4.8-1.5.0.php" hash="fa8be181b2d43e955e75dce1ed4a19ca"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="algoliasearch.xml" hash="28b9676bd76adfdbb9eecb54ce9c5f02"/></dir><dir name="template"><dir name="algoliasearch"><file name="beforecontent.phtml" hash="19f2ee9532f4e46c77ade0157976b780"/><file name="beforetopsearch.phtml" hash="2f9a42fa61b0f2be0bc2452ca924c2fb"/><file name="frontjs.phtml" hash="7d2cdf7bb5c2f47c0f118eac0ba1ead1"/><file name="topsearch.phtml" hash="f6d967f9170670ea8622bee66f0839df"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="algoliasearch"><file name="adminjs.phtml" hash="a5842a5c608c1496060dd4610c5c774f"/></dir></dir><dir name="layout"><file name="algoliasearch.xml" hash="312ecb88cb4ae694d098bda8f580d29e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="algoliasearch"><file name="algolia-admin-menu.png" hash="9202a559c30a43d4d4bbc2f9ee774fd9"/><file name="algolia-logo.png" hash="190884b3e8652f3517754ae15bca31de"/><file name="algoliasearch.css" hash="1e1a02b6a19bb45ccc00f77235e09f75"/><file name="cross-circle.png" hash="a9ae2fa7ec458ffaf7c32613ca9593da"/><file name="cross.png" hash="a046cd95cba9761c824063fbd30a26b5"/><dir name="images"><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="62568c006bb1066f40fd5f9cfe4489be"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="406541454ec466d93217826588335194"/><file name="ui-bg_flat_10_000000_40x100.png" hash="85243ed808c91ae60d33bda3a6bdee3c"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="f912ffca9b1919ab26c64cf1332c5322"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="a9b41e3f4db0fb9be1cd2c649deb253f"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="ff9e9b45e03f11808144324fd5350612"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="08ece8908c07b1c0d18b8db076ff50fc"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="72fe4b0e1bbb83dfd6787989d3583fbe"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="81262299ac7f591fd1763c1ccee0691f"/><file name="ui-icons_222222_256x240.png" hash="3a3c5468f484f07ac4a320d9e22acb8c"/><file name="ui-icons_228ef1_256x240.png" hash="92b29683b6a48eae7de7eb4b1cfa039c"/><file name="ui-icons_ef8c08_256x240.png" hash="f492970693640894fb54166c75dd2925"/><file name="ui-icons_ffd27a_256x240.png" hash="dda1b6f694b0d196aefc66a1d6d758f6"/><file name="ui-icons_ffffff_256x240.png" hash="41612b0f4a034424f8321c9f824a94da"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="algoliasearch"><file name="Function.prototype.bind.js" hash="eb15975feb0cc976face88cb194294ae"/><file name="admin_scripts.js" hash="877a9fcbc5d3d627772464a9311ae0b3"/><file name="algoliaAdminBundle.min.js" hash="7cbce3614ccb065595a5c2ff56e32419"/><file name="algoliaBundle.min.js" hash="c81fc78bf11c34d73dddc5600611dc47"/></dir></dir><dir name="lib"><dir name="AlgoliaSearch"><file name="AlgoliaException.php" hash="4acaa7c9142e19d1084295a3b8ba18e2"/><file name="Client.php" hash="11ad687a9868a9f574ae6a069800dd2c"/><file name="ClientContext.php" hash="77d2449636d263162460a7ccaea4e6b6"/><file name="Index.php" hash="5c1eacc54cd503bff296e9bbbd402895"/><file name="Version.php" hash="0c37eb6324361991364e0efd2696e56d"/><dir name="resources"><file name="ca-bundle.crt" hash="47961e7ef15667c93cd99be01b51f00a"/></dir></dir></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
31
  </package>
skin/frontend/base/default/algoliasearch/algoliasearch.css CHANGED
@@ -774,7 +774,7 @@ a.ais-current-refined-values--link:hover
774
  }
775
 
776
  #algolia_instant_selector .hits .infos {
777
- margin: 15px 15px 0;
778
  padding: 6px 10px;
779
  color: #aaa;
780
  text-align: center;
@@ -964,6 +964,7 @@ a.ais-current-refined-values--link:hover
964
 
965
  #algolia_instant_selector #instant-search-bar-container {
966
  padding-top: 0px;
 
967
  }
968
 
969
  #algolia_instant_selector .as-search-box--input {
774
  }
775
 
776
  #algolia_instant_selector .hits .infos {
777
+ margin: 0 15px;
778
  padding: 6px 10px;
779
  color: #aaa;
780
  text-align: center;
964
 
965
  #algolia_instant_selector #instant-search-bar-container {
966
  padding-top: 0px;
967
+ margin-bottom: 15px;
968
  }
969
 
970
  #algolia_instant_selector .as-search-box--input {