diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/Algolia_Algoliasearch.xml b/Algolia_Algoliasearch.xml old mode 100755 new mode 100644 index 25d013c3..107e7479 --- a/Algolia_Algoliasearch.xml +++ b/Algolia_Algoliasearch.xml @@ -4,7 +4,7 @@ true community - 1.5.3 + 1.5.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 42256632..a80c5ab4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/LICENSE.txt b/LICENSE.txt old mode 100755 new mode 100644 diff --git a/README.md b/README.md index 42da90fe..45eafaf8 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/code/Helper/Data.php b/code/Helper/Data.php old mode 100755 new mode 100644 index 4ac4dace..5e291f5c --- a/code/Helper/Data.php +++ b/code/Helper/Data.php @@ -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'); diff --git a/code/Helper/Entity/Helper.php b/code/Helper/Entity/Helper.php index bddcd69f..2731b915 100644 --- a/code/Helper/Entity/Helper.php +++ b/code/Helper/Entity/Helper.php @@ -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) diff --git a/code/Helper/Entity/Producthelper.php b/code/Helper/Entity/Producthelper.php index fc0ec213..771fd6a2 100644 --- a/code/Helper/Entity/Producthelper.php +++ b/code/Helper/Entity/Producthelper.php @@ -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); } } } @@ -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); } @@ -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') @@ -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; diff --git a/code/Model/Observer.php b/code/Model/Observer.php old mode 100755 new mode 100644 diff --git a/code/etc/config.xml b/code/etc/config.xml old mode 100755 new mode 100644 index e41fd035..5ee43393 --- a/code/etc/config.xml +++ b/code/etc/config.xml @@ -2,7 +2,7 @@ - 1.5.3 + 1.5.4 diff --git a/code/etc/system.xml b/code/etc/system.xml old mode 100755 new mode 100644 index 20449aa2..2ac52a2d --- a/code/etc/system.xml +++ b/code/etc/system.xml @@ -4,7 +4,7 @@