mobile_assistant_connector - Version 1.1.1

Version Notes

Improvements: Loading thumbnail images

Download this release

Release Info

Developer eMagicOne
Extension mobile_assistant_connector
Version 1.1.1
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.1

app/code/community/Emagicone/Mobassistantconnector/controllers/IndexController.php CHANGED
@@ -26,7 +26,7 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
26
  public $def_currency;
27
  public $currency_code;
28
  const GSM_URL = 'https://android.googleapis.com/gcm/send';
29
- const MB_VERSION = '$Revision: 83 $';
30
 
31
  public function indexAction() {
32
  Mage::app()->cleanCache();
@@ -1164,10 +1164,16 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
1164
  $block->setItem($orderItem);
1165
  $_options = $block->getItemOptions();
1166
 
1167
- $thumbnail_path = $orderItem->getProduct()->getThumbnail();
1168
- $thumbnail = $orderItem->getProduct()->getMediaConfig()->getMediaUrl($thumbnail_path);
 
 
 
1169
 
1170
- if(($thumbnail_path == 'no_selection') || (!isset($thumbnail_path))) {
 
 
 
1171
  $thumbnail = '';
1172
  }
1173
 
@@ -1904,9 +1910,19 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
1904
  $productFinal['name'] = $product->getName();
1905
  $productFinal['type_id'] = ucfirst($product->getTypeId());
1906
  // Mage::helper('catalog/image')->init($product, 'thumbnail');
1907
- $thumbnail = $product->getThumbnail();
1908
 
1909
- $productFinal['thumbnail'] = $product->getMediaConfig()->getMediaUrl($thumbnail);
 
 
 
 
 
 
 
 
 
 
 
1910
 
1911
  if(($thumbnail == 'no_selection') || (!isset($thumbnail))) {
1912
  $productFinal['thumbnail'] = '';
@@ -2048,16 +2064,23 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
2048
  }
2049
 
2050
  foreach ($salesCollection as $order) {
2051
- $thumbnail_path = $order->getProduct()->getThumbnail();
2052
- $thumbnail = $order->getProduct()->getMediaConfig()->getMediaUrl($thumbnail_path);
2053
 
2054
- if(($thumbnail_path == 'no_selection') || (!isset($thumbnail_path))) {
 
 
 
 
 
 
 
 
 
2055
  $thumbnail = '';
2056
  }
2057
 
2058
  $ord_prodArr = $order->toArray();
2059
-
2060
  $ord_prodArr['thumbnail'] = $thumbnail;
 
2061
  $ord_prodArr['price'] = $this->_price_format($ord_prodArr['iso_code'], 1, $ord_prodArr['price'], $this->currency_code);
2062
  if($ord_prodArr['orig_price'] > 0) {
2063
  $ord_prodArr['orig_price'] = $this->_price_format($ord_prodArr['iso_code'], 1, $ord_prodArr['orig_price'], $this->currency_code);
@@ -2452,12 +2475,16 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
2452
  $product['product_price'] = $item->getRowTotal();
2453
  $product['product_price'] = $this->_price_format($this->def_currency, 3, $product['product_price'], $this->currency_code);
2454
 
2455
- $thumbnail_path = $item->getProduct()->getThumbnail();
2456
- $thumbnail = $item->getProduct()->getMediaConfig()->getMediaUrl($thumbnail_path);
 
 
 
2457
 
2458
- if(($thumbnail_path == 'no_selection') || (!isset($thumbnail_path))) {
2459
  $thumbnail = '';
2460
  }
 
2461
  $product['product_image'] = $thumbnail;
2462
 
2463
  $buy_request = $item->getBuyRequest()->getData();
26
  public $def_currency;
27
  public $currency_code;
28
  const GSM_URL = 'https://android.googleapis.com/gcm/send';
29
+ const MB_VERSION = '$Revision: 84 $';
30
 
31
  public function indexAction() {
32
  Mage::app()->cleanCache();
1164
  $block->setItem($orderItem);
1165
  $_options = $block->getItemOptions();
1166
 
1167
+ $thumbnail = (string)Mage::helper('catalog/image')
1168
+ ->init($orderItem->getProduct(), 'image')
1169
+ ->constrainOnly(TRUE)
1170
+ ->keepAspectRatio(TRUE)
1171
+ ->resize(150, null);
1172
 
1173
+ // $thumbnail_path = $orderItem->getProduct()->getThumbnail();
1174
+ // $thumbnail = $orderItem->getProduct()->getMediaConfig()->getMediaUrl($thumbnail_path);
1175
+
1176
+ if(($thumbnail == 'no_selection') || (!isset($thumbnail))) {
1177
  $thumbnail = '';
1178
  }
1179
 
1910
  $productFinal['name'] = $product->getName();
1911
  $productFinal['type_id'] = ucfirst($product->getTypeId());
1912
  // Mage::helper('catalog/image')->init($product, 'thumbnail');
 
1913
 
1914
+ // $thumbnail = $product->getThumbnail();
1915
+ // var_dump($product->isVisibleInCatalog());
1916
+ // die();
1917
+
1918
+ $thumbnail = (string)Mage::helper('catalog/image')
1919
+ ->init($product, 'image')
1920
+ ->constrainOnly(TRUE)
1921
+ ->keepAspectRatio(TRUE)
1922
+ ->resize(150, null);
1923
+
1924
+ // $productFinal['thumbnail'] = $product->getMediaConfig()->getMediaUrl($thumbnail);
1925
+ $productFinal['thumbnail'] = $thumbnail;
1926
 
1927
  if(($thumbnail == 'no_selection') || (!isset($thumbnail))) {
1928
  $productFinal['thumbnail'] = '';
2064
  }
2065
 
2066
  foreach ($salesCollection as $order) {
 
 
2067
 
2068
+ $thumbnail = (string)Mage::helper('catalog/image')
2069
+ ->init($order->getProduct(), 'image')
2070
+ ->constrainOnly(TRUE)
2071
+ ->keepAspectRatio(TRUE)
2072
+ ->resize(150, null);
2073
+
2074
+ // $thumbnail_path = $order->getProduct()->getThumbnail();
2075
+ // $thumbnail = $order->getProduct()->getMediaConfig()->getMediaUrl($thumbnail_path);
2076
+
2077
+ if(($thumbnail == 'no_selection') || (!isset($thumbnail))) {
2078
  $thumbnail = '';
2079
  }
2080
 
2081
  $ord_prodArr = $order->toArray();
 
2082
  $ord_prodArr['thumbnail'] = $thumbnail;
2083
+
2084
  $ord_prodArr['price'] = $this->_price_format($ord_prodArr['iso_code'], 1, $ord_prodArr['price'], $this->currency_code);
2085
  if($ord_prodArr['orig_price'] > 0) {
2086
  $ord_prodArr['orig_price'] = $this->_price_format($ord_prodArr['iso_code'], 1, $ord_prodArr['orig_price'], $this->currency_code);
2475
  $product['product_price'] = $item->getRowTotal();
2476
  $product['product_price'] = $this->_price_format($this->def_currency, 3, $product['product_price'], $this->currency_code);
2477
 
2478
+ $thumbnail = (string)Mage::helper('catalog/image')
2479
+ ->init($item->getProduct(), 'small_image')
2480
+ ->constrainOnly(TRUE)
2481
+ ->keepAspectRatio(TRUE)
2482
+ ->resize(150, null);
2483
 
2484
+ if(($thumbnail == 'no_selection') || (!isset($thumbnail))) {
2485
  $thumbnail = '';
2486
  }
2487
+
2488
  $product['product_image'] = $thumbnail;
2489
 
2490
  $buy_request = $item->getBuyRequest()->getData();
package.xml CHANGED
@@ -1,20 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mobile_assistant_connector</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GNU</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Mobile Assistant Connector</summary>
10
  <description>Mobile Assistant Connector</description>
11
- <notes>Added: - abandoned carts&#xD;
12
- Fixed: - stats performance&#xD;
13
- - thumbnails</notes>
14
  <authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
15
- <date>2015-03-24</date>
16
- <time>16:20:17</time>
17
- <contents><target name="magecommunity"><dir name="Emagicone"><dir name="Affiliate"><dir name="Model"><file name="Observer.php" hash="34f47695ff6a590f554331fd5ff38ce5"/></dir><dir name="etc"><file name="adminhtml.xml" hash="76cc4c681e62263421f09fdbd94e9b91"/><file name="config.xml" hash="9d4d74e1322ab291275f92ef634ff6fd"/><file name="system.xml" hash="b2baadb73f35fe5a06548e312dcf0b52"/></dir></dir><dir name="Mobassistantconnector"><dir name="Helper"><file name="Data.php" hash="37602f03d9864833f0d306344ddff60f"/></dir><dir name="Model"><file name="Defpassword.php" hash="ab8f696fce0029f113986b83ddeb8232"/><file name="Login.php" hash="6c82713acedcf883203c6bf964a61016"/><file name="Observer.php" hash="bb18972490df3223aeb473d917a2acf4"/><file name="Order.php" hash="f3d5529e0504ea0265cb661e03f41109"/><file name="Password.php" hash="c8fe770cb05b7e45050c6549cb9d39a3"/></dir><dir name="controllers"><file name="IndexController.php" hash="e9d990dd2f3b69ed8b67fe814e572294"/><dir name="adminhtml"><file name="IndexController.php" hash="ef5ca028e534cbf81b39a643885c9511"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="bd21488195715421d3beb6a512acd5b5"/><file name="config.xml" hash="a3369251198939eba20d2b0fc020b5c2"/><file name="system.xml" hash="916fe7ee643e4dcb15a5498219605896"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Emagicone_Mobassistantconnector.xml" hash="7bb654478173d96ad294000fc9625820"/></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/><file name="__Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/></dir><dir name="en_US"><file name="Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/><file name="__Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/></dir><dir name="es_ES"><file name="Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/><file name="__Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/></dir><dir name="fr_FR"><file name="Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/><file name="__Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/></dir><dir name="ru_RU"><file name="Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/><file name="__Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/></dir><dir name="uk_UA"><file name="Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/><file name="__Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mobassistantconnector.xml" hash="b5c4d423be8de0c5d73d64783dcb9a3c"/></dir><dir name="template"><dir name="mobassistantconnector"><file name="jsinit.phtml" hash="785c82b5cf6b2a7dc94a1436d1c9115f"/></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min>1.0</min><max>3.0</max></extension><extension><name>json</name><min>1.0</min><max>3.0</max></extension><extension><name>date</name><min>1.0</min><max>3.0</max></extension></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mobile_assistant_connector</name>
4
+ <version>1.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GNU</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Mobile Assistant Connector</summary>
10
  <description>Mobile Assistant Connector</description>
11
+ <notes>Improvements: Loading thumbnail images</notes>
 
 
12
  <authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
13
+ <date>2015-03-25</date>
14
+ <time>16:44:35</time>
15
+ <contents><target name="magecommunity"><dir name="Emagicone"><dir name="Affiliate"><dir name="Model"><file name="Observer.php" hash="34f47695ff6a590f554331fd5ff38ce5"/></dir><dir name="etc"><file name="adminhtml.xml" hash="76cc4c681e62263421f09fdbd94e9b91"/><file name="config.xml" hash="9d4d74e1322ab291275f92ef634ff6fd"/><file name="system.xml" hash="b2baadb73f35fe5a06548e312dcf0b52"/></dir></dir><dir name="Mobassistantconnector"><dir name="Helper"><file name="Data.php" hash="37602f03d9864833f0d306344ddff60f"/></dir><dir name="Model"><file name="Defpassword.php" hash="ab8f696fce0029f113986b83ddeb8232"/><file name="Login.php" hash="6c82713acedcf883203c6bf964a61016"/><file name="Observer.php" hash="bb18972490df3223aeb473d917a2acf4"/><file name="Order.php" hash="f3d5529e0504ea0265cb661e03f41109"/><file name="Password.php" hash="c8fe770cb05b7e45050c6549cb9d39a3"/></dir><dir name="controllers"><file name="IndexController.php" hash="48454fe33f893e6cac71f1a679d2e765"/><dir name="adminhtml"><file name="IndexController.php" hash="ef5ca028e534cbf81b39a643885c9511"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="bd21488195715421d3beb6a512acd5b5"/><file name="config.xml" hash="a3369251198939eba20d2b0fc020b5c2"/><file name="system.xml" hash="916fe7ee643e4dcb15a5498219605896"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Emagicone_Mobassistantconnector.xml" hash="7bb654478173d96ad294000fc9625820"/></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/><file name="__Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/></dir><dir name="en_US"><file name="Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/><file name="__Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/></dir><dir name="es_ES"><file name="Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/><file name="__Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/></dir><dir name="fr_FR"><file name="Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/><file name="__Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/></dir><dir name="ru_RU"><file name="Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/><file name="__Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/></dir><dir name="uk_UA"><file name="Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/><file name="__Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mobassistantconnector.xml" hash="b5c4d423be8de0c5d73d64783dcb9a3c"/></dir><dir name="template"><dir name="mobassistantconnector"><file name="jsinit.phtml" hash="785c82b5cf6b2a7dc94a1436d1c9115f"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min>1.0</min><max>3.0</max></extension><extension><name>json</name><min>1.0</min><max>3.0</max></extension><extension><name>date</name><min>1.0</min><max>3.0</max></extension></required></dependencies>
18
  </package>