Version Notes
Bug fix: Export orders that have the "Processing" status by default.
Download this release
Release Info
Developer | Karsten Hoffmann |
Extension | Adventos_OrderExport |
Version | 1.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.1 to 1.4.2
app/code/local/Adventos/OrderExport/Model/Observer.php
CHANGED
@@ -171,37 +171,50 @@ class Adventos_OrderExport_Model_Observer {
|
|
171 |
$discount_percent = $item->getDiscountPercent ();
|
172 |
$discountAmount = $item->getDiscountAmount ();
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
// typo in discount_percent
|
175 |
if ($discount_percent > 0) {
|
176 |
$product_row_price = $item->getQtyOrdered () * $item->getOrginalPrice () - $item->getDiscountAmount ();
|
177 |
} else {
|
178 |
-
$product_row_price = $item->getQtyOrdered () * $
|
179 |
|
180 |
// when fixed amount per product calc discount percent value
|
181 |
// rowDiscountPercent = (rowqty * rowproductprice) / rowdiscountamount
|
182 |
|
183 |
if ($discountAmount > 0) {
|
184 |
-
$discount_percent = round (
|
185 |
if ($discount_percent == 100.00) {
|
186 |
$discount_percent = 99.99;
|
187 |
}
|
188 |
}
|
189 |
}
|
190 |
-
|
191 |
|
192 |
$productArray [] = array (
|
193 |
"product_sku" => $item->getSku (),
|
194 |
"product_magento_id" => $item->getProductId (),
|
195 |
"product_name" => $item->getName (),
|
196 |
"product_qty" => $item->getQtyOrdered (),
|
197 |
-
"product_price" => $
|
198 |
"product_discount_percent" => $item->getDiscountPercent (),
|
199 |
"product_row_discount_amount" => $item->getDiscountAmount (),
|
200 |
"product_row_price" => $product_row_price,
|
201 |
"product_order_id" => $order->getRealOrderId (),
|
202 |
"product_order_item_id" => $item->getId (),
|
203 |
"product_description" => ""
|
204 |
-
);
|
|
|
|
|
|
|
205 |
|
206 |
}
|
207 |
}
|
171 |
$discount_percent = $item->getDiscountPercent ();
|
172 |
$discountAmount = $item->getDiscountAmount ();
|
173 |
|
174 |
+
// if the item is in a bundle and has a price of 0 , retrieve it's price from the bundle
|
175 |
+
$productPrice = $item->getPrice();
|
176 |
+
$productOptions = unserialize($item->getData('product_options'));
|
177 |
+
|
178 |
+
if ((floatval($productPrice) == 0) && (array_key_exists('bundle_selection_attributes' , $productOptions))) {
|
179 |
+
$productPrice = floatval(unserialize(unserialize($item->getData('product_options'))['bundle_selection_attributes'])['price']);
|
180 |
+
$productPrice = number_format($productPrice,4);
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
// typo in discount_percent
|
185 |
if ($discount_percent > 0) {
|
186 |
$product_row_price = $item->getQtyOrdered () * $item->getOrginalPrice () - $item->getDiscountAmount ();
|
187 |
} else {
|
188 |
+
$product_row_price = $item->getQtyOrdered () * $productPrice - $item->getDiscountAmount ();
|
189 |
|
190 |
// when fixed amount per product calc discount percent value
|
191 |
// rowDiscountPercent = (rowqty * rowproductprice) / rowdiscountamount
|
192 |
|
193 |
if ($discountAmount > 0) {
|
194 |
+
$discount_percent = round (100 * $discountAmount / ($item->getQtyOrdered () * $productPrice), 2 );
|
195 |
if ($discount_percent == 100.00) {
|
196 |
$discount_percent = 99.99;
|
197 |
}
|
198 |
}
|
199 |
}
|
200 |
+
|
201 |
|
202 |
$productArray [] = array (
|
203 |
"product_sku" => $item->getSku (),
|
204 |
"product_magento_id" => $item->getProductId (),
|
205 |
"product_name" => $item->getName (),
|
206 |
"product_qty" => $item->getQtyOrdered (),
|
207 |
+
"product_price" => $productPrice,
|
208 |
"product_discount_percent" => $item->getDiscountPercent (),
|
209 |
"product_row_discount_amount" => $item->getDiscountAmount (),
|
210 |
"product_row_price" => $product_row_price,
|
211 |
"product_order_id" => $order->getRealOrderId (),
|
212 |
"product_order_item_id" => $item->getId (),
|
213 |
"product_description" => ""
|
214 |
+
);
|
215 |
+
|
216 |
+
//Mage::log(unserialize(unserialize($item->getData()['product_options'])[bundle_selection_attributes])['price']);
|
217 |
+
//Mage::log(unserialize($item->getData('product_options')));
|
218 |
|
219 |
}
|
220 |
}
|
app/code/local/Adventos/OrderExport/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Adventos_OrderExport>
|
5 |
-
<version>1.4.
|
6 |
</Adventos_OrderExport>
|
7 |
</modules>
|
8 |
<admin>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Adventos_OrderExport>
|
5 |
+
<version>1.4.2</version>
|
6 |
</Adventos_OrderExport>
|
7 |
</modules>
|
8 |
<admin>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Adventos_OrderExport</name>
|
4 |
-
<version>1.4.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Create Order XML file to integrate Magento with HeadOffice and synchronize stock, order status, invoice, shipments and credit memos.</description>
|
11 |
<notes>Bug fix: Export orders that have the "Processing" status by default. </notes>
|
12 |
<authors><author><name>Karsten Hoffmann</name><user>adventos</user><email>karsten@adventos.de</email></author></authors>
|
13 |
-
<date>2014-10-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Adventos"><dir name="OrderExport"><dir name="Helper"><file name="Data.php" hash="f90dd7d2136cfb6349ba1d7ee939cd15"/></dir><dir name="Model"><dir name="Creditmemo"><dir name="Api"><file name="V2.php" hash="797a58eedbbe8bf1a0c20d7c8599f8be"/></dir><file name="Api.php" hash="c41e82cf79235d51f25d248719e93f92"/></dir><dir name="Invoice"><dir name="Api"><file name="V2.php" hash="3596dc5fe58a597ba5f244b52687288e"/></dir><file name="Api.php" hash="280512b1ae37690871384b3cba0a3a2b"/></dir><file name="Observer.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Adventos_OrderExport</name>
|
4 |
+
<version>1.4.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Create Order XML file to integrate Magento with HeadOffice and synchronize stock, order status, invoice, shipments and credit memos.</description>
|
11 |
<notes>Bug fix: Export orders that have the "Processing" status by default. </notes>
|
12 |
<authors><author><name>Karsten Hoffmann</name><user>adventos</user><email>karsten@adventos.de</email></author></authors>
|
13 |
+
<date>2014-10-13</date>
|
14 |
+
<time>08:57:07</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Adventos"><dir name="OrderExport"><dir name="Helper"><file name="Data.php" hash="f90dd7d2136cfb6349ba1d7ee939cd15"/></dir><dir name="Model"><dir name="Creditmemo"><dir name="Api"><file name="V2.php" hash="797a58eedbbe8bf1a0c20d7c8599f8be"/></dir><file name="Api.php" hash="c41e82cf79235d51f25d248719e93f92"/></dir><dir name="Invoice"><dir name="Api"><file name="V2.php" hash="3596dc5fe58a597ba5f244b52687288e"/></dir><file name="Api.php" hash="280512b1ae37690871384b3cba0a3a2b"/></dir><file name="Observer.php" hash="89f3df45a785633cca243b159ba6d9c6"/><dir name="Shipment"><dir name="Api"><file name="V2.php" hash="3d7824e13e4d5cedb755b4858398f23e"/></dir><file name="Api.php" hash="0b9bf452b7e36c1ee5cefbb3d6c5eb3b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="b9e0e5a0baabed9482061f5c7c12a5ff"/></dir></dir><dir name="etc"><file name="api.xml" hash="c1b2bc277e329b8191bcc5358cb96581"/><file name="config.xml" hash="b40c120be618fdfd7d1c298b1e2a99c5"/><file name="system.xml" hash="d7feaf247eed064d617138508dd88fe4"/><file name="wsdl.xml" hash="1538d2cb05f819c45e807f992c1b7cb3"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adventos_OrderExport.xml" hash="479b13bf3a08de9f93f5f58d77d3f9bb"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|