Version Notes
Instant_search
Download this release
Release Info
Developer | Magento Core Team |
Extension | ProductInstantSearch |
Version | 0.1.0 |
Comparing to | |
See all releases |
Code changes from version 0.1.1 to 0.1.0
- app/code/local/Magestore/Instantsearch/Block/Instantsearch.php +21 -0
- app/code/local/Magestore/Instantsearch/Helper/Catalogsearch.php +27 -0
- app/code/local/Magestore/Instantsearch/Helper/Data.php +176 -0
- app/code/local/Magestore/Instantsearch/Model/Descriptiontype.php +1 -0
- app/code/local/Magestore/Instantsearch/Model/Observer.php +24 -0
- app/code/local/Magestore/Instantsearch/controllers/IndexController.php +138 -0
- app/code/local/Magestore/Instantsearch/etc/adminhtml.xml +27 -0
- app/code/local/Magestore/Instantsearch/etc/config.xml +114 -0
- app/code/local/Magestore/Instantsearch/etc/system.xml +76 -0
- app/design/frontend/default/default/layout/instantsearch.xml +21 -0
- app/design/frontend/default/default/template/instantsearch/instantsearch.phtml +53 -0
- app/design/frontend/default/default/template/instantsearch/view.phtml +40 -0
- app/etc/modules/Magestore_Instantsearch.xml +9 -0
- js/magestore/instantsearch.js +187 -0
- js/magestore/viewinstantsearch.js +185 -0
- package.xml +5 -5
- skin/frontend/base/default/css/magestore/instantsearch.css +87 -0
app/code/local/Magestore/Instantsearch/Block/Instantsearch.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Magestore_Instantsearch_Block_Instantsearch extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function setTopSearchTemplate($template)
|
10 |
+
{
|
11 |
+
if(!Mage::helper('magenotification')->checkLicenseKey('Instantsearch')){
|
12 |
+
return $this;
|
13 |
+
}
|
14 |
+
|
15 |
+
$topSearch = $this->getParentBlock();
|
16 |
+
if($topSearch != null){
|
17 |
+
$topSearch->setTemplate($template);
|
18 |
+
}
|
19 |
+
return $this;
|
20 |
+
}
|
21 |
+
}
|
app/code/local/Magestore/Instantsearch/Helper/Catalogsearch.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_Instantsearch_Helper_Catalogsearch extends Mage_CatalogSearch_Helper_Data
|
4 |
+
{
|
5 |
+
const OVERWRITE_QUICK_SEARCH = 'instantsearch/general/overwrite_quick_search';
|
6 |
+
|
7 |
+
public function getResultUrl($query = null)
|
8 |
+
{
|
9 |
+
if(!Mage::helper('magenotification')->checkLicenseKey('Instantsearch')){
|
10 |
+
return parent::getResultUrl($query);
|
11 |
+
}
|
12 |
+
|
13 |
+
if(Mage::getStoreConfig(self::OVERWRITE_QUICK_SEARCH)){
|
14 |
+
return $this->_getUrl('instantsearch');
|
15 |
+
}
|
16 |
+
else{
|
17 |
+
return $this->_getUrl('catalogsearch/result', array(
|
18 |
+
'_query' => array(self::QUERY_VAR_NAME => $query),
|
19 |
+
'_secure' => Mage::app()->getFrontController()->getRequest()->isSecure()
|
20 |
+
));
|
21 |
+
}
|
22 |
+
}
|
23 |
+
public function getResultInstantSearch($query = null)
|
24 |
+
{
|
25 |
+
|
26 |
+
}
|
27 |
+
}
|
app/code/local/Magestore/Instantsearch/Helper/Data.php
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_Instantsearch_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function getSearchProduct($keyword)
|
6 |
+
{
|
7 |
+
$result = array();
|
8 |
+
|
9 |
+
$limit = Mage::getStoreConfig('instantsearch/general/more_product_num');
|
10 |
+
//search by name
|
11 |
+
if(Mage::getStoreConfig('instantsearch/general/search_in_name'))
|
12 |
+
$products = $this->searchProductByAttribute($keyword,"name");
|
13 |
+
else $products = array();
|
14 |
+
$product_count = count($products);
|
15 |
+
|
16 |
+
if($product_count)
|
17 |
+
{
|
18 |
+
foreach($products as $productId)
|
19 |
+
{
|
20 |
+
$result[] = $productId;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
//search by tag
|
26 |
+
if($product_count < $limit)
|
27 |
+
{
|
28 |
+
$product_list2 = $this->searchProductByTag($keyword);
|
29 |
+
|
30 |
+
if(count($product_list2))
|
31 |
+
{
|
32 |
+
|
33 |
+
foreach($product_list2 as $productId)
|
34 |
+
{
|
35 |
+
$result[] = $productId;
|
36 |
+
$product_count++;
|
37 |
+
if($product_count >= $limit)
|
38 |
+
{
|
39 |
+
break;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
//search by description
|
45 |
+
if($product_count < $limit)
|
46 |
+
{
|
47 |
+
if(Mage::getStoreConfig('instantsearch/general/search_in_description')) {
|
48 |
+
$description_type = Mage::getStoreConfig('instantsearch/general/search_description_type');
|
49 |
+
switch($description_type) {
|
50 |
+
case 1:
|
51 |
+
$product_list3 = $this->searchProductByAttribute($keyword,"short_description");
|
52 |
+
break;
|
53 |
+
case 2:
|
54 |
+
$product_list3 = $this->searchProductByAttribute($keyword,"description");
|
55 |
+
break;
|
56 |
+
case 3:
|
57 |
+
$product_list3_1 = $this->searchProductByAttribute($keyword,"short_description");
|
58 |
+
$product_list3_2 = $this->searchProductByAttribute($keyword,"description");
|
59 |
+
$array_merge = array_merge($product_list3_1,$product_list3_2);
|
60 |
+
$product_list3 = array();
|
61 |
+
if(count($array_merge)) {
|
62 |
+
foreach($array_merge as $item) {
|
63 |
+
$product_list3[$item] = $item;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
} else $product_list3 = array();
|
69 |
+
|
70 |
+
if(count($product_list3))
|
71 |
+
{
|
72 |
+
|
73 |
+
foreach($product_list3 as $productId)
|
74 |
+
{
|
75 |
+
$result[] = $productId;
|
76 |
+
$product_count++;
|
77 |
+
if($product_count >= $limit)
|
78 |
+
{
|
79 |
+
break;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
$result_final = array();
|
86 |
+
if(count($result)) {
|
87 |
+
foreach($result as $item)
|
88 |
+
$result_final[$item] = $item;
|
89 |
+
}
|
90 |
+
|
91 |
+
return $result_final;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function searchProductByAttribute($keyword,$att)
|
95 |
+
{
|
96 |
+
$result = array();
|
97 |
+
|
98 |
+
$limit = Mage::getStoreConfig('instantsearch/general/more_product_num');
|
99 |
+
|
100 |
+
$storeId = Mage::app()->getStore()->getId();
|
101 |
+
$products = Mage::getModel('catalog/product')->getCollection()
|
102 |
+
->addAttributeToSelect('*')
|
103 |
+
->setStoreId($storeId)
|
104 |
+
->addStoreFilter($storeId)
|
105 |
+
->addFieldToFilter("status",1)
|
106 |
+
->addFieldToFilter($att,array('like'=>'%'. $keyword.'%'))
|
107 |
+
->setPageSize($limit)
|
108 |
+
->setCurPage(1)
|
109 |
+
->setOrder('name','ASC');
|
110 |
+
|
111 |
+
Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($products);
|
112 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($products);
|
113 |
+
$products->load();
|
114 |
+
|
115 |
+
if(count($products))
|
116 |
+
{
|
117 |
+
foreach($products as $product)
|
118 |
+
{
|
119 |
+
$result[] = $product->getId();
|
120 |
+
}
|
121 |
+
}
|
122 |
+
return $result;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function searchProductByTag($keyword)
|
126 |
+
{
|
127 |
+
$result = array();
|
128 |
+
|
129 |
+
if(Mage::getStoreConfig('instantsearch/general/search_in_tag'))
|
130 |
+
{
|
131 |
+
$model = Mage::getModel('tag/tag');
|
132 |
+
$tag_collections = $model->getResourceCollection()
|
133 |
+
->addPopularity()
|
134 |
+
->addStatusFilter($model->getApprovedStatus())
|
135 |
+
->addFieldToFilter("name",array('like'=>'%'. $keyword.'%'))
|
136 |
+
->addStoreFilter(Mage::app()->getStore()->getId())
|
137 |
+
->setActiveFilter()
|
138 |
+
->load();
|
139 |
+
if(count($tag_collections))
|
140 |
+
{
|
141 |
+
foreach($tag_collections as $tag)
|
142 |
+
{
|
143 |
+
$products = $this->getProductListByTagId($tag->getId());
|
144 |
+
if(count($products))
|
145 |
+
{
|
146 |
+
foreach($products as $product)
|
147 |
+
{
|
148 |
+
$result[] = $product->getId();
|
149 |
+
}
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
return $result;
|
155 |
+
}
|
156 |
+
|
157 |
+
public function getProductListByTagId($tagId)
|
158 |
+
{
|
159 |
+
|
160 |
+
$tagModel = Mage::getModel('tag/tag');
|
161 |
+
$collections = $tagModel->getEntityCollection()
|
162 |
+
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
163 |
+
->addTagFilter($tagId)
|
164 |
+
->addStoreFilter()
|
165 |
+
->addMinimalPrice()
|
166 |
+
->addUrlRewrite()
|
167 |
+
->setActiveFilter();
|
168 |
+
Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($collections);
|
169 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($collections);
|
170 |
+
|
171 |
+
return $collections;
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
+
|
176 |
+
}
|
app/code/local/Magestore/Instantsearch/Model/Descriptiontype.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php
|
app/code/local/Magestore/Instantsearch/Model/Observer.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_Instantsearch_Model_Observer {
|
4 |
+
|
5 |
+
public function controller_action_predispatch_adminhtml($observer)
|
6 |
+
{
|
7 |
+
$controller = $observer->getControllerAction();
|
8 |
+
if($controller->getRequest()->getControllerName() != 'system_config'
|
9 |
+
|| $controller->getRequest()->getActionName() != 'edit')
|
10 |
+
return;
|
11 |
+
$section = $controller->getRequest()->getParam('section');
|
12 |
+
if($section != 'instantsearch')
|
13 |
+
return;
|
14 |
+
$magenotificationHelper = Mage::helper('magenotification');
|
15 |
+
if(!$magenotificationHelper->checkLicenseKey('Instantsearch')){
|
16 |
+
$message = $magenotificationHelper->getInvalidKeyNotice();
|
17 |
+
echo $message;die();
|
18 |
+
}elseif((int)$magenotificationHelper->getCookieLicenseType() == Magestore_Magenotification_Model_Keygen::TRIAL_VERSION){
|
19 |
+
Mage::getSingleton('adminhtml/session')->addNotice($magenotificationHelper->__('You are using a trial version of Product Instant Search extension. It will be expired on %s.',
|
20 |
+
$magenotificationHelper->getCookieData('expired_time')
|
21 |
+
));
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Magestore/Instantsearch/controllers/IndexController.php
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Magestore_Instantsearch_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$keyword = urldecode($this->getRequest()->getParam('keyword'));
|
7 |
+
$q = urldecode($this->getRequest()->getParam('q'));
|
8 |
+
|
9 |
+
if($q)
|
10 |
+
{
|
11 |
+
$keyword = $q;
|
12 |
+
}
|
13 |
+
Mage::register('keyword',$keyword);
|
14 |
+
|
15 |
+
$this->loadLayout();
|
16 |
+
$this->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function searchAction()
|
20 |
+
{
|
21 |
+
if(!Mage::helper('magenotification')->checkLicenseKey('Instantsearch')){
|
22 |
+
return;
|
23 |
+
}
|
24 |
+
|
25 |
+
$keyword = $this->getRequest()->getPost('keyword');
|
26 |
+
|
27 |
+
$products = Mage::helper("instantsearch")->getSearchProduct($keyword);
|
28 |
+
$_coreHelper = Mage::helper('core');
|
29 |
+
|
30 |
+
$result = array();
|
31 |
+
$items = array();
|
32 |
+
$thumb_width = Mage::getStoreConfig('instantsearch/general/thumb_image_width');
|
33 |
+
if(count($products))
|
34 |
+
{
|
35 |
+
foreach($products as $productId)
|
36 |
+
{
|
37 |
+
$product = Mage::getModel("catalog/product")->load($productId);
|
38 |
+
$img = Mage::helper('catalog/image')->init($product, 'image')->resize($thumb_width);
|
39 |
+
$img = $img->__toString();
|
40 |
+
$price = $_coreHelper->currency($product->getPrice(),true,false);
|
41 |
+
$product_url = $product->getProductUrl();
|
42 |
+
$items[] = array("name"=>$product->getName(),"id"=>$product->getId(),"image"=>$img,"price"=>$price,"url"=>$product_url);
|
43 |
+
|
44 |
+
}
|
45 |
+
$result['products'] = $items;
|
46 |
+
}
|
47 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
48 |
+
}
|
49 |
+
|
50 |
+
public function loadproductAction()
|
51 |
+
{
|
52 |
+
$_coreHelper = Mage::helper('core');
|
53 |
+
$cart_helper = Mage::helper('checkout/cart');
|
54 |
+
|
55 |
+
$product_helper = Mage::helper("catalog/product");
|
56 |
+
$id = $this->getRequest()->getParam('id');
|
57 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
58 |
+
$img = Mage::helper('catalog/image')->init($product, 'image')->resize(220);
|
59 |
+
$product_url = $product->getProductUrl();
|
60 |
+
$product_name = $product->getName();
|
61 |
+
|
62 |
+
$html ="";
|
63 |
+
$html .= "<form id='productAddToCartForm' name='productAddToCartForm' action='". $cart_helper->getAddUrl($product,array()). "' method='post'>";
|
64 |
+
|
65 |
+
$html .= "<div id='mainProduct'>
|
66 |
+
<div id='product_img_box'><a href='".$product_url."' title='".$product_name."' target='_blank'><img src='". $img ."' title='".$product_name."'></a></div>
|
67 |
+
<div id='product_information'>
|
68 |
+
<h3 title='".$product->getName()."'>".$product->getName()."</h3>
|
69 |
+
<div class='product_price'>".$_coreHelper->currency($product->getPrice(),true,false). "</div>";
|
70 |
+
|
71 |
+
if($product->isSaleable())
|
72 |
+
{
|
73 |
+
$html .= "<fieldset class='add-to-cart-box'>
|
74 |
+
<legend>" . $product_helper->__('Add Items to Cart') . "</legend>";
|
75 |
+
|
76 |
+
if(!$product->isGrouped())
|
77 |
+
{
|
78 |
+
$html .= " <span class='qty-box'><label for='qty'>". $product_helper->__('Qty') .":</label>
|
79 |
+
<input name='qty' type='text' class='input-text qty' id='qty' maxlength='12' /></span>";
|
80 |
+
}
|
81 |
+
$html .=" <button type='button' class='button' onclick='javascript:document.productAddToCartForm.submit()'><span>". $product_helper->__('Add to Cart') ."</span></button>";
|
82 |
+
$html .="</fieldset>";
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
$html .="<br><div id='description'><h4>".Mage::helper("catalog/product")->__("Quick Overview")." <a href='".$product_url."' target='_blank'>".$product_helper->__('View Detail')."</a></h4>"
|
87 |
+
. $product->getShortDescription()
|
88 |
+
."</div>"
|
89 |
+
."</div>
|
90 |
+
</div></form>";
|
91 |
+
$this->getResponse()->setHeader('Content-type', 'application/x-json');
|
92 |
+
$this->getResponse()->setBody($html);
|
93 |
+
}
|
94 |
+
public function loadproductviewAction()
|
95 |
+
{
|
96 |
+
$_coreHelper = Mage::helper('core');
|
97 |
+
$cart_helper = Mage::helper('checkout/cart');
|
98 |
+
|
99 |
+
$product_helper = Mage::helper("catalog/product");
|
100 |
+
$id = $this->getRequest()->getParam('id');
|
101 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
102 |
+
$img = Mage::helper('catalog/image')->init($product, 'image')->resize(220);
|
103 |
+
$product_url = $product->getProductUrl();
|
104 |
+
$product_name = $product->getName();
|
105 |
+
|
106 |
+
$html ="";
|
107 |
+
$html .= "<form id='productAddToCartForm' name='productAddToCartForm' action='". $cart_helper->getAddUrl($product,array()). "' method='post'>";
|
108 |
+
|
109 |
+
$html .= "<div id='mainViewProduct'>
|
110 |
+
<div id='product_img_box'><a href='".$product_url."' title='".$product_name."' target='_blank'><img src='". $img ."' title='".$product_name."'></a></div>
|
111 |
+
<div id='product_information'>
|
112 |
+
<h3 title='".$product->getName()."'>".$product->getName()."</h3>
|
113 |
+
<div class='product_price'>".$_coreHelper->currency($product->getPrice(),true,false). "</div>";
|
114 |
+
|
115 |
+
if($product->isSaleable())
|
116 |
+
{
|
117 |
+
$html .= "<fieldset class='add-to-cart-box'>
|
118 |
+
<legend>" . $product_helper->__('Add Items to Cart') . "</legend>";
|
119 |
+
|
120 |
+
if(!$product->isGrouped())
|
121 |
+
{
|
122 |
+
$html .= " <span class='qty-box'><label for='qty'>". $product_helper->__('Qty') .":</label>
|
123 |
+
<input name='qty' type='text' class='input-text qty' id='qty' maxlength='12' /></span>";
|
124 |
+
}
|
125 |
+
$html .=" <button type='button' class='button' onclick='javascript:document.productAddToCartForm.submit()'><span>". $product_helper->__('Add to Cart') ."</span></button>";
|
126 |
+
$html .="</fieldset>";
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
$html .="<br><div id='description'><h4>".Mage::helper("catalog/product")->__("Quick Overview")." <a href='".$product_url."' target='_blank'>".$product_helper->__('View Detail')."</a></h4>"
|
131 |
+
. $product->getShortDescription()
|
132 |
+
."</div>"
|
133 |
+
."</div>
|
134 |
+
</div></form>";
|
135 |
+
$this->getResponse()->setHeader('Content-type', 'application/x-json');
|
136 |
+
$this->getResponse()->setBody($html);
|
137 |
+
}
|
138 |
+
}
|
app/code/local/Magestore/Instantsearch/etc/adminhtml.xml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<all>
|
6 |
+
<title>Allow Everything</title>
|
7 |
+
</all>
|
8 |
+
<admin>
|
9 |
+
<children>
|
10 |
+
<system>
|
11 |
+
<children>
|
12 |
+
<config>
|
13 |
+
<children>
|
14 |
+
<instantsearch translate="title">
|
15 |
+
<title>Instant Search</title>
|
16 |
+
<sort_order>50</sort_order>
|
17 |
+
</instantsearch>
|
18 |
+
|
19 |
+
</children>
|
20 |
+
</config>
|
21 |
+
</children>
|
22 |
+
</system>
|
23 |
+
</children>
|
24 |
+
</admin>
|
25 |
+
</resources>
|
26 |
+
</acl>
|
27 |
+
</config>
|
app/code/local/Magestore/Instantsearch/etc/config.xml
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<default>
|
4 |
+
<instantsearch>
|
5 |
+
<general>
|
6 |
+
<more_product_num>6</more_product_num>
|
7 |
+
<thumb_image_width>80</thumb_image_width>
|
8 |
+
<search_in_name>1</search_in_name>
|
9 |
+
<search_in_tag>1</search_in_tag>
|
10 |
+
<search_in_description>1</search_in_description>
|
11 |
+
<search_description_type>3</search_description_type>
|
12 |
+
</general>
|
13 |
+
</instantsearch>
|
14 |
+
</default>
|
15 |
+
<modules>
|
16 |
+
<Magestore_Instantsearch>
|
17 |
+
<version>0.2.2</version>
|
18 |
+
</Magestore_Instantsearch>
|
19 |
+
</modules>
|
20 |
+
<frontend>
|
21 |
+
<routers>
|
22 |
+
<instantsearch>
|
23 |
+
<use>standard</use>
|
24 |
+
<args>
|
25 |
+
<module>Magestore_Instantsearch</module>
|
26 |
+
<frontName>instantsearch</frontName>
|
27 |
+
</args>
|
28 |
+
</instantsearch>
|
29 |
+
</routers>
|
30 |
+
<layout>
|
31 |
+
<updates>
|
32 |
+
<instantsearch>
|
33 |
+
<file>instantsearch.xml</file>
|
34 |
+
</instantsearch>
|
35 |
+
</updates>
|
36 |
+
</layout>
|
37 |
+
<translate>
|
38 |
+
<modules>
|
39 |
+
<Magestore_Instantsearch>
|
40 |
+
<files>
|
41 |
+
<default>Magestore_Instantsearch.csv</default>
|
42 |
+
</files>
|
43 |
+
</Magestore_Instantsearch>
|
44 |
+
</modules>
|
45 |
+
</translate>
|
46 |
+
</frontend>
|
47 |
+
<admin>
|
48 |
+
<routers>
|
49 |
+
<instantsearch>
|
50 |
+
<use>admin</use>
|
51 |
+
<args>
|
52 |
+
<module>Magestore_Instantsearch</module>
|
53 |
+
<frontName>instantsearch</frontName>
|
54 |
+
</args>
|
55 |
+
</instantsearch>
|
56 |
+
</routers>
|
57 |
+
</admin>
|
58 |
+
<adminhtml>
|
59 |
+
<layout>
|
60 |
+
<updates>
|
61 |
+
<instantsearch>
|
62 |
+
<file>instantsearch.xml</file>
|
63 |
+
</instantsearch>
|
64 |
+
</updates>
|
65 |
+
</layout>
|
66 |
+
<events>
|
67 |
+
<controller_action_predispatch_adminhtml>
|
68 |
+
<observers>
|
69 |
+
<magestore_instantsearch_observer>
|
70 |
+
<type>singleton</type>
|
71 |
+
<class>instantsearch/observer</class>
|
72 |
+
<method>controller_action_predispatch_adminhtml</method>
|
73 |
+
</magestore_instantsearch_observer>
|
74 |
+
</observers>
|
75 |
+
</controller_action_predispatch_adminhtml>
|
76 |
+
</events>
|
77 |
+
</adminhtml>
|
78 |
+
<global>
|
79 |
+
<models>
|
80 |
+
<instantsearch>
|
81 |
+
<class>Magestore_Instantsearch_Model</class>
|
82 |
+
</instantsearch>
|
83 |
+
</models>
|
84 |
+
|
85 |
+
<resources>
|
86 |
+
<instantsearch_write>
|
87 |
+
<connection>
|
88 |
+
<use>core_write</use>
|
89 |
+
</connection>
|
90 |
+
</instantsearch_write>
|
91 |
+
<instantsearch_read>
|
92 |
+
<connection>
|
93 |
+
<use>core_read</use>
|
94 |
+
</connection>
|
95 |
+
</instantsearch_read>
|
96 |
+
</resources>
|
97 |
+
<blocks>
|
98 |
+
<instantsearch>
|
99 |
+
<class>Magestore_Instantsearch_Block</class>
|
100 |
+
</instantsearch>
|
101 |
+
</blocks>
|
102 |
+
<helpers>
|
103 |
+
<instantsearch>
|
104 |
+
<class>Magestore_Instantsearch_Helper</class>
|
105 |
+
</instantsearch>
|
106 |
+
|
107 |
+
<catalogsearch>
|
108 |
+
<rewrite>
|
109 |
+
<data>Magestore_Instantsearch_Helper_Catalogsearch</data>
|
110 |
+
</rewrite>
|
111 |
+
</catalogsearch>
|
112 |
+
</helpers>
|
113 |
+
</global>
|
114 |
+
</config>
|
app/code/local/Magestore/Instantsearch/etc/system.xml
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
<label>instantsearch Configuration</label>
|
1 |
<frontend_type>text</frontend_type>
|
2 |
<sort_order>1</sort_order>
|
3 |
<show_in_default>1</show_in_default>
|
4 |
<show_in_website>1</show_in_website>
|
5 |
<show_in_store>0</show_in_store>
|
6 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
<label>Product Limit</label>
|
8 |
<frontend_type>text</frontend_type>
|
9 |
<sort_order>1</sort_order>
|
10 |
<show_in_default>1</show_in_default>
|
11 |
<show_in_website>1</show_in_website>
|
12 |
<show_in_store>1</show_in_store>
|
13 |
</more_product_num>
|
14 |
<label>Width Of Thumbnail Image</label>
|
15 |
<frontend_type>text</frontend_type>
|
16 |
<sort_order>2</sort_order>
|
17 |
<show_in_default>1</show_in_default>
|
18 |
<show_in_website>1</show_in_website>
|
19 |
<show_in_store>1</show_in_store>
|
20 |
</thumb_image_width>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<magestore translate="label">
|
5 |
+
<label>Magestore Extension</label>
|
6 |
+
<sort_order>400</sort_order>
|
7 |
+
</magestore>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<instantsearch translate="label" module="instantsearch">
|
11 |
+
<class>separator-top</class>
|
12 |
+
<label>Instant Search</label>
|
13 |
+
<tab>magestore</tab>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>300</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>1</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<groups>
|
20 |
<label>instantsearch Configuration</label>
|
21 |
<frontend_type>text</frontend_type>
|
22 |
<sort_order>1</sort_order>
|
23 |
<show_in_default>1</show_in_default>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>0</show_in_store>
|
26 |
<fields>
|
27 |
+
<overwrite_quick_search>
|
28 |
+
<label>Overwrite Quick Search</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>0</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<comment>Overwrite quick search module</comment>
|
36 |
+
</overwrite_quick_search>
|
37 |
<label>Product Limit</label>
|
38 |
<frontend_type>text</frontend_type>
|
39 |
<sort_order>1</sort_order>
|
40 |
<show_in_default>1</show_in_default>
|
41 |
<show_in_website>1</show_in_website>
|
42 |
<show_in_store>1</show_in_store>
|
43 |
</more_product_num>
|
44 |
<label>Width Of Thumbnail Image</label>
|
45 |
<frontend_type>text</frontend_type>
|
46 |
<sort_order>2</sort_order>
|
47 |
<show_in_default>1</show_in_default>
|
48 |
<show_in_website>1</show_in_website>
|
49 |
<show_in_store>1</show_in_store>
|
50 |
</thumb_image_width>
|
51 |
+
|
52 |
+
<search_in_name translate="label">
|
53 |
+
<label>Enable to search in product name</label>
|
54 |
+
<frontend_type>select</frontend_type>
|
55 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
56 |
+
<sort_order>3</sort_order>
|
57 |
+
<show_in_default>1</show_in_default>
|
58 |
+
<show_in_website>1</show_in_website>
|
59 |
+
<show_in_store>1</show_in_store>
|
60 |
+
<comment>Enable to search in product name</comment>
|
61 |
+
</search_in_name>
|
62 |
+
|
63 |
+
<search_in_tag translate="label">
|
64 |
+
<label>Enable to search in product tag</label>
|
65 |
+
<frontend_type>select</frontend_type>
|
66 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
67 |
+
<sort_order>4</sort_order>
|
68 |
+
<show_in_default>1</show_in_default>
|
69 |
+
<show_in_website>1</show_in_website>
|
70 |
+
<show_in_store>1</show_in_store>
|
71 |
+
<comment>Enable to search in product tag</comment>
|
72 |
+
</search_in_tag>
|
73 |
+
|
74 |
+
<search_in_description translate="label">
|
75 |
+
<label>Enable to search in product description</label>
|
76 |
+
<frontend_type>select</frontend_type>
|
77 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
78 |
+
<sort_order>5</sort_order>
|
79 |
+
<show_in_default>1</show_in_default>
|
80 |
+
<show_in_website>1</show_in_website>
|
81 |
+
<show_in_store>1</show_in_store>
|
82 |
+
<comment>Enable to search in product description</comment>
|
83 |
+
</search_in_description>
|
84 |
+
<search_description_type translate="label">
|
85 |
+
<label>Search Description Type</label>
|
86 |
+
<frontend_type>select</frontend_type>
|
87 |
+
<source_model>instantsearch/descriptiontype</source_model>
|
88 |
+
<sort_order>10</sort_order>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
</search_description_type>
|
93 |
+
|
94 |
+
</groups>
|
95 |
+
</instantsearch>
|
96 |
+
</sections>
|
97 |
+
</config>
|
app/design/frontend/default/default/layout/instantsearch.xml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss"><stylesheet>css/magestore/instantsearch.css</stylesheet></action>
|
6 |
+
</reference>
|
7 |
+
<reference name="top.search">
|
8 |
+
<block type="instantsearch/instantsearch" name="instantsearch.top">
|
9 |
+
<action method="setTopSearchTemplate"><template>instantsearch/instantsearch.phtml</template></action>
|
10 |
+
</block>
|
11 |
+
</reference>
|
12 |
+
</default>
|
13 |
+
<instantsearch_index_index>
|
14 |
+
<reference name="root">
|
15 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
16 |
+
</reference>
|
17 |
+
<reference name="content">
|
18 |
+
<block type="instantsearch/instantsearch" name="instantsearch" template="instantsearch/view.phtml" />
|
19 |
+
</reference>
|
20 |
+
</instantsearch_index_index>
|
21 |
+
</layout>
|
app/design/frontend/default/default/template/instantsearch/instantsearch.phtml
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script src="<?php echo $this->getJsUrl().'magestore/instantsearch.js'; ?>" type="text/javascript"></script>
|
2 |
+
<form id="search_mini_form" action="<?php echo $this->helper('catalogsearch')->getResultUrl() ?>" method="get">
|
3 |
+
<div class="form-search">
|
4 |
+
<div id="instantsearch">
|
5 |
+
<label for="search"><?php echo $this->__('Search:') ?></label>
|
6 |
+
<div id="mi_header">
|
7 |
+
<input id="search" type="text" name="<?php echo $this->helper('catalogsearch')->getQueryParamName() ?>" value="<?php echo(Mage::registry('keyword')); ?>" class="input-text" />
|
8 |
+
</div>
|
9 |
+
<button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button>
|
10 |
+
<div id="search_autocomplete" class="search-autocomplete"></div>
|
11 |
+
<script type="text/javascript">
|
12 |
+
//<![CDATA[
|
13 |
+
var searchForm = new Varien.searchForm('search_mini_form', 'search', '');
|
14 |
+
searchForm.initAutocomplete('<?php echo $this->helper('catalogsearch')->getSuggestUrl() ?>', 'search_autocomplete');
|
15 |
+
//]]>
|
16 |
+
</script>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
</form>
|
20 |
+
<div id="showProduct" style="display:none;">
|
21 |
+
<div id="productContainer">
|
22 |
+
<div class="head-notice">
|
23 |
+
<h3 class="title left"><span id="searchTermkeyword">Search Product Instantly</span></h3>
|
24 |
+
<a class="instantsearch-close right" href="javascript:void(0);" onclick="$('showProduct').hide(); return false;">Close</a>
|
25 |
+
</div>
|
26 |
+
<div id="mainProductWapper">
|
27 |
+
<div id="mainProduct">
|
28 |
+
|
29 |
+
</div>
|
30 |
+
</div>
|
31 |
+
<div id="moreProductsWapper">
|
32 |
+
<div id="moreProducts">
|
33 |
+
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
<script type="text/javascript">
|
39 |
+
var instantsearch = new Instantsearch(
|
40 |
+
'<?php echo $this->getUrl('instantsearch/index/search') ?>',
|
41 |
+
'<?php echo $this->getUrl('instantsearch/index/loadproduct') ?>',
|
42 |
+
'<?php echo Mage::getStoreConfig('instantsearch/general/more_product_num') ?>',
|
43 |
+
'search'
|
44 |
+
);
|
45 |
+
|
46 |
+
Event.observe('search', 'keyup', function(event){
|
47 |
+
instantsearch.search();
|
48 |
+
});
|
49 |
+
//instantsearch.search();
|
50 |
+
|
51 |
+
</script>
|
52 |
+
|
53 |
+
|
app/design/frontend/default/default/template/instantsearch/view.phtml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script src="<?php echo $this->getJsUrl().'magestore/viewinstantsearch.js'; ?>" type="text/javascript"></script>
|
2 |
+
<div id="instantsearch">
|
3 |
+
<div id="mi_header">
|
4 |
+
<input type="text" name="searchBox" id="searchBox" value="<?php echo(Mage::registry('keyword')); ?>"><span id="searchTermkeyword">Search Product Instantly</span>
|
5 |
+
</div>
|
6 |
+
<div id="viewProduct">
|
7 |
+
<div id="productContainer">
|
8 |
+
<div id="mainViewProductWapper">
|
9 |
+
<div id="mainViewProduct">
|
10 |
+
|
11 |
+
</div>
|
12 |
+
</div>
|
13 |
+
<div id="moreViewProductsWapper">
|
14 |
+
<div id="moreViewProducts">
|
15 |
+
|
16 |
+
</div>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
|
23 |
+
<script type="text/javascript">
|
24 |
+
var viewInstantsearch = new ViewInstantsearch(
|
25 |
+
'<?php echo $this->getUrl('instantsearch/index/search') ?>',
|
26 |
+
'<?php echo $this->getUrl('instantsearch/index/loadproductview') ?>',
|
27 |
+
'<?php echo Mage::getStoreConfig('instantsearch/general/more_product_num') ?>',
|
28 |
+
'searchBox'
|
29 |
+
);
|
30 |
+
|
31 |
+
Event.observe('searchBox', 'keyup', function(event){
|
32 |
+
viewInstantsearch.search();
|
33 |
+
});
|
34 |
+
|
35 |
+
|
36 |
+
viewInstantsearch.search();
|
37 |
+
|
38 |
+
</script>
|
39 |
+
|
40 |
+
|
app/etc/modules/Magestore_Instantsearch.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Magestore_Instantsearch>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Magestore_Instantsearch>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/magestore/instantsearch.js
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var Instantsearch = Class.create();
|
2 |
+
var Instantsearch = Class.create();
|
3 |
+
var idInput = '';
|
4 |
+
Instantsearch.prototype = {
|
5 |
+
initialize: function(searchUrl,loadProductUrl,maxThumb, idInput){
|
6 |
+
this.idInput = idInput;
|
7 |
+
this.searchUrl = searchUrl;
|
8 |
+
this.loadProductUrl = loadProductUrl;
|
9 |
+
this.onSuccess = this.onSuccess.bindAsEventListener(this);
|
10 |
+
this.onFailure = this.onFailure.bindAsEventListener(this);
|
11 |
+
this.currentSearch = '';
|
12 |
+
this.currentSuggestion = '';
|
13 |
+
this.searchWorking = false;
|
14 |
+
this.loadWorking = false;
|
15 |
+
this.loadPending = false;
|
16 |
+
this.pendingProductId = '';
|
17 |
+
this.pendingMoreProductNum = '';
|
18 |
+
this.searchPending = false;
|
19 |
+
this.moreProductsShowing = false;
|
20 |
+
this.currentMoreProductNum = 0;
|
21 |
+
this.maxThumb = maxThumb;
|
22 |
+
},
|
23 |
+
|
24 |
+
search: function(){
|
25 |
+
this.currentMoreProductNum = 0;
|
26 |
+
if (this.searchWorking) {
|
27 |
+
this.searchPending = true;
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
var searchBox = $(this.idInput);
|
31 |
+
|
32 |
+
if(searchBox.value=='')
|
33 |
+
{
|
34 |
+
this.updateSuggestedKeyword("Search Product Instantly");
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
if ((this.currentSearch!="") &&(searchBox.value == this.currentSearch)) {
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
this.currentSearch = searchBox.value;
|
42 |
+
|
43 |
+
searchBox.className = 'statusLoading input-text';
|
44 |
+
var keyword = searchBox.value;
|
45 |
+
|
46 |
+
url = this.searchUrl;
|
47 |
+
|
48 |
+
var parameters = {keyword: keyword};
|
49 |
+
|
50 |
+
new Ajax.Request(url, {
|
51 |
+
method: 'post',
|
52 |
+
parameters: parameters,
|
53 |
+
onSuccess: this.onSuccess,
|
54 |
+
onFailure: this.onFeailure
|
55 |
+
});
|
56 |
+
|
57 |
+
this.searchWorking = true;
|
58 |
+
},
|
59 |
+
|
60 |
+
onFailure: function(transport){
|
61 |
+
$(this.idInput).className ="";
|
62 |
+
},
|
63 |
+
|
64 |
+
|
65 |
+
onSuccess: function(transport)
|
66 |
+
{
|
67 |
+
var searchBox = $(this.idInput);
|
68 |
+
if (transport && transport.responseText) {
|
69 |
+
try{
|
70 |
+
response = eval('(' + transport.responseText + ')');
|
71 |
+
}
|
72 |
+
catch (e) {
|
73 |
+
response = {};
|
74 |
+
}
|
75 |
+
|
76 |
+
if (response.products) {
|
77 |
+
this.updateSuggestedKeyword("Search Product Instantly");
|
78 |
+
this.updateProductDisplay(response.products);
|
79 |
+
|
80 |
+
searchBox.className = 'statusPlaying input-text';
|
81 |
+
}
|
82 |
+
else
|
83 |
+
{
|
84 |
+
this.updateSuggestedKeyword('No results for "'+this.currentSearch+'"');
|
85 |
+
searchBox.className ="input-text";
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
this.doneWorking();
|
90 |
+
},
|
91 |
+
|
92 |
+
updateProductDisplay: function(products) {
|
93 |
+
var showProduct = $('showProduct');
|
94 |
+
showProduct.style.display = "block";
|
95 |
+
var numThumbs = (products.length >= this.maxThumb) ? this.maxThumb : products.length;
|
96 |
+
|
97 |
+
var moreProducts = new Element('div', { 'id': 'moreProducts'});
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
for (var i = 0; i < numThumbs; i++) {
|
102 |
+
var productId = products[i].id;
|
103 |
+
// Load the other videos' thumbnails
|
104 |
+
|
105 |
+
var img = new Element('img', { "src": products[i].image, "id":"product"+(i+1)});
|
106 |
+
var a = new Element('a', {"title":products[i].name, "href": "javascript:instantsearch.loadProductDetail('"+productId+"', "+(i+1)+")" });
|
107 |
+
|
108 |
+
a.appendChild(img);
|
109 |
+
moreProducts.appendChild(a);
|
110 |
+
}
|
111 |
+
var moreProductsWrapper = $('moreProductsWapper');
|
112 |
+
|
113 |
+
$('moreProducts').remove();
|
114 |
+
moreProductsWrapper.appendChild(moreProducts);
|
115 |
+
|
116 |
+
if (!this.moreProductsShowing) {
|
117 |
+
|
118 |
+
this.moreProductsShowing = true;
|
119 |
+
}
|
120 |
+
|
121 |
+
this.loadProductDetail(products[0].id,1);
|
122 |
+
},
|
123 |
+
|
124 |
+
doneWorking: function() {
|
125 |
+
this.searchWorking = false;
|
126 |
+
|
127 |
+
if (this.searchPending) {
|
128 |
+
// another search happened while we were processing this one, so we need to take care of it.
|
129 |
+
this.searchPending = false;
|
130 |
+
this.search();
|
131 |
+
}
|
132 |
+
},
|
133 |
+
|
134 |
+
doneLoadingProduct: function() {
|
135 |
+
|
136 |
+
this.loadWorking = false;
|
137 |
+
|
138 |
+
if (this.loadPending) {
|
139 |
+
this.loadPending = false;
|
140 |
+
this.loadProductDetail(this.pendingProductId,this.pendingMoreProductNum);
|
141 |
+
}
|
142 |
+
|
143 |
+
},
|
144 |
+
|
145 |
+
updateSuggestedKeyword: function(message)
|
146 |
+
{
|
147 |
+
$("searchTermkeyword").update(message);
|
148 |
+
},
|
149 |
+
|
150 |
+
|
151 |
+
loadProductDetail: function(productId,moreProductNum){
|
152 |
+
if (this.loadWorking) {
|
153 |
+
this.loadPending = true;
|
154 |
+
this.pendingProductId = productId;
|
155 |
+
this.pendingMoreProductNum = moreProductNum;
|
156 |
+
return;
|
157 |
+
}
|
158 |
+
|
159 |
+
if (this.currentMoreProductNum == moreProductNum) {
|
160 |
+
return;
|
161 |
+
}
|
162 |
+
|
163 |
+
var currentMoreProductNum = this.currentMoreProductNum;
|
164 |
+
|
165 |
+
if(currentMoreProductNum)
|
166 |
+
{
|
167 |
+
$("product" + currentMoreProductNum).className = "";
|
168 |
+
}
|
169 |
+
$("product" + moreProductNum).className = "active";
|
170 |
+
|
171 |
+
this.currentMoreProductNum = moreProductNum;
|
172 |
+
|
173 |
+
|
174 |
+
var url = this.loadProductUrl+"id/" + productId;
|
175 |
+
$("mainProduct").className = "productLoading";
|
176 |
+
new Ajax.Updater("mainProductWapper", url, {method: 'get', onFailure: "",onComplete:this.doneLoadingProduct.bindAsEventListener(this)});
|
177 |
+
this.loadWorking = true;
|
178 |
+
}
|
179 |
+
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
|
js/magestore/viewinstantsearch.js
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var ViewInstantsearch = Class.create();
|
2 |
+
var ViewInstantsearch = Class.create();
|
3 |
+
var idInput = '';
|
4 |
+
ViewInstantsearch.prototype = {
|
5 |
+
initialize: function(searchUrl,loadProductUrl,maxThumb, idInput){
|
6 |
+
this.idInput = idInput;
|
7 |
+
this.searchUrl = searchUrl;
|
8 |
+
this.loadProductUrl = loadProductUrl;
|
9 |
+
this.onSuccess = this.onSuccess.bindAsEventListener(this);
|
10 |
+
this.onFailure = this.onFailure.bindAsEventListener(this);
|
11 |
+
this.currentSearch = '';
|
12 |
+
this.currentSuggestion = '';
|
13 |
+
this.searchWorking = false;
|
14 |
+
this.loadWorking = false;
|
15 |
+
this.loadPending = false;
|
16 |
+
this.pendingProductId = '';
|
17 |
+
this.pendingMoreProductNum = '';
|
18 |
+
this.searchPending = false;
|
19 |
+
this.moreProductsShowing = false;
|
20 |
+
this.currentMoreProductNum = 0;
|
21 |
+
this.maxThumb = maxThumb;
|
22 |
+
},
|
23 |
+
|
24 |
+
search: function(){
|
25 |
+
this.currentMoreProductNum = 0;
|
26 |
+
if (this.searchWorking) {
|
27 |
+
this.searchPending = true;
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
var searchBox = $(this.idInput);
|
31 |
+
|
32 |
+
if(searchBox.value=='')
|
33 |
+
{
|
34 |
+
this.updateSuggestedKeyword("Search Product Instantly");
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
if ((this.currentSearch!="") &&(searchBox.value == this.currentSearch)) {
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
this.currentSearch = searchBox.value;
|
42 |
+
|
43 |
+
searchBox.className = 'statusLoading input-text';
|
44 |
+
var keyword = searchBox.value;
|
45 |
+
|
46 |
+
url = this.searchUrl;
|
47 |
+
|
48 |
+
var parameters = {keyword: keyword};
|
49 |
+
|
50 |
+
new Ajax.Request(url, {
|
51 |
+
method: 'post',
|
52 |
+
parameters: parameters,
|
53 |
+
onSuccess: this.onSuccess,
|
54 |
+
onFailure: this.onFeailure
|
55 |
+
});
|
56 |
+
|
57 |
+
this.searchWorking = true;
|
58 |
+
},
|
59 |
+
|
60 |
+
onFailure: function(transport){
|
61 |
+
$(this.idInput).className ="";
|
62 |
+
},
|
63 |
+
|
64 |
+
|
65 |
+
onSuccess: function(transport)
|
66 |
+
{
|
67 |
+
var searchBox = $(this.idInput);
|
68 |
+
if (transport && transport.responseText) {
|
69 |
+
try{
|
70 |
+
response = eval('(' + transport.responseText + ')');
|
71 |
+
}
|
72 |
+
catch (e) {
|
73 |
+
response = {};
|
74 |
+
}
|
75 |
+
|
76 |
+
if (response.products) {
|
77 |
+
this.updateSuggestedKeyword("Search Product Instantly");
|
78 |
+
this.updateProductDisplay(response.products);
|
79 |
+
|
80 |
+
searchBox.className = 'statusPlaying input-text';
|
81 |
+
}
|
82 |
+
else
|
83 |
+
{
|
84 |
+
this.updateSuggestedKeyword('No results for "'+this.currentSearch+'"');
|
85 |
+
searchBox.className ="input-text";
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
this.doneWorking();
|
90 |
+
},
|
91 |
+
|
92 |
+
updateProductDisplay: function(products) {
|
93 |
+
var numThumbs = (products.length >= this.maxThumb) ? this.maxThumb : products.length;
|
94 |
+
|
95 |
+
var moreProducts = new Element('div', { 'id': 'moreViewProducts'});
|
96 |
+
|
97 |
+
|
98 |
+
|
99 |
+
for (var i = 0; i < numThumbs; i++) {
|
100 |
+
var productId = products[i].id;
|
101 |
+
// Load the other videos' thumbnails
|
102 |
+
|
103 |
+
var img = new Element('img', { "src": products[i].image, "id":"product"+(i+1)});
|
104 |
+
var a = new Element('a', {"title":products[i].name, "href": "javascript:instantsearch.loadProductDetail('"+productId+"', "+(i+1)+")" });
|
105 |
+
|
106 |
+
a.appendChild(img);
|
107 |
+
moreProducts.appendChild(a);
|
108 |
+
}
|
109 |
+
var moreProductsWrapper = $('moreViewProductsWapper');
|
110 |
+
|
111 |
+
$('moreViewProducts').remove();
|
112 |
+
moreProductsWrapper.appendChild(moreProducts);
|
113 |
+
|
114 |
+
if (!this.moreProductsShowing) {
|
115 |
+
|
116 |
+
this.moreProductsShowing = true;
|
117 |
+
}
|
118 |
+
|
119 |
+
this.loadProductDetail(products[0].id,1);
|
120 |
+
},
|
121 |
+
|
122 |
+
doneWorking: function() {
|
123 |
+
this.searchWorking = false;
|
124 |
+
|
125 |
+
if (this.searchPending) {
|
126 |
+
// another search happened while we were processing this one, so we need to take care of it.
|
127 |
+
this.searchPending = false;
|
128 |
+
this.search();
|
129 |
+
}
|
130 |
+
},
|
131 |
+
|
132 |
+
doneLoadingProduct: function() {
|
133 |
+
|
134 |
+
this.loadWorking = false;
|
135 |
+
|
136 |
+
if (this.loadPending) {
|
137 |
+
this.loadPending = false;
|
138 |
+
this.loadProductDetail(this.pendingProductId,this.pendingMoreProductNum);
|
139 |
+
}
|
140 |
+
|
141 |
+
},
|
142 |
+
|
143 |
+
updateSuggestedKeyword: function(message)
|
144 |
+
{
|
145 |
+
$("searchTermkeyword").update(message);
|
146 |
+
},
|
147 |
+
|
148 |
+
|
149 |
+
loadProductDetail: function(productId,moreProductNum){
|
150 |
+
if (this.loadWorking) {
|
151 |
+
this.loadPending = true;
|
152 |
+
this.pendingProductId = productId;
|
153 |
+
this.pendingMoreProductNum = moreProductNum;
|
154 |
+
return;
|
155 |
+
}
|
156 |
+
|
157 |
+
if (this.currentMoreProductNum == moreProductNum) {
|
158 |
+
return;
|
159 |
+
}
|
160 |
+
|
161 |
+
var currentMoreProductNum = this.currentMoreProductNum;
|
162 |
+
|
163 |
+
if(currentMoreProductNum)
|
164 |
+
{
|
165 |
+
$("product" + currentMoreProductNum).className = "";
|
166 |
+
}
|
167 |
+
$("product" + moreProductNum).className = "active";
|
168 |
+
|
169 |
+
this.currentMoreProductNum = moreProductNum;
|
170 |
+
|
171 |
+
|
172 |
+
var url = this.loadProductUrl+"id/" + productId;
|
173 |
+
$("mainViewProduct").className = "productLoading";
|
174 |
+
new Ajax.Updater("mainViewProductWapper", url, {method: 'get', onFailure: "",onComplete:this.doneLoadingProduct.bindAsEventListener(this)});
|
175 |
+
this.loadWorking = true;
|
176 |
+
}
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ProductInstantSearch</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
|
7 |
<channel>community</channel>
|
@@ -9,10 +9,10 @@
|
|
9 |
<summary>Instant_search</summary>
|
10 |
<description>Instant_search</description>
|
11 |
<notes>Instant_search</notes>
|
12 |
-
<authors><author><name>magestore</name><user>
|
13 |
<date>2012-07-14</date>
|
14 |
-
<time>02:
|
15 |
-
<contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="instantsearch.xml" hash=""/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magestore_Instantsearch.xml" hash=""/></dir></target><target name="mage"><dir name="js"><dir name="magestore"><file name="instantsearch.js" hash=""/><file name="viewinstantsearch.js" hash=""/></dir><dir name="tinybox"><file name="tinybox.js" hash="2ca7fcb7fefc5e8d85887f3c6dc6e315"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="tinybox"><dir name="images"><file name="Thumbs.db" hash="11fb2793c09da50437dcdfe0c4bd6333"/><file name="preload.gif" hash="bf3ec68db23e93ba2ec795ef558e96da"/><file name="rhino.jpg" hash="d00bad1ec05584e10a5601ec103aff72"/></dir><file name="style.css" hash="e3016ee232fbf3c6f780255002703237"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="magestore"><file name="instantsearch.css" hash=""/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
-
<dependencies
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ProductInstantSearch</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
|
7 |
<channel>community</channel>
|
9 |
<summary>Instant_search</summary>
|
10 |
<description>Instant_search</description>
|
11 |
<notes>Instant_search</notes>
|
12 |
+
<authors><author><name>magestore</name><user>auto-converted</user><email>info@magestore.com</email></author></authors>
|
13 |
<date>2012-07-14</date>
|
14 |
+
<time>02:15:13</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Magestore"><dir name="Instantsearch"><dir name="Block"><file name="Instantsearch.php" hash="355dcc5d2ec8effcac612c9ba514b53a"/></dir><dir name="Helper"><file name="Catalogsearch.php" hash="b1fcd69b8e9e465d07edc9aed796697e"/><file name="Data.php" hash="dc25cef25d343f2f6d090ef46573d4f9"/></dir><dir name="Model"><file name="Descriptiontype.php" hash="1b5e6dfbfa8f8c9f79b76257a9f7d48a"/><file name="Observer.php" hash="68aa6dec3596f27ff18b1e7bba4ce1c7"/></dir><dir name="controllers"><file name="IndexController.php" hash="e5e4e4eb18f7789208a0c5bb607a938e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3c6438f5dcd2fab19c479596515e97b7"/><file name="config.xml" hash="c1d9951249359329dccc25d4424de5c1"/><file name="system.xml" hash="c65e223eda6115ea941496914b8e0ef2"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="instantsearch.xml" hash="e3018e890043a20602d5fdf8398858db"/></dir><dir name="template"><dir name="instantsearch"><file name="instantsearch.phtml" hash="97415b1bb8986842c80ce0ed41c8e57e"/><file name="view.phtml" hash="9e75721eb5b1f9d4d5e834df5dd3a0f5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magestore_Instantsearch.xml" hash="fa29090e466dd75a516a5f62bc726281"/></dir></target><target name="mage"><dir name="js"><dir name="magestore"><file name="instantsearch.js" hash="b7302ba745ff3b3bd2e909ca2421ef33"/><file name="viewinstantsearch.js" hash="8389b3c2b9259ca38d6daff2bdb5f04f"/></dir><dir name="tinybox"><file name="tinybox.js" hash="2ca7fcb7fefc5e8d85887f3c6dc6e315"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="tinybox"><dir name="images"><file name="Thumbs.db" hash="11fb2793c09da50437dcdfe0c4bd6333"/><file name="preload.gif" hash="bf3ec68db23e93ba2ec795ef558e96da"/><file name="rhino.jpg" hash="d00bad1ec05584e10a5601ec103aff72"/></dir><file name="style.css" hash="e3016ee232fbf3c6f780255002703237"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="magestore"><file name="instantsearch.css" hash="c3a45447088a63673e53ae801f6ebf2f"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
</package>
|
skin/frontend/base/default/css/magestore/instantsearch.css
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#instantsearch #mi_header #searchBox
|
2 |
+
{
|
3 |
+
margin-right:15px;
|
4 |
+
padding-right:5px;
|
5 |
+
width:209px;
|
6 |
+
}
|
7 |
+
#showProduct{position:absolute;overflow:hidden;padding:5px;background:#ffffff;}
|
8 |
+
#viewProduct{overflow:hidden;padding:5px;background:#ffffff;margin-top:5px;}
|
9 |
+
#showProduct #productContainer{overflow:hidden;background:#ffffff;padding:6px;}
|
10 |
+
#viewProduct #productContainer{overflow:hidden;background:#ffffff;padding:6px;}
|
11 |
+
#showProduct .head-notice{float:left;overflow:hiddent;width:100%;}
|
12 |
+
#searchTermkeyword {
|
13 |
+
font-size:16px;
|
14 |
+
}
|
15 |
+
|
16 |
+
.statusLoading {
|
17 |
+
background: #FFFFFF url('../../images/magestore/instantsearch/loading.gif') no-repeat 195px 50%!important;
|
18 |
+
}
|
19 |
+
.statusPlaying {
|
20 |
+
background: #FFFFFF url('../../images/magestore/instantsearch/playing.gif') no-repeat 195px 50%!important;
|
21 |
+
}
|
22 |
+
|
23 |
+
#moreProducts{text-align:left;}
|
24 |
+
|
25 |
+
#moreProducts img, #moreViewProducts img {
|
26 |
+
border:4px solid #FFFFFF;
|
27 |
+
margin:5px 15px 0 0;
|
28 |
+
vertical-align:top;
|
29 |
+
}
|
30 |
+
|
31 |
+
#moreProductsWapper ,#moreViewProductsWapper{
|
32 |
+
|
33 |
+
margin:6px 0 0;
|
34 |
+
position:relative;
|
35 |
+
vertical-align:top;
|
36 |
+
}
|
37 |
+
#mainProductWapper,#mainViewProductWapper{
|
38 |
+
height:300px;
|
39 |
+
border:1px solid #CCCCCC;
|
40 |
+
margin:10px 0;
|
41 |
+
overflow: hidden;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
#moreProducts img.active,#moreViewProducts img.active
|
47 |
+
{
|
48 |
+
border:4px solid #E0E0E0;
|
49 |
+
}
|
50 |
+
.productLoading
|
51 |
+
{
|
52 |
+
background:url('../../images/magestore/instantsearch/loading.gif') no-repeat 50% 50%;
|
53 |
+
}
|
54 |
+
|
55 |
+
#mainProduct,#mainViewProduct
|
56 |
+
{
|
57 |
+
height:280px;
|
58 |
+
width:600px;
|
59 |
+
margin:10px;
|
60 |
+
}
|
61 |
+
|
62 |
+
#mainProduct #product_img_box, #mainViewProduct #product_img_box
|
63 |
+
{
|
64 |
+
width:250px;
|
65 |
+
float:left;
|
66 |
+
}
|
67 |
+
#mainProduct #product_img_box img,#mainViewProduct #product_img_box img{float:left;}
|
68 |
+
#mainProduct #product_information,#mainViewProduct #product_information
|
69 |
+
{
|
70 |
+
width:320px;
|
71 |
+
float:right;
|
72 |
+
text-align: left;
|
73 |
+
}
|
74 |
+
|
75 |
+
#mainProduct #product_information .product_price, #mainViewProduct #product_information .product_price
|
76 |
+
{
|
77 |
+
color:red;
|
78 |
+
font-weight:bold;
|
79 |
+
width:120px;
|
80 |
+
float:left;
|
81 |
+
}
|
82 |
+
#mainProduct #product_information #description, #mainViewProduct #product_information #description
|
83 |
+
{
|
84 |
+
clear:both;
|
85 |
+
margin-top:20px;
|
86 |
+
border-top:1px dashed #CCCCCC;
|
87 |
+
}
|