Version Notes
Added: - thumbnails in products list
- product options
Download this release
Release Info
Developer | eMagicOne |
Extension | mobile_assistant_connector |
Version | 1.0.13 |
Comparing to | |
See all releases |
Code changes from version 1.0.12 to 1.0.13
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:
|
30 |
|
31 |
public function indexAction() {
|
32 |
Mage::app()->cleanCache();
|
@@ -105,7 +105,7 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
105 |
$this->{$k} = $value;
|
106 |
}
|
107 |
|
108 |
-
if(empty($this->currency_code) || strval($this->currency_code) == 'base_currency') {
|
109 |
$this->currency_code = $this->def_currency;
|
110 |
}
|
111 |
|
@@ -310,7 +310,7 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
310 |
|
311 |
protected function is_group_exists($groupId) {
|
312 |
$exists = false;
|
313 |
-
if(
|
314 |
try {
|
315 |
$name = Mage::app()->getGroup($groupId)->getName();
|
316 |
$exists = true;
|
@@ -1146,20 +1146,48 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
1146 |
$ordersItemsCollection->setPage($this->page, $this->show);
|
1147 |
}
|
1148 |
|
|
|
|
|
1149 |
foreach($ordersItemsCollection as $orderItem) {
|
1150 |
-
$
|
1151 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1152 |
|
1153 |
$orderItem = $orderItem->toArray();
|
1154 |
|
1155 |
-
//-- get ordered item options
|
1156 |
$orderItem['options'] = array();
|
1157 |
-
if(isset($
|
1158 |
-
foreach ($
|
1159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1160 |
}
|
1161 |
}
|
1162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1163 |
$orderItem['thumbnail'] = $thumbnail;
|
1164 |
$orderItem['product_price'] = $this->_price_format($order_info['iso_code'], 1, $orderItem['product_price'], $this->currency_code);
|
1165 |
$orderItem['product_quantity'] = intval($orderItem['product_quantity']);
|
@@ -1720,7 +1748,8 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
1720 |
$row_page['count_ords'] = $ordersCollection->count();
|
1721 |
|
1722 |
$ordersSum = $this->bd_nice_number($ordersSum);
|
1723 |
-
$row_page['sum_ords'] = $this->_price_format($this->def_currency, 1, $ordersSum, 0, 0);
|
|
|
1724 |
|
1725 |
if(!empty($this->page) && !empty($this->show)) {
|
1726 |
$ordersCollection->clear();
|
@@ -1863,7 +1892,14 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
1863 |
$productFinal['product_id'] = $product->getEntityId();
|
1864 |
$productFinal['name'] = $product->getName();
|
1865 |
$productFinal['type_id'] = ucfirst($product->getTypeId());
|
1866 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1867 |
|
1868 |
$productFinal['sku'] = $product->getSku();
|
1869 |
$productFinal['quantity'] = intval($product->getQty());
|
@@ -2001,7 +2037,12 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
2001 |
}
|
2002 |
|
2003 |
foreach ($salesCollection as $order) {
|
2004 |
-
$
|
|
|
|
|
|
|
|
|
|
|
2005 |
|
2006 |
$ord_prodArr = $order->toArray();
|
2007 |
|
@@ -2012,11 +2053,11 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
2012 |
} else {
|
2013 |
unset($ord_prodArr['orig_price']);
|
2014 |
}
|
|
|
2015 |
$ord_prodArr['quantity'] = intval($ord_prodArr['quantity']);
|
2016 |
$ord_prodArr['order_id'] = $ord_prodArr['main_id'];
|
2017 |
$ord_prodArr['type_id'] = ucfirst($ord_prodArr['type_id']);
|
2018 |
|
2019 |
-
|
2020 |
$ordered_products[] = $ord_prodArr;
|
2021 |
}
|
2022 |
|
@@ -2152,6 +2193,10 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
|
|
2152 |
$price = str_replace(' ', '', $price);
|
2153 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
2154 |
|
|
|
|
|
|
|
|
|
2155 |
if(strlen($convert_to) == 3){
|
2156 |
try {
|
2157 |
$price = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $convert_to);
|
26 |
public $def_currency;
|
27 |
public $currency_code;
|
28 |
const GSM_URL = 'https://android.googleapis.com/gcm/send';
|
29 |
+
const MB_VERSION = '$Revision: 82 $';
|
30 |
|
31 |
public function indexAction() {
|
32 |
Mage::app()->cleanCache();
|
105 |
$this->{$k} = $value;
|
106 |
}
|
107 |
|
108 |
+
if(empty($this->currency_code) || strval($this->currency_code) == 'base_currency' || strval($this->currency_code) == 'not_set') {
|
109 |
$this->currency_code = $this->def_currency;
|
110 |
}
|
111 |
|
310 |
|
311 |
protected function is_group_exists($groupId) {
|
312 |
$exists = false;
|
313 |
+
if(isset($groupId)) {
|
314 |
try {
|
315 |
$name = Mage::app()->getGroup($groupId)->getName();
|
316 |
$exists = true;
|
1146 |
$ordersItemsCollection->setPage($this->page, $this->show);
|
1147 |
}
|
1148 |
|
1149 |
+
$block = Mage::app()->getLayout()->createBlock('sales/order_item_renderer_default');
|
1150 |
+
|
1151 |
foreach($ordersItemsCollection as $orderItem) {
|
1152 |
+
$block->setItem($orderItem);
|
1153 |
+
$_options = $block->getItemOptions();
|
1154 |
+
|
1155 |
+
$thumbnail_path = $orderItem->getProduct()->getThumbnail();
|
1156 |
+
$thumbnail = $orderItem->getProduct()->getMediaConfig()->getMediaUrl($thumbnail_path);
|
1157 |
+
|
1158 |
+
if(($thumbnail_path == 'no_selection') || (!isset($thumbnail_path))) {
|
1159 |
+
$productFinal['thumbnail'] = '';
|
1160 |
+
}
|
1161 |
|
1162 |
$orderItem = $orderItem->toArray();
|
1163 |
|
|
|
1164 |
$orderItem['options'] = array();
|
1165 |
+
if(isset($_options) && count($_options) > 0){
|
1166 |
+
foreach ($_options as $option) {
|
1167 |
+
$orderItem['options'][$option['label']] = $option['value'];
|
1168 |
+
}
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
$orderItem['product_options'] = unserialize($orderItem['product_options']);
|
1172 |
+
if(isset($orderItem['product_options']['bundle_options'])){
|
1173 |
+
foreach ($orderItem['product_options']['bundle_options'] as $option) {
|
1174 |
+
$orderItem['options'][$option['label']] = $option['value'][0]['qty'].'x '.$option['value'][0]['title'];
|
1175 |
}
|
1176 |
}
|
1177 |
|
1178 |
+
unset($orderItem['product_options']);
|
1179 |
+
|
1180 |
+
$module_version = explode(' ', self::MB_VERSION);
|
1181 |
+
|
1182 |
+
if($module_version[1] > 80 && !empty($orderItem['options'])){
|
1183 |
+
$orderItem['prod_options'] = $orderItem['options'];
|
1184 |
+
unset($orderItem['options']);
|
1185 |
+
}
|
1186 |
+
|
1187 |
+
if(empty($orderItem['options'])) {
|
1188 |
+
unset($orderItem['options']);
|
1189 |
+
}
|
1190 |
+
|
1191 |
$orderItem['thumbnail'] = $thumbnail;
|
1192 |
$orderItem['product_price'] = $this->_price_format($order_info['iso_code'], 1, $orderItem['product_price'], $this->currency_code);
|
1193 |
$orderItem['product_quantity'] = intval($orderItem['product_quantity']);
|
1748 |
$row_page['count_ords'] = $ordersCollection->count();
|
1749 |
|
1750 |
$ordersSum = $this->bd_nice_number($ordersSum);
|
1751 |
+
// $row_page['sum_ords'] = $this->_price_format($this->def_currency, 1, $ordersSum, 0, 0);
|
1752 |
+
$row_page['sum_ords'] = $this->_price_format($this->def_currency, 1, $ordersSum, $this->currency_code, 0);
|
1753 |
|
1754 |
if(!empty($this->page) && !empty($this->show)) {
|
1755 |
$ordersCollection->clear();
|
1892 |
$productFinal['product_id'] = $product->getEntityId();
|
1893 |
$productFinal['name'] = $product->getName();
|
1894 |
$productFinal['type_id'] = ucfirst($product->getTypeId());
|
1895 |
+
// Mage::helper('catalog/image')->init($product, 'thumbnail');
|
1896 |
+
$thumbnail = $product->getThumbnail();
|
1897 |
+
|
1898 |
+
$productFinal['thumbnail'] = $product->getMediaConfig()->getMediaUrl($thumbnail);
|
1899 |
+
|
1900 |
+
if(($thumbnail == 'no_selection') || (!isset($thumbnail))) {
|
1901 |
+
$productFinal['thumbnail'] = '';
|
1902 |
+
}
|
1903 |
|
1904 |
$productFinal['sku'] = $product->getSku();
|
1905 |
$productFinal['quantity'] = intval($product->getQty());
|
2037 |
}
|
2038 |
|
2039 |
foreach ($salesCollection as $order) {
|
2040 |
+
$thumbnail_path = $order->getProduct()->getThumbnail();
|
2041 |
+
$thumbnail = $order->getProduct()->getMediaConfig()->getMediaUrl($thumbnail_path);
|
2042 |
+
|
2043 |
+
if(($thumbnail_path == 'no_selection') || (!isset($thumbnail_path))) {
|
2044 |
+
$thumbnail = '';
|
2045 |
+
}
|
2046 |
|
2047 |
$ord_prodArr = $order->toArray();
|
2048 |
|
2053 |
} else {
|
2054 |
unset($ord_prodArr['orig_price']);
|
2055 |
}
|
2056 |
+
unset($ord_prodArr['product']);
|
2057 |
$ord_prodArr['quantity'] = intval($ord_prodArr['quantity']);
|
2058 |
$ord_prodArr['order_id'] = $ord_prodArr['main_id'];
|
2059 |
$ord_prodArr['type_id'] = ucfirst($ord_prodArr['type_id']);
|
2060 |
|
|
|
2061 |
$ordered_products[] = $ord_prodArr;
|
2062 |
}
|
2063 |
|
2193 |
$price = str_replace(' ', '', $price);
|
2194 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
2195 |
|
2196 |
+
if(!in_array(ucwords($convert_to), Mage::getModel('directory/currency')->getConfigAllowCurrencies())) {
|
2197 |
+
$convert_to = $baseCurrencyCode;
|
2198 |
+
}
|
2199 |
+
|
2200 |
if(strlen($convert_to) == 3){
|
2201 |
try {
|
2202 |
$price = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $convert_to);
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>mobile_assistant_connector</name>
|
4 |
-
<version>1.0.
|
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>
|
|
|
12 |
<authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<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="
|
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>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>mobile_assistant_connector</name>
|
4 |
+
<version>1.0.13</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: - thumbnails in products list
|
12 |
+
- product options</notes>
|
13 |
<authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
|
14 |
+
<date>2015-03-04</date>
|
15 |
+
<time>14:50:13</time>
|
16 |
+
<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="5dc94fd23901d53a96a433617056b41a"/><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>
|
17 |
<compatible/>
|
18 |
<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>
|
19 |
</package>
|