8000 Bugfixes & Tested Enhancements by winkelsdorf · Pull Request #8 · jreinke/magento-autocomplete · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/code/community/Bubble/Autocomplete/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @category Bubble
* @package Bubble_Autocomplete
* @version 1.1.2
* @version 1.1.3
* @copyright Copyright (c) 2015 BubbleShop (https://www.bubbleshop.net)
*/
class Bubble_Autocomplete_Helper_Data extends Mage_Core_Helper_Abstract
Expand Down
6 changes: 3 additions & 3 deletions app/code/community/Bubble/Autocomplete/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @category Bubble
* @package Bubble_Autocomplete
* @version 1.1.2
* @version 1.1.3
* @copyright Copyright (c) 2015 BubbleShop (https://www.bubbleshop.net)
*/
class Bubble_Autocomplete_Model_Observer
Expand All @@ -25,10 +25,10 @@ public function onProductCollectionInit(Varien_Event_Observer $observer)
/** @var Mage_Catalog_Model_Resource_Product_Collection $collection */
$collection = $observer->getEvent()->getCollection();
$collection->addAttributeToFilter('name', array('notnull' => true))
->addAttributeToFilter('image', array('notnull' => true))
->addAttributeToFilter('thumbnail', array('notnull' => true))
->addAttributeToFilter('url_path', array('notnull' => true))
->addStoreFilter()
->addPriceData()
->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @category Bubble
* @package Bubble_Autocomplete
* @version 1.1.2
* @version 1.1.3
* @copyright Copyright (c) 2015 BubbleShop (https://www.bubbleshop.net)
*/
class Bubble_Autocomplete_ProductController extends Mage_Core_Controller_Front_Action
Expand All @@ -25,7 +25,7 @@ public function jsonAction()
}

$this->getResponse()
->setHeader('Content-Type', 'application/json')
->setHeader('Content-Type', 'application/json', true)
->setBody($data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addItem" ifconfig="bubble_autocomplete/general/enable_jquery"><type>skin_js</type><script>js/lib/jquery-1.10.2.min.js</script></action>
<action method="addItem" ifconfig="bubble_autocomplete/general/enable_jquery"><type>skin_js</type><script>js/lib/noconflict.js</script></action>
<action method="addItem" ifconfig="bubble_autocomplete/general/enable"><type>skin_js</type><script>js/typeahead.bundle.js</script></action>
8000 <action method="addItem" ifconfig="bubble_autocomplete/general/enable_jquery"><type>skin_js</type><script>js/autocomplete/jquery-1.10.2.min.js</script></action>
<action method="addItem" ifconfig="bubble_autocomplete/general/enable_jquery"><type>skin_js</type><script>js/autocomplete/noconflict.js</script></action>
<action method="addItem" ifconfig="bubble_autocomplete/general/enable"><type>skin_js</type><script>js/autocomplete/typeahead.bundle.js</script></action>
<action method="addItem" ifconfig="bubble_autocomplete/general/enable"><type>skin_css</type><name>css/bubble/autocomplete.css</name></action>
</reference>
<reference name="before_body_end">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @category Bubble
* @package Bubble_Autocomplete
* @version 1.1.2
* @version 1.1.3
* @copyright Copyright (c) 2015 BubbleShop (https://www.bubbleshop.net)
*
* @var $this Mage_Core_Block_Abstract
Expand Down Expand Up @@ -32,13 +32,15 @@ var imgPlaceholder = '<?php echo Mage::getModel('catalog/product')->getSmallImag
var engine = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
limit: <?php echo $helper->getLimit() ?>,
<?php if ($helper->getUseLocalStorage()): ?>
prefetch: { url: '<?php echo $this->getUrl('autocomplete/product/json') ?>' },
prefetch: {
url: '<?php echo $this->getUrl('autocomplete/product/json') ?>',
ttl: <?php echo $helper->getCacheLifetime() * 1000 ?> // milliseconds
}
<?php else: ?>
remote: { url: '<?php echo $this->getUrl('autocomplete/product/json') ?>' },
remote: { url: '<?php echo $this->getUrl('autocomplete/product/json') ?>' }
<?php endif; ?>
limit: <?php echo $helper->getLimit() ?>,
ttl: <?php echo $helper->getCacheLifetime() * 1000 ?> // milliseconds
});

// kicks off the loading/processing of `local` and `prefetch`
Expand All @@ -60,8 +62,8 @@ jQuery('#search').typeahead({
'</div>',
suggestion: function(product) {
var img = imgPlaceholder;
if (product.image && product.image != 'no_selection') {
img = baseUrlMedia + product.image;
if (product.thumbnail && product.thumbnail != 'no_selection') {
img = baseUrlMedia + product.thumbnail;
}
return '<a href="' + baseUrl + product.url_path + '">' +
'<div class="image">' +
Expand Down Expand Up @@ -100,7 +102,7 @@ function formatSuggestionPrice(product, priceFormat) {
'</p>' +
'<p class="special-price">' +
'<span class="price">' +
formatCurrency(product.price, priceFormat, false) +
formatCurrency(product.final_price, priceFormat, false) +
'</span>' +
'</p>';
} else {
Expand All @@ -114,4 +116,4 @@ function formatSuggestionPrice(product, priceFormat) {
}
//]]>
</script>
<?php endif; ?>
<?php endif; ?>
3 changes: 3 additions & 0 deletions app/locale/de_DE/Bubble_Autocomplete.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"No Result","Keine Treffer"
"Starting at:","Bereits ab:"
"Regular Price:","Regulärer Preis:"
23 changes: 23 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "bubbleshop/magento-autocomplete",
"description": "Bubbleshop Autocomplete",
"homepage": "https://github.com/jreinke/magento-autocomplete",
"type": "magento-module",
"authors": [
{
"name": "Johann Reinke",
"homepage": "https://github.com/jreinke"
},
{
"name": "Volker Thiel",
"homepage": "https://github.com/riker09"
},
{
"name": "Frederik Winkelsdorf",
"homepage": "https://github.com/winkelsdorf"
}
],
"require": {
"magento-hackathon/magento-composer-installer": "*"
}
}
10 changes: 10 additions & 0 deletions modman
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
app/code/community/Bubble/Autocomplete app/code/community/Bubble/Autocomplete
app/design/frontend/base/default/layout/bubble/autocomplete.xml app/design/frontend/base/default/layout/bubble/autocomplete.xml
app/design/frontend/base/default/template/bubble/autocomplete app/design/frontend/base/default/template/bubble/autocomplete
app/etc/modules/Bubble_Autocomplete.xml app/etc/modules/Bubble_Autocomplete.xml
app/locale/de_DE/Bubble_Autocomplete.csv app/locale/de_DE/Bubble_Autocomplete.csv
skin/frontend/base/default/css/bubble/autocomplete.css skin/frontend/base/default/css/bubble/autocomplete.css
skin/frontend/base/default/js/autocomplete/jquery-1.10.2.min.js skin/frontend/base/default/js/autocomplete/jquery-1.10.2.min.js
skin/frontend/base/default/js/autocomplete/noconflict.js skin/frontend/base/default/js/autocomplete/noconflict.js
skin/frontend/base/default/js/autocomplete/typeahead.bundle.js skin/frontend/base/default/js/autocomplete/typeahead.bundle.js
skin/frontend/rwd/default/css/bubble/autocomplete.css skin/frontend/rwd/default/css/bubble/autocomplete.css
Loading
0