Skip to content

Commit

Permalink
Merge pull request #332 from algolia/develop
Browse files Browse the repository at this point in the history
1.5.4 release
  • Loading branch information
maxiloc committed Mar 10, 2016
2 parents 6d8a2b9 + c16b535 commit a91de23
Show file tree
Hide file tree
Showing 54 changed files with 100 additions and 74 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
2 changes: 1 addition & 1 deletion Algolia_Algoliasearch.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Algolia_Algoliasearch>
<active>true</active>
<codePool>community</codePool>
<version>1.5.3</version>
<version>1.5.4</version>
</Algolia_Algoliasearch>
</modules>
</config>
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Change Log

### 1.5.4

- UPDATED: instantsearch.js update
- FIX: issue with slaves creation
- FIX: issue for bundle products when customer group is enabled
- FIX: casting in resulting in bad typing in Algolia

### 1.5.3

- UPDATED: added a config to disable logging
Expand Down
Empty file modified LICENSE.txt
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This extension replaces the default search of Magento with a typo-tolerant, fast

See features and benefits of [Algolia Search Extension for Magento](https://community.algolia.com/magento).

![Latest version](https://img.shields.io/badge/latest-1.5.3-green.svg)
![Latest version](https://img.shields.io/badge/latest-1.5.4-green.svg)
![Magento 1.6.2](https://img.shields.io/badge/magento-1.6.2-blue.svg)
![Magento 1.7.1](https://img.shields.io/badge/magento-1.7.1-blue.svg)
![Magento 1.8.1](https://img.shields.io/badge/magento-1.8.1-blue.svg)
Expand Down
2 changes: 1 addition & 1 deletion code/Helper/Data.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Algolia_Algoliasearch_Helper_Data extends Mage_Core_Helper_Abstract

public function __construct()
{
\AlgoliaSearch\Version::$custom_value = " Magento (1.5.3)";
\AlgoliaSearch\Version::$custom_value = " Magento (1.5.4)";

$this->algolia_helper = Mage::helper('algoliasearch/algoliahelper');

Expand Down
3 changes: 3 additions & 0 deletions code/Helper/Entity/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ protected function castProductObject(&$productData)
{
foreach ($productData as $key => &$data)
{
if ($key === 'sku') {
continue;
}
$data = $this->try_cast($data);

if (is_array($data) === false)
Expand Down
38 changes: 21 additions & 17 deletions code/Helper/Entity/Producthelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,35 +224,31 @@ public function setSettings($storeId)

foreach ($sorting_indices as $values)
{
if ($this->config->isCustomerGroupsEnabled($storeId))
if ($this->config->isCustomerGroupsEnabled($storeId) && strpos($values['attribute'], 'price') !== false)
{
if (strpos($values['attribute'], 'price') !== false)
foreach ($groups = Mage::getModel('customer/group')->getCollection() as $group)
{
foreach ($groups = Mage::getModel('customer/group')->getCollection() as $group)
{
$group_id = (int)$group->getData('customer_group_id');
$group_id = (int)$group->getData('customer_group_id');

$suffix_index_name = 'group_' . $group_id;
$suffix_index_name = 'group_' . $group_id;

$sort_attribute = strpos($values['attribute'], 'price') !== false ? $values['attribute'].'.'.$currencies[0].'.'.$suffix_index_name : $values['attribute'];
$sort_attribute = strpos($values['attribute'], 'price') !== false ? $values['attribute'] . '.' . $currencies[0] . '.' . $suffix_index_name : $values['attribute'];

$mergeSettings['ranking'] = array($values['sort'].'('.$sort_attribute.')', 'typo', 'geo', 'words', 'proximity', 'attribute', 'exact', 'custom');
$mergeSettings['ranking'] = array($values['sort'] . '(' . $sort_attribute . ')', 'typo', 'geo', 'words', 'proximity', 'attribute', 'exact', 'custom');

$this->algolia_helper->setSettings($this->getIndexName($storeId).'_'.$values['attribute'].'_'. $suffix_index_name .'_'.$values['sort'], $mergeSettings);
}
$this->algolia_helper->setSettings($this->getIndexName($storeId) . '_' . $values['attribute'] . '_' . $suffix_index_name . '_' . $values['sort'], $mergeSettings);
}
}
else
{
$sort_attribute = strpos($values['attribute'], 'price') !== false ? $values['attribute'].'.'.$currencies[0].'.'.'default' : $values['attribute'];
$sort_attribute = strpos($values['attribute'], 'price') !== false ? $values['attribute'] . '.' . $currencies[0] . '.' . 'default' : $values['attribute'];

$mergeSettings['ranking'] = array($values['sort'].'('.$sort_attribute.')', 'typo', 'geo', 'words', 'proximity', 'attribute', 'exact', 'custom');
$mergeSettings['ranking'] = array($values['sort'] . '(' . $sort_attribute . ')', 'typo', 'geo', 'words', 'proximity', 'attribute', 'exact', 'custom');

if ($values['attribute'] === 'price')
$this->algolia_helper->setSettings($this->getIndexName($storeId) . '_' .$values['attribute']. '_default_' . $values['sort'], $mergeSettings);
$this->algolia_helper->setSettings($this->getIndexName($storeId) . '_' . $values['attribute'] . '_default_' . $values['sort'], $mergeSettings);
else
$this->algolia_helper->setSettings($this->getIndexName($storeId) . '_' .$values['attribute']. '_' . $values['sort'], $mergeSettings);

$this->algolia_helper->setSettings($this->getIndexName($storeId) . '_' . $values['attribute'] . '_' . $values['sort'], $mergeSettings);
}
}
}
Expand Down Expand Up @@ -355,6 +351,8 @@ protected function handlePrice(&$product, $sub_products, &$customData)

if ($special_price && $special_price < $customData[$field][$currency_code]['group_' . $group_id])
{
$customData[$field][$currency_code]['group_' . $group_id . '_original_formated'] = $customData[$field][$currency_code]['default_formated'];

$customData[$field][$currency_code]['group_' . $group_id] = $special_price;
$customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $this->formatPrice($special_price, false, $currency_code);
}
Expand All @@ -381,6 +379,8 @@ protected function handlePrice(&$product, $sub_products, &$customData)
$_priceModel = $product->getPriceModel();

list($min, $max) = $_priceModel->getTotalPrices($product, null, $with_tax, true);
$min = (double) $min;
$max = (double) $max;
}

if ($type == 'grouped')
Expand Down Expand Up @@ -429,13 +429,17 @@ protected function handlePrice(&$product, $sub_products, &$customData)
if ($min != $max && $min <= $customData[$field][$currency_code]['group_' . $group_id])
{
$customData[$field][$currency_code]['group_' . $group_id] = 0;
$customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $dashed_format;
}
else
{
$customData[$field][$currency_code]['group_' . $group_id] = $customData[$field][$currency_code]['default'];
}

$customData[$field][$currency_code]['group_' . $group_id . '_formated'] = $dashed_format;
}
}
}


if ($customData[$field][$currency_code]['default'] == 0)
{
$customData[$field][$currency_code]['default'] = $min;
Expand Down
Empty file modified code/Model/Observer.php
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion code/etc/config.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Algolia_Algoliasearch>
<version>1.5.3</version>
<version>1.5.4</version>
</Algolia_Algoliasearch>
</modules>
<frontend>
Expand Down
2 changes: 1 addition & 1 deletion code/etc/system.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<algoliasearch translate="label" module="algoliasearch">
<label>
<![CDATA[
Algolia Search 1.5.3
Algolia Search 1.5.4
<style>
.algoliasearch-admin-menu span {
padding-left: 38px !important;
Expand Down
2 changes: 1 addition & 1 deletion design/frontend/template/beforetopsearch.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ if ($config->isInstantEnabled() && $isSearchPage) {
if (Array.isArray(hit.price))
hit.price = hit.price[0];

if (price_key !== '.' + algoliaConfig.currency_code + '.default' &&
if (price_key !== '.' + algoliaConfig.currency_code + '.default' && hit['price'] !== undefined &&
hit['price'][algoliaConfig.currency_code][price_key.substr(1) + '_formated'] !== hit['price'][algoliaConfig.currency_code]['default_formated']) {
hit['price'][algoliaConfig.currency_code][price_key.substr(1) + '_original_formated'] = hit['price'][algoliaConfig.currency_code]['default_formated'];
}
Expand Down
1 change: 1 addition & 0 deletions dev/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ n98-magerun --root-dir=/var/www/htdocs config:set algoliasearch/credentials/appl
n98-magerun --root-dir=/var/www/htdocs config:set algoliasearch/credentials/search_only_api_key $SEARCH_ONLY_API_KEY
n98-magerun --root-dir=/var/www/htdocs config:set algoliasearch/credentials/api_key $API_KEY
n98-magerun --root-dir=/var/www/htdocs config:set algoliasearch/credentials/index_prefix $INDEX_PREFIX
n98-magerun --root-dir=/var/www/htdocs config:set algoliasearch/credentials/is_instant_enabled "1"
n98-magerun --root-dir=/var/www/htdocs config:set web/unsecure/base_url $BASE_URL
n98-magerun --root-dir=/var/www/htdocs config:set web/secure/base_url $BASE_URL

Expand Down
2 changes: 1 addition & 1 deletion dev/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "./scripts/build.sh"
},
"dependencies": {
"algoliasearch-extensions-bundle": "^4.2.0"
"algoliasearch-extensions-bundle": "^4.3.1"
},
"author": "Algolia <support@algolia.com>",
"license": "ISC"
Expand Down
4 changes: 2 additions & 2 deletions dev/frontend/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ set -e # exit when error
set -x # debug messages

npm install algoliasearch-extensions-bundle@latest --save
cp node_modules/algoliasearch-extensions-bundle/dist/algoliaBundle.min.js ../../js/algoliaBundle.min.js
cp node_modules/algoliasearch-extensions-bundle/dist/algoliaAdminBundle.min.js ../../js/algoliaAdminBundle.min.js
cp node_modules/algoliasearch-extensions-bundle/dist/algoliaBundle.min.js* ../../js/
cp node_modules/algoliasearch-extensions-bundle/dist/algoliaAdminBundle.min.js* ../../js/
Binary file removed doc/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/_config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.5.3
version: 1.5.4

# Site settings
title: Algolia for Magento
Expand Down
Binary file removed doc/img/.DS_Store
Binary file not shown.
Empty file modified doc/img/autocomplete.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/ecommerce-search.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/ecommerce-search@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/ecommerce-search@3x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/faceted.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/header-bg.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/header-bg@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/header-bg@3x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-analytics.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-analytics@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-analytics@3x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-instant.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-instant@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-instant@3x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-relevance.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-relevance@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-relevance@3x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-speed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-speed@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-speed@3x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-sync.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-sync@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-sync@3x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-typo-tolerance.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-typo-tolerance@2x.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/img/icon-typo-tolerance@3x.png
100755 → 100644
Empty file modified doc/img/showcase-1.png
100755 → 100644
Empty file modified doc/img/showcase-1@2x.png
100755 → 100644
Empty file modified doc/img/showcase-1@3x.png
100755 → 100644
Empty file modified doc/js/bootstrap.min.js
100755 → 100644
Empty file.
52 changes: 27 additions & 25 deletions js/algoliaAdminBundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/algoliaAdminBundle.min.js.map

Large diffs are not rendered by default.

50 changes: 28 additions & 22 deletions js/algoliaBundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/algoliaBundle.min.js.map

Large diffs are not rendered by default.

Binary file added releases/algoliasearch-1.5.4.tgz
Binary file not shown.
Empty file modified skin/algoliasearch.css
100755 → 100644
Empty file.

0 comments on commit a91de23

Please sign in to comment.