Version Notes
[+] Maximal thumbnail size is now 70×70 pixels with the original aspect ratio preserved. For example, for a 360x535 image a 47x70 thumbnail will be generated.
[+] Catalog resync is performed automatically on image cache flushing.
Download this release
Release Info
| Developer | Simbirsk Technologies, Ltd. |
| Extension | Simtech_Searchanise |
| Version | 1.0.8 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.7 to 1.0.8
- app/code/community/Simtech/Searchanise/Block/Jsinit.php +8 -0
- app/code/community/Simtech/Searchanise/Helper/ApiSe.php +95 -85
- app/code/community/Simtech/Searchanise/Helper/ApiXML.php +61 -21
- app/code/community/Simtech/Searchanise/Model/LayerCatalogSearch.php +1 -1
- app/code/community/Simtech/Searchanise/Model/Observer.php +18 -1
- app/code/community/Simtech/Searchanise/controllers/AsyncController.php +1 -0
- app/code/community/Simtech/Searchanise/controllers/InfoController.php +8 -1
- app/code/community/Simtech/Searchanise/etc/config.xml +11 -1
- package.xml +6 -7
app/code/community/Simtech/Searchanise/Block/Jsinit.php
CHANGED
|
@@ -106,6 +106,14 @@ class Simtech_Searchanise_Block_Jsinit extends Mage_Core_Block_Text
|
|
| 106 |
// }
|
| 107 |
// </style>';
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
return $html;
|
| 110 |
}
|
| 111 |
}
|
| 106 |
// }
|
| 107 |
// </style>';
|
| 108 |
|
| 109 |
+
// Uncomment the lines below if it is necessary to fix size images in widget
|
| 110 |
+
// $html .= '
|
| 111 |
+
// <style type="text/css">
|
| 112 |
+
// .snize-item-image {
|
| 113 |
+
// max-width: 70px !important;
|
| 114 |
+
// }
|
| 115 |
+
// </style>';
|
| 116 |
+
|
| 117 |
return $html;
|
| 118 |
}
|
| 119 |
}
|
app/code/community/Simtech/Searchanise/Helper/ApiSe.php
CHANGED
|
@@ -15,7 +15,8 @@ class Simtech_Searchanise_Helper_ApiSe
|
|
| 15 |
{
|
| 16 |
const COMPRESS_RATE = 5;
|
| 17 |
|
| 18 |
-
const PLATFORM_NAME
|
|
|
|
| 19 |
|
| 20 |
const CONFIG_PREFIX = 'se_';
|
| 21 |
|
|
@@ -38,7 +39,8 @@ class Simtech_Searchanise_Helper_ApiSe
|
|
| 38 |
const EXPORT_STATUS_NONE = 'none';
|
| 39 |
|
| 40 |
const STATUS_NORMAL = 'normal';
|
| 41 |
-
|
|
|
|
| 42 |
public static $exportStatusTypes = array(
|
| 43 |
self::EXPORT_STATUS_QUEUED,
|
| 44 |
self::EXPORT_STATUS_START,
|
|
@@ -713,6 +715,7 @@ class Simtech_Searchanise_Helper_ApiSe
|
|
| 713 |
if (!self::checkParentPrivateKey()) {
|
| 714 |
return;
|
| 715 |
}
|
|
|
|
| 716 |
|
| 717 |
Mage::getModel('searchanise/queue')->addAction(Simtech_Searchanise_Model_Queue::ACT_PREPARE_FULL_IMPORT, NULL, $curStore);
|
| 718 |
|
|
@@ -938,7 +941,6 @@ class Simtech_Searchanise_Helper_ApiSe
|
|
| 938 |
@ignore_user_abort(true);
|
| 939 |
@set_time_limit(0);
|
| 940 |
|
| 941 |
-
self::setNotificationAsyncComleted(false);
|
| 942 |
if (self::checkAutoInstall()) {
|
| 943 |
self::setAutoInstall(true);
|
| 944 |
}
|
|
@@ -954,92 +956,97 @@ class Simtech_Searchanise_Helper_ApiSe
|
|
| 954 |
}
|
| 955 |
}
|
| 956 |
|
| 957 |
-
$
|
| 958 |
-
|
| 959 |
-
|
| 960 |
-
|
| 961 |
-
|
| 962 |
-
|
| 963 |
-
|
| 964 |
-
$
|
|
|
|
| 965 |
|
| 966 |
-
|
| 967 |
-
|
| 968 |
-
|
| 969 |
-
|
| 970 |
-
|
| 971 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 972 |
}
|
|
|
|
|
|
|
| 973 |
}
|
| 974 |
|
| 975 |
-
|
| 976 |
-
|
| 977 |
-
|
| 978 |
-
|
| 979 |
-
self::echoConnectProgress('Connecting to Searchanise..');
|
| 980 |
-
$isShowed = true;
|
| 981 |
-
}
|
| 982 |
-
|
| 983 |
-
$url = $store->getUrl('', array('_nosid' => true));
|
| 984 |
-
|
| 985 |
-
// need if new store without baseUrl
|
| 986 |
-
if (!(strstr($url, "http"))) {
|
| 987 |
-
$base_url = Mage::app()->getStore()->getBaseUrl();
|
| 988 |
|
| 989 |
-
$url =
|
| 990 |
-
}
|
| 991 |
-
|
| 992 |
-
list($h, $res) = self::httpRequest(
|
| 993 |
-
Zend_Http_Client::POST,
|
| 994 |
-
self::getServiceUrl() . '/api/signup',
|
| 995 |
-
array(
|
| 996 |
-
'url' => $url,
|
| 997 |
-
'email' => $email,
|
| 998 |
-
'version' => self::getVersion(),
|
| 999 |
-
'platform' => self::PLATFORM_NAME,
|
| 1000 |
-
'parent_private_key' => $parentPrivateKey,
|
| 1001 |
-
),
|
| 1002 |
-
array(),
|
| 1003 |
-
array(),
|
| 1004 |
-
self::getRequestTimeout()
|
| 1005 |
-
);
|
| 1006 |
-
|
| 1007 |
-
if ($showNotification == true) {
|
| 1008 |
-
self::echoConnectProgress('.');
|
| 1009 |
-
}
|
| 1010 |
-
|
| 1011 |
-
if (!empty($res)) {
|
| 1012 |
-
$res = self::parseResponse($res, true);
|
| 1013 |
|
| 1014 |
-
if
|
| 1015 |
-
|
| 1016 |
-
$
|
| 1017 |
-
|
| 1018 |
-
if (empty($api_key) || empty($privateKey)) {
|
| 1019 |
-
return false;
|
| 1020 |
-
}
|
| 1021 |
-
|
| 1022 |
-
if (empty($parentPrivateKey)) {
|
| 1023 |
-
self::setParentPrivateKey($privateKey);
|
| 1024 |
-
$parentPrivateKey = $privateKey;
|
| 1025 |
-
}
|
| 1026 |
-
|
| 1027 |
-
self::setApiKey($api_key, $store);
|
| 1028 |
-
self::setPrivateKey($privateKey, $store);
|
| 1029 |
|
| 1030 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1031 |
|
| 1032 |
-
|
| 1033 |
-
|
| 1034 |
-
|
| 1035 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1036 |
|
| 1037 |
-
|
|
|
|
| 1038 |
}
|
|
|
|
|
|
|
|
|
|
| 1039 |
}
|
| 1040 |
-
|
| 1041 |
-
self::setExportStatus(self::EXPORT_STATUS_NONE, $store);
|
| 1042 |
-
self::setUseNavigation(true);
|
| 1043 |
}
|
| 1044 |
|
| 1045 |
if ($connected == true && $showNotification == true) {
|
|
@@ -1601,13 +1608,16 @@ class Simtech_Searchanise_Helper_ApiSe
|
|
| 1601 |
|
| 1602 |
$variables = self::parseStateResponse($xml);
|
| 1603 |
|
| 1604 |
-
if ((!empty($variables)) &&
|
| 1605 |
-
(
|
| 1606 |
-
|
| 1607 |
-
|
| 1608 |
-
|
| 1609 |
-
|
| 1610 |
-
|
|
|
|
|
|
|
|
|
|
| 1611 |
}
|
| 1612 |
}
|
| 1613 |
if (self::getExportStatus($store) != self::EXPORT_STATUS_DONE) {
|
| 15 |
{
|
| 16 |
const COMPRESS_RATE = 5;
|
| 17 |
|
| 18 |
+
const PLATFORM_NAME = 'magento';
|
| 19 |
+
const PLATFORM_VERSION = '1.2';
|
| 20 |
|
| 21 |
const CONFIG_PREFIX = 'se_';
|
| 22 |
|
| 39 |
const EXPORT_STATUS_NONE = 'none';
|
| 40 |
|
| 41 |
const STATUS_NORMAL = 'normal';
|
| 42 |
+
const STATUS_DISABLED = 'disabled';
|
| 43 |
+
|
| 44 |
public static $exportStatusTypes = array(
|
| 45 |
self::EXPORT_STATUS_QUEUED,
|
| 46 |
self::EXPORT_STATUS_START,
|
| 715 |
if (!self::checkParentPrivateKey()) {
|
| 716 |
return;
|
| 717 |
}
|
| 718 |
+
self::setNotificationAsyncComleted(false);
|
| 719 |
|
| 720 |
Mage::getModel('searchanise/queue')->addAction(Simtech_Searchanise_Model_Queue::ACT_PREPARE_FULL_IMPORT, NULL, $curStore);
|
| 721 |
|
| 941 |
@ignore_user_abort(true);
|
| 942 |
@set_time_limit(0);
|
| 943 |
|
|
|
|
| 944 |
if (self::checkAutoInstall()) {
|
| 945 |
self::setAutoInstall(true);
|
| 946 |
}
|
| 956 |
}
|
| 957 |
}
|
| 958 |
|
| 959 |
+
$adminSession = Mage::getSingleton('admin/session');
|
| 960 |
+
$email = '';
|
| 961 |
+
if ($adminSession) {
|
| 962 |
+
$email = $adminSession->getUser()->getEmail();
|
| 963 |
+
}
|
| 964 |
+
|
| 965 |
+
if ($email != '') {
|
| 966 |
+
$stores = self::getStores($curStore);
|
| 967 |
+
$parentPrivateKey = self::getParentPrivateKey();
|
| 968 |
|
| 969 |
+
foreach ($stores as $store) {
|
| 970 |
+
$privateKey = self::getPrivateKey($store);
|
| 971 |
+
|
| 972 |
+
if (!empty($privateKey)) {
|
| 973 |
+
if ($flSendRequest) {
|
| 974 |
+
if ($store->getIsActive()) {
|
| 975 |
+
self::sendAddonStatusRequest('enabled', $store);
|
| 976 |
+
} else {
|
| 977 |
+
self::sendAddonStatusRequest('disabled', $store);
|
| 978 |
+
}
|
| 979 |
}
|
| 980 |
+
|
| 981 |
+
continue;
|
| 982 |
}
|
| 983 |
|
| 984 |
+
if ($showNotification == true && empty($isShowed)) {
|
| 985 |
+
self::echoConnectProgress('Connecting to Searchanise..');
|
| 986 |
+
$isShowed = true;
|
| 987 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 988 |
|
| 989 |
+
$url = $store->getUrl('', array('_nosid' => true));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 990 |
|
| 991 |
+
// need if new store without baseUrl
|
| 992 |
+
if (!(strstr($url, "http"))) {
|
| 993 |
+
$base_url = Mage::app()->getStore()->getBaseUrl();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 994 |
|
| 995 |
+
$url = str_replace('index.php/', $base_url, $url);
|
| 996 |
+
}
|
| 997 |
+
|
| 998 |
+
list($h, $res) = self::httpRequest(
|
| 999 |
+
Zend_Http_Client::POST,
|
| 1000 |
+
self::getServiceUrl() . '/api/signup',
|
| 1001 |
+
array(
|
| 1002 |
+
'url' => $url,
|
| 1003 |
+
'email' => $email,
|
| 1004 |
+
'version' => self::PLATFORM_VERSION,
|
| 1005 |
+
'platform' => self::PLATFORM_NAME,
|
| 1006 |
+
'parent_private_key' => $parentPrivateKey,
|
| 1007 |
+
),
|
| 1008 |
+
array(),
|
| 1009 |
+
array(),
|
| 1010 |
+
self::getRequestTimeout()
|
| 1011 |
+
);
|
| 1012 |
+
|
| 1013 |
+
if ($showNotification == true) {
|
| 1014 |
+
self::echoConnectProgress('.');
|
| 1015 |
+
}
|
| 1016 |
+
|
| 1017 |
+
if (!empty($res)) {
|
| 1018 |
+
$res = self::parseResponse($res, true);
|
| 1019 |
|
| 1020 |
+
if (is_object($res)) {
|
| 1021 |
+
$api_key = (string)$res->api;
|
| 1022 |
+
$privateKey = (string)$res->private;
|
| 1023 |
+
|
| 1024 |
+
if (empty($api_key) || empty($privateKey)) {
|
| 1025 |
+
return false;
|
| 1026 |
+
}
|
| 1027 |
+
|
| 1028 |
+
if (empty($parentPrivateKey)) {
|
| 1029 |
+
self::setParentPrivateKey($privateKey);
|
| 1030 |
+
$parentPrivateKey = $privateKey;
|
| 1031 |
+
}
|
| 1032 |
+
|
| 1033 |
+
self::setApiKey($api_key, $store);
|
| 1034 |
+
self::setPrivateKey($privateKey, $store);
|
| 1035 |
+
|
| 1036 |
+
$connected = true;
|
| 1037 |
+
|
| 1038 |
+
} else {
|
| 1039 |
+
if ($showNotification == true) {
|
| 1040 |
+
self::echoConnectProgress(' Error<br />');
|
| 1041 |
+
}
|
| 1042 |
|
| 1043 |
+
break;
|
| 1044 |
+
}
|
| 1045 |
}
|
| 1046 |
+
|
| 1047 |
+
self::setExportStatus(self::EXPORT_STATUS_NONE, $store);
|
| 1048 |
+
self::setUseNavigation(true);
|
| 1049 |
}
|
|
|
|
|
|
|
|
|
|
| 1050 |
}
|
| 1051 |
|
| 1052 |
if ($connected == true && $showNotification == true) {
|
| 1608 |
|
| 1609 |
$variables = self::parseStateResponse($xml);
|
| 1610 |
|
| 1611 |
+
if ((!empty($variables)) && (isset($variables['status']))) {
|
| 1612 |
+
if (($variables['status'] == self::STATUS_NORMAL) &&
|
| 1613 |
+
(isset($variables['full_import'])) &&
|
| 1614 |
+
($variables['full_import'] == self::EXPORT_STATUS_DONE)) {
|
| 1615 |
+
$skipTimeCheck = true;
|
| 1616 |
+
self::setExportStatus(self::EXPORT_STATUS_DONE, $store);
|
| 1617 |
+
|
| 1618 |
+
} elseif ($variables['status'] == self::STATUS_DISABLED) {
|
| 1619 |
+
self::setExportStatus(self::EXPORT_STATUS_NONE, $store);
|
| 1620 |
+
}
|
| 1621 |
}
|
| 1622 |
}
|
| 1623 |
if (self::getExportStatus($store) != self::EXPORT_STATUS_DONE) {
|
app/code/community/Simtech/Searchanise/Helper/ApiXML.php
CHANGED
|
@@ -45,6 +45,63 @@ class Simtech_Searchanise_Helper_ApiXML extends Mage_Core_Helper_Data
|
|
| 45 |
->addProductFilter($product->getId())
|
| 46 |
->load();
|
| 47 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
public static function generateProductXML($product, $store = null)
|
| 50 |
{
|
|
@@ -145,27 +202,10 @@ class Simtech_Searchanise_Helper_ApiXML extends Mage_Core_Helper_Data
|
|
| 145 |
|
| 146 |
// <image_link>
|
| 147 |
{
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
$
|
| 151 |
-
|
| 152 |
-
if (!empty($image) && $image != 'no_selection') {
|
| 153 |
-
$imageLink = $product->getImageUrl();
|
| 154 |
-
|
| 155 |
-
} else {
|
| 156 |
-
$smallImage = $product->getData('small_image');
|
| 157 |
-
|
| 158 |
-
if (!empty($smallImage) && $smallImage != 'no_selection') {
|
| 159 |
-
$imageLink = $product->getSmallImageUrl();
|
| 160 |
-
|
| 161 |
-
} else {
|
| 162 |
-
$thumbnail = $product->getData('thumbnail');
|
| 163 |
-
|
| 164 |
-
if (!empty($thumbnail) && $thumbnail != 'no_selection') {
|
| 165 |
-
$imageLink = $product->getThumbnailUrl();
|
| 166 |
-
}
|
| 167 |
-
}
|
| 168 |
-
}
|
| 169 |
|
| 170 |
if ($imageLink != '') {
|
| 171 |
$entry .= '<cs:image_link><![CDATA[' . $imageLink . ']]></cs:image_link>' . self::XML_END_LINE;
|
| 45 |
->addProductFilter($product->getId())
|
| 46 |
->load();
|
| 47 |
}
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* getProductImageLink
|
| 51 |
+
*
|
| 52 |
+
* @param Mage_Catalog_Model_Product $product
|
| 53 |
+
* @param bool $flagKeepFrame
|
| 54 |
+
* @param int $width
|
| 55 |
+
* @param int $height
|
| 56 |
+
* @return string
|
| 57 |
+
*/
|
| 58 |
+
private static function getProductImageLink($product, $flagKeepFrame = true, $width = 70, $height = 70)
|
| 59 |
+
{
|
| 60 |
+
$imageLink = '';
|
| 61 |
+
|
| 62 |
+
if ($product) {
|
| 63 |
+
if (empty($imageLink)) {
|
| 64 |
+
$smallImage = $product->getData('small_image');
|
| 65 |
+
|
| 66 |
+
if (!empty($smallImage) && $smallImage != 'no_selection') {
|
| 67 |
+
$imageLink = Mage::helper('catalog/image')
|
| 68 |
+
->init($product, 'small_image')
|
| 69 |
+
->constrainOnly(true) // Guarantee, that image picture will not be bigger, than it was.
|
| 70 |
+
->keepAspectRatio(true) // Guarantee, that image picture width/height will not be distorted.
|
| 71 |
+
->keepFrame($flagKeepFrame) // Guarantee, that image will have dimensions, set in $width/$height
|
| 72 |
+
->resize($width, $height);
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
if (empty($imageLink)) {
|
| 77 |
+
$image = $product->getData('image');
|
| 78 |
+
|
| 79 |
+
if (!empty($image) && $image != 'no_selection') {
|
| 80 |
+
$imageLink = Mage::helper('catalog/image')
|
| 81 |
+
->init($product, 'image')
|
| 82 |
+
->constrainOnly(true) // Guarantee, that image picture will not be bigger, than it was.
|
| 83 |
+
->keepAspectRatio(true) // Guarantee, that image picture width/height will not be distorted.
|
| 84 |
+
->keepFrame($flagKeepFrame) // Guarantee, that image will have dimensions, set in $width/$height
|
| 85 |
+
->resize($width, $height);
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
if (empty($imageLink)) {
|
| 90 |
+
$thumbnail = $product->getData('thumbnail');
|
| 91 |
+
|
| 92 |
+
if (!empty($thumbnail) && $thumbnail != 'no_selection') {
|
| 93 |
+
$imageLink = Mage::helper('catalog/image')
|
| 94 |
+
->init($product, 'thumbnail')
|
| 95 |
+
->constrainOnly(true) // Guarantee, that image picture will not be bigger, than it was.
|
| 96 |
+
->keepAspectRatio(true) // Guarantee, that image picture width/height will not be distorted.
|
| 97 |
+
->keepFrame($flagKeepFrame) // Guarantee, that image will have dimensions, set in $width/$height
|
| 98 |
+
->resize($width, $height);
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return $imageLink;
|
| 104 |
+
}
|
| 105 |
|
| 106 |
public static function generateProductXML($product, $store = null)
|
| 107 |
{
|
| 202 |
|
| 203 |
// <image_link>
|
| 204 |
{
|
| 205 |
+
// Show images without white field
|
| 206 |
+
// Example: image 360 x 535 => 47 х 70
|
| 207 |
+
$flagKeepFrame = false;
|
| 208 |
+
$imageLink = self::getProductImageLink($product, $flagKeepFrame);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
|
| 210 |
if ($imageLink != '') {
|
| 211 |
$entry .= '<cs:image_link><![CDATA[' . $imageLink . ']]></cs:image_link>' . self::XML_END_LINE;
|
app/code/community/Simtech/Searchanise/Model/LayerCatalogSearch.php
CHANGED
|
@@ -17,7 +17,7 @@ class Simtech_Searchanise_Model_LayerCatalogSearch extends Mage_CatalogSearch_Mo
|
|
| 17 |
/**
|
| 18 |
* Prepare product collection
|
| 19 |
*
|
| 20 |
-
* @param
|
| 21 |
* @return Mage_Catalog_Model_Layer
|
| 22 |
*/
|
| 23 |
public function prepareProductCollection($collection)
|
| 17 |
/**
|
| 18 |
* Prepare product collection
|
| 19 |
*
|
| 20 |
+
* @param Simtech_Searchanise_Model_Resource_Fulltext_Collection $collection
|
| 21 |
* @return Mage_Catalog_Model_Layer
|
| 22 |
*/
|
| 23 |
public function prepareProductCollection($collection)
|
app/code/community/Simtech/Searchanise/Model/Observer.php
CHANGED
|
@@ -21,7 +21,11 @@ class Simtech_Searchanise_Model_Observer
|
|
| 21 |
{
|
| 22 |
// nothing for now
|
| 23 |
}
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
public function autoSync()
|
| 26 |
{
|
| 27 |
Mage::helper('searchanise/ApiSe')->log('start cron autoSync', 'information');
|
|
@@ -41,6 +45,19 @@ class Simtech_Searchanise_Model_Observer
|
|
| 41 |
|
| 42 |
return $this;
|
| 43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
// FOR PRODUCTS //
|
| 46 |
/**
|
| 21 |
{
|
| 22 |
// nothing for now
|
| 23 |
}
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* Function for cron
|
| 27 |
+
*
|
| 28 |
+
*/
|
| 29 |
public function autoSync()
|
| 30 |
{
|
| 31 |
Mage::helper('searchanise/ApiSe')->log('start cron autoSync', 'information');
|
| 45 |
|
| 46 |
return $this;
|
| 47 |
}
|
| 48 |
+
|
| 49 |
+
// FOR SYSTEM //
|
| 50 |
+
/**
|
| 51 |
+
* After image cache was cleaned
|
| 52 |
+
*
|
| 53 |
+
*/
|
| 54 |
+
public function cleanCatalogImagesCacheAfter()
|
| 55 |
+
{
|
| 56 |
+
Mage::helper('searchanise/ApiSe')->queueImport();
|
| 57 |
+
|
| 58 |
+
return $this;
|
| 59 |
+
}
|
| 60 |
+
// END FOR SYSTEM //
|
| 61 |
|
| 62 |
// FOR PRODUCTS //
|
| 63 |
/**
|
app/code/community/Simtech/Searchanise/controllers/AsyncController.php
CHANGED
|
@@ -40,6 +40,7 @@ class Simtech_Searchanise_AsyncController extends Mage_Core_Controller_Front_Act
|
|
| 40 |
$this->setFlag('', self::FLAG_NO_CHECK_INSTALLATION, 1);
|
| 41 |
$this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, 0);
|
| 42 |
$this->setFlag('', self::FLAG_NO_PRE_DISPATCH, 1);
|
|
|
|
| 43 |
|
| 44 |
parent::preDispatch();
|
| 45 |
}
|
| 40 |
$this->setFlag('', self::FLAG_NO_CHECK_INSTALLATION, 1);
|
| 41 |
$this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, 0);
|
| 42 |
$this->setFlag('', self::FLAG_NO_PRE_DISPATCH, 1);
|
| 43 |
+
$this->setFlag('', self::FLAG_NO_POST_DISPATCH, 1);
|
| 44 |
|
| 45 |
parent::preDispatch();
|
| 46 |
}
|
app/code/community/Simtech/Searchanise/controllers/InfoController.php
CHANGED
|
@@ -14,12 +14,14 @@
|
|
| 14 |
|
| 15 |
class Simtech_Searchanise_InfoController extends Mage_Core_Controller_Front_Action
|
| 16 |
{
|
|
|
|
| 17 |
const OUTPUT = 'visual';
|
| 18 |
const PRODUCT_IDS = 'product_ids';
|
| 19 |
const PARENT_PRIVATE_KEY = 'parent_private_key';
|
| 20 |
|
| 21 |
public function indexAction()
|
| 22 |
{
|
|
|
|
| 23 |
$visual = $this->getRequest()->getParam(self::OUTPUT);
|
| 24 |
$productIds = $this->getRequest()->getParam(self::PRODUCT_IDS);
|
| 25 |
$parentPrivateKey = $this->getRequest()->getParam(self::PARENT_PRIVATE_KEY);
|
|
@@ -40,7 +42,10 @@ class Simtech_Searchanise_InfoController extends Mage_Core_Controller_Front_Acti
|
|
| 40 |
echo Mage::helper('core')->jsonEncode($options);
|
| 41 |
}
|
| 42 |
} else {
|
| 43 |
-
if (
|
|
|
|
|
|
|
|
|
|
| 44 |
$productFeeds = Mage::helper('searchanise/ApiXML')->generateProductsXML($productIds);
|
| 45 |
|
| 46 |
if ($visual) {
|
|
@@ -49,6 +54,8 @@ class Simtech_Searchanise_InfoController extends Mage_Core_Controller_Front_Acti
|
|
| 49 |
echo Mage::helper('core')->jsonEncode($productFeeds);
|
| 50 |
}
|
| 51 |
} else {
|
|
|
|
|
|
|
| 52 |
$options = Mage::helper('searchanise/ApiSe')->getAddonOptions();
|
| 53 |
|
| 54 |
if ($visual) {
|
| 14 |
|
| 15 |
class Simtech_Searchanise_InfoController extends Mage_Core_Controller_Front_Action
|
| 16 |
{
|
| 17 |
+
const RESYNC = 'resync';
|
| 18 |
const OUTPUT = 'visual';
|
| 19 |
const PRODUCT_IDS = 'product_ids';
|
| 20 |
const PARENT_PRIVATE_KEY = 'parent_private_key';
|
| 21 |
|
| 22 |
public function indexAction()
|
| 23 |
{
|
| 24 |
+
$resync = $this->getRequest()->getParam(self::RESYNC);
|
| 25 |
$visual = $this->getRequest()->getParam(self::OUTPUT);
|
| 26 |
$productIds = $this->getRequest()->getParam(self::PRODUCT_IDS);
|
| 27 |
$parentPrivateKey = $this->getRequest()->getParam(self::PARENT_PRIVATE_KEY);
|
| 42 |
echo Mage::helper('core')->jsonEncode($options);
|
| 43 |
}
|
| 44 |
} else {
|
| 45 |
+
if ($resync) {
|
| 46 |
+
Mage::helper('searchanise/ApiSe')->queueImport();
|
| 47 |
+
|
| 48 |
+
} elseif (!empty($productIds)) {
|
| 49 |
$productFeeds = Mage::helper('searchanise/ApiXML')->generateProductsXML($productIds);
|
| 50 |
|
| 51 |
if ($visual) {
|
| 54 |
echo Mage::helper('core')->jsonEncode($productFeeds);
|
| 55 |
}
|
| 56 |
} else {
|
| 57 |
+
Mage::helper('searchanise/ApiSe')->checkImportIsDone();
|
| 58 |
+
|
| 59 |
$options = Mage::helper('searchanise/ApiSe')->getAddonOptions();
|
| 60 |
|
| 61 |
if ($visual) {
|
app/code/community/Simtech/Searchanise/etc/config.xml
CHANGED
|
@@ -15,7 +15,7 @@
|
|
| 15 |
<config>
|
| 16 |
<modules>
|
| 17 |
<Simtech_Searchanise>
|
| 18 |
-
<version>1.0.
|
| 19 |
</Simtech_Searchanise>
|
| 20 |
</modules>
|
| 21 |
<frontend>
|
|
@@ -251,6 +251,16 @@
|
|
| 251 |
</searchanise>
|
| 252 |
</helpers>
|
| 253 |
<events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
<!-- CATALOG -->
|
| 255 |
<!-- products -->
|
| 256 |
<catalog_product_save_before>
|
| 15 |
<config>
|
| 16 |
<modules>
|
| 17 |
<Simtech_Searchanise>
|
| 18 |
+
<version>1.0.8</version>
|
| 19 |
</Simtech_Searchanise>
|
| 20 |
</modules>
|
| 21 |
<frontend>
|
| 251 |
</searchanise>
|
| 252 |
</helpers>
|
| 253 |
<events>
|
| 254 |
+
<!-- SYSTEM -->
|
| 255 |
+
<clean_catalog_images_cache_after>
|
| 256 |
+
<observers>
|
| 257 |
+
<rating>
|
| 258 |
+
<class>searchanise/observer</class>
|
| 259 |
+
<method>cleanCatalogImagesCacheAfter</method>
|
| 260 |
+
</rating>
|
| 261 |
+
</observers>
|
| 262 |
+
</clean_catalog_images_cache_after>
|
| 263 |
+
<!-- END SYSTEM -->
|
| 264 |
<!-- CATALOG -->
|
| 265 |
<!-- products -->
|
| 266 |
<catalog_product_save_before>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Simtech_Searchanise</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://searchanise.atlassian.net/wiki/display/DD/LICENSE+AGREEMENT">Commercial license: https://searchanise.atlassian.net/wiki/display/DD/LICENSE+AGREEMENT</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -10,13 +10,12 @@
|
|
| 10 |
<description>Searchanise is a free SaaS solution providing fast and smart search for online stores. It provides rapid search results and instant search suggestions presented in a fancy and customizable widget.
|
| 11 |

|
| 12 |
With the help of Searchanise Connector Add-on you will be able to connect your store to the service and start using the search widget in no time. Power up your store right now!</description>
|
| 13 |
-
<notes>
|
| 14 |
-
[
|
| 15 |
-
[+] Added an extra check for the standard search autocomplete being turned off (useful for non-standard skins, e.g. Shopper by Themeforest.)</notes>
|
| 16 |
<authors><author><name>Simbirsk Technologies, Ltd.</name><user>searchanise</user><email>sales@searchanise.com</email></author></authors>
|
| 17 |
-
<date>2013-05-
|
| 18 |
-
<time>
|
| 19 |
-
<contents><target name="magecommunity"><dir name="Simtech"><dir name="Searchanise"><dir name="Block"><file name="Async.php" hash="e7f47cd4afa3f2a0d32776553a89c557"/><file name="Autocomplete.php" hash="efc89ac3f897be3bc307fba6a36778f0"/><file name="Jsinit.php" hash="
|
| 20 |
<compatible/>
|
| 21 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 22 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Simtech_Searchanise</name>
|
| 4 |
+
<version>1.0.8</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://searchanise.atlassian.net/wiki/display/DD/LICENSE+AGREEMENT">Commercial license: https://searchanise.atlassian.net/wiki/display/DD/LICENSE+AGREEMENT</license>
|
| 7 |
<channel>community</channel>
|
| 10 |
<description>Searchanise is a free SaaS solution providing fast and smart search for online stores. It provides rapid search results and instant search suggestions presented in a fancy and customizable widget.
|
| 11 |

|
| 12 |
With the help of Searchanise Connector Add-on you will be able to connect your store to the service and start using the search widget in no time. Power up your store right now!</description>
|
| 13 |
+
<notes>[+] Maximal thumbnail size is now 70×70 pixels with the original aspect ratio preserved. For example, for a 360x535 image a 47x70 thumbnail will be generated.<br>
|
| 14 |
+
[+] Catalog resync is performed automatically on image cache flushing.</notes>
|
|
|
|
| 15 |
<authors><author><name>Simbirsk Technologies, Ltd.</name><user>searchanise</user><email>sales@searchanise.com</email></author></authors>
|
| 16 |
+
<date>2013-05-27</date>
|
| 17 |
+
<time>10:59:51</time>
|
| 18 |
+
<contents><target name="magecommunity"><dir name="Simtech"><dir name="Searchanise"><dir name="Block"><file name="Async.php" hash="e7f47cd4afa3f2a0d32776553a89c557"/><file name="Autocomplete.php" hash="efc89ac3f897be3bc307fba6a36778f0"/><file name="Jsinit.php" hash="71ba588cf3f94768a76fca4f52c563e9"/><dir name="Product"><dir name="List"><file name="Toolbar.php" hash="7191058de95d20a86b65c27b3c73b064"/></dir><file name="Result.php" hash="93bad80ca402362e6d56b13da7064fa1"/></dir><file name="Result.php" hash="dec7b27ab9511c956680eb60eba9b95e"/></dir><dir name="Helper"><file name="ApiSe.php" hash="1df3d62b73ce6386b423aa9475236386"/><file name="ApiXML.php" hash="3822be2e0891d7b1f6cad751b662afe6"/><file name="Data.php" hash="8eefead1610d937cf9470ec45c364781"/></dir><dir name="Model"><file name="Advanced.php" hash="2a22ebcf7ac75b54681ef8a27bad2e47"/><dir name="Config"><file name="Data.php" hash="ddc558d22208f0ebc1e4378c9d050022"/></dir><file name="Config.php" hash="00ca3c7955f3ff2283c636a2074b6f03"/><dir name="Import"><dir name="Entity"><file name="Product.php" hash="4997af528b36f0f576d1c01402e14b03"/></dir></dir><dir name="Layer"><dir name="Filter"><file name="Category.php" hash="e290ab29f2d50e1acbbbb37496150ea4"/><file name="Price.php" hash="743887b32bf012274ad8a371fff96411"/></dir></dir><file name="Layer.php" hash="3e8c975d649ae6e20fcc69d35779c97c"/><file name="LayerCatalogSearch.php" hash="c32156da4147670c6bc5583e083c22a1"/><dir name="Mysql4"><dir name="Config"><file name="Collection.php" hash="470218c1eb3f1cc1ca0e6d0e93e1b097"/></dir><file name="Config.php" hash="c95dc8ecd7ab4f955b6eaf4710ab960e"/><dir name="Queue"><file name="Collection.php" hash="30ca0f8640bdc443deb94cd2e71010c8"/></dir><file name="Queue.php" hash="286351623e8f011a21519f8d9c3e3151"/></dir><file name="Observer.php" hash="9fc59a5463e4df66e772a8fc03a28cff"/><file name="Queue.php" hash="4906e1669bac61e66f3d690c646c9ba3"/><file name="Request.php" hash="987e3f8b6691aa982101f002695e70af"/><dir name="Resource"><dir name="Advanced"><file name="Collection.php" hash="bb2843f4b1b7672cf1334f7543969f95"/></dir><dir name="Fulltext"><file name="Collection.php" hash="3b8260ba3184172d220b87619159482f"/></dir><file name="Fulltext.php" hash="e9ea5b1ea7a2a5bc38d89f519e12347a"/><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="4fd102cb09e8e80e50f9cbf1f621adbb"/><file name="Price.php" hash="0b3302f2d99f5f0d62d7fcd705825db0"/></dir></dir><dir name="Product"><file name="Collection.php" hash="cfd22d67e6a8cf032cf4a6343e10a450"/><file name="CollectionTag.php" hash="be55f448ecf92aad043c2480b7fe49df"/></dir><file name="Store.php" hash="5664dbfc69749b767db08b288c5aefbe"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Searchanise"><file name="TypeAsync.php" hash="11d1aa481094ccbeab365b1fed33440d"/></dir></dir></dir></dir><dir name="Tag"><file name="Relation.php" hash="598f81fd8b2ac77baf24211c2ed03e55"/></dir></dir><dir name="controllers"><file name="AdvancedController.php" hash="7500f6075382cd8a14816e424da2348f"/><file name="AsyncController.php" hash="36fac5872193c47b47115eb7261e3571"/><file name="CategoryController.php" hash="909f99c5cf7f85405fc76ebe976c2c8e"/><file name="IndexController.php" hash="e3234ca51a7669741e29ff7c38789989"/><file name="InfoController.php" hash="177263a2ac421ba1d759868c2173b2ba"/><file name="OptionsController.php" hash="56785c8ea24472c2047268b2d9e8e878"/><file name="ProductController.php" hash="6633fde99f35ffeaa05884f0e0d98da7"/><file name="ResultController.php" hash="434b72272ebb222f775b8010f72ffdde"/><file name="ResyncController.php" hash="0612f929d375427326821dfc12186be8"/><file name="SignupController.php" hash="80f87a63d6272f98a068dde35f1d140e"/></dir><dir name="etc"><file name="config.xml" hash="0f0833c2ddc64c8abf68b6dc1e976cd5"/><file name="system.xml" hash="881fb083ae8711b7dadadd6ab954f764"/></dir><dir name="sql"><dir name="searchanise_setup"><file name="mysql4-install-0.1.0.php" hash="36781ba462935d4026358fb3a1f7c842"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="searchanise"><file name="dashboard.phtml" hash="c76131581bb8dfc21a1f9aa492179b01"/></dir></dir><dir name="layout"><file name="searchanise.xml" hash="1eaff51919b0b8c227fdf1b975ebe6b2"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="searchanise.xml" hash="9a1338f1522adad70042119c25ab64d9"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="catalogsearch"><file name="form.mini.phtml" hash="937e73ae35afdf220d96132e3ee13424"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Simtech_Searchanise.xml" hash="04148681a6648bd370ab62140cbf2ad9"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Simtech_Searchanise.csv" hash="1bdb7fddc596dac1460bc3054c425187"/></dir></target></contents>
|
| 19 |
<compatible/>
|
| 20 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 21 |
</package>
|
