Version Notes
* Fix variant stock
Download this release
Release Info
Developer | Christiaan de Ridder |
Extension | Tritac_ChannelEngine |
Version | 3.3.0 |
Comparing to | |
See all releases |
Code changes from version 3.2.0 to 3.3.0
- app/code/community/Tritac/ChannelEngine/Model/Observer.php +8 -3
- app/code/community/Tritac/ChannelEngine/etc/config.xml +1 -1
- app/code/community/Tritac/ChannelEngine/etc/system.xml +1 -0
- app/design/frontend/base/default/template/channelengine/checkout/success.phtml +43 -0
- app/design/frontend/base/default/template/channelengine/head.phtml +12 -0
- lib/Tritac/ChannelEngineApiClient/Models/Order.php +12 -12
- package.xml +5 -5
app/code/community/Tritac/ChannelEngine/Model/Observer.php
CHANGED
@@ -466,8 +466,9 @@ class Tritac_ChannelEngine_Model_Observer
|
|
466 |
*/
|
467 |
public function generateFeed()
|
468 |
{
|
|
|
469 |
$start_memory = memory_get_usage();
|
470 |
-
|
471 |
/**
|
472 |
* Prepare categories array
|
473 |
*/
|
@@ -660,17 +661,21 @@ class Tritac_ChannelEngine_Model_Observer
|
|
660 |
|
661 |
$xml = $this->_getProductXml($parentData, $categoryArray, array('systemAttributes' => $systemAttributes, 'attributes' => $visibleAttributes));
|
662 |
|
663 |
-
$_childProducts = Mage::getModel('catalog/product_type_configurable')
|
|
|
|
|
|
|
664 |
|
665 |
foreach($_childProducts as $_child) {
|
666 |
$childData = $_child->getData();
|
|
|
667 |
$childData['id'] = $childData['entity_id'];
|
668 |
$childData['parent_id'] = $parentData['id'];
|
669 |
$childData['price'] = $parentData['price'];
|
670 |
$childData['url'] = $parentData['url'];
|
671 |
$childData['description'] = $parentData['description'];
|
672 |
|
673 |
-
if(isset($childData['stock_item']) && $childData['
|
674 |
$stock = $childData['stock_item']->getData();
|
675 |
$childData['qty'] = $stock['qty'];
|
676 |
}
|
466 |
*/
|
467 |
public function generateFeed()
|
468 |
{
|
469 |
+
@set_time_limit(15 * 60);
|
470 |
$start_memory = memory_get_usage();
|
471 |
+
|
472 |
/**
|
473 |
* Prepare categories array
|
474 |
*/
|
661 |
|
662 |
$xml = $this->_getProductXml($parentData, $categoryArray, array('systemAttributes' => $systemAttributes, 'attributes' => $visibleAttributes));
|
663 |
|
664 |
+
$_childProducts = Mage::getModel('catalog/product_type_configurable')
|
665 |
+
//->getUsedProductCollection($_product)
|
666 |
+
//->addAttributeToSelect($attributesToSelect);
|
667 |
+
->getUsedProducts(null, $_product);
|
668 |
|
669 |
foreach($_childProducts as $_child) {
|
670 |
$childData = $_child->getData();
|
671 |
+
|
672 |
$childData['id'] = $childData['entity_id'];
|
673 |
$childData['parent_id'] = $parentData['id'];
|
674 |
$childData['price'] = $parentData['price'];
|
675 |
$childData['url'] = $parentData['url'];
|
676 |
$childData['description'] = $parentData['description'];
|
677 |
|
678 |
+
if(isset($childData['stock_item']) && $childData['stock_item'] !== null) {
|
679 |
$stock = $childData['stock_item']->getData();
|
680 |
$childData['qty'] = $stock['qty'];
|
681 |
}
|
app/code/community/Tritac/ChannelEngine/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Tritac_ChannelEngine>
|
5 |
-
<version>3.
|
6 |
</Tritac_ChannelEngine>
|
7 |
</modules>
|
8 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Tritac_ChannelEngine>
|
5 |
+
<version>3.3.0</version>
|
6 |
</Tritac_ChannelEngine>
|
7 |
</modules>
|
8 |
|
app/code/community/Tritac/ChannelEngine/etc/system.xml
CHANGED
@@ -131,6 +131,7 @@
|
|
131 |
<comment>
|
132 |
<![CDATA[<span class="notice">You need to configure cronjobs on your server to generate feeds automatically</span>]]>
|
133 |
</comment>
|
|
|
134 |
<frontend_model>channelengine/adminhtml_system_config_feed</frontend_model>
|
135 |
<sort_order>5</sort_order>
|
136 |
<show_in_default>1</show_in_default>
|
131 |
<comment>
|
132 |
<![CDATA[<span class="notice">You need to configure cronjobs on your server to generate feeds automatically</span>]]>
|
133 |
</comment>
|
134 |
+
<frontend_type>button</frontend_type>
|
135 |
<frontend_model>channelengine/adminhtml_system_config_feed</frontend_model>
|
136 |
<sort_order>5</sort_order>
|
137 |
<show_in_default>1</show_in_default>
|
app/design/frontend/base/default/template/channelengine/checkout/success.phtml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
|
3 |
+
?>
|
4 |
+
<script>
|
5 |
+
ce('track:order', {
|
6 |
+
merchantOrderNo: '<?php echo($order->getId()); ?>',
|
7 |
+
total: <?php echo($order->getGrandTotal()); ?>,
|
8 |
+
vat: <?php echo($order->getTaxRefunded() ? $order->getTaxRefunded() : 0); ?>,
|
9 |
+
shippingCost: <?php echo($order->getShippingAmount() ? $order->getShippingAmount() : 0); ?>,
|
10 |
+
city: '<?php echo($order->getBillingAddress()->getCity()); ?>',
|
11 |
+
country: '<?php echo($order->getBillingAddress()->getCountry()); ?>',
|
12 |
+
orderLines: [
|
13 |
+
<?php foreach($order->getAllItems() as $item): ?>
|
14 |
+
|
15 |
+
<?php
|
16 |
+
$categoryIds = Mage::getModel('catalog/product')->load($item->getProductId())->getCategoryIds();
|
17 |
+
$categoryId = end($categoryIds);
|
18 |
+
$category = Mage::getModel('catalog/category')->load($categoryId);
|
19 |
+
$path = explode('/', $category->getPath());
|
20 |
+
$categoryPath = '';
|
21 |
+
|
22 |
+
foreach($path as $catId) {
|
23 |
+
if($catId > 2) {
|
24 |
+
$cat = Mage::getModel('catalog/category')->load($catId);
|
25 |
+
if($categoryPath != '') {
|
26 |
+
$categoryPath .= ' > ';
|
27 |
+
}
|
28 |
+
$categoryPath .= $cat->getName();
|
29 |
+
}
|
30 |
+
}
|
31 |
+
?>
|
32 |
+
{
|
33 |
+
merchantProductNo: '<?php echo($item->getProductId()); ?>',
|
34 |
+
name: '<?php echo($item->getProduct()->getName()); ?>',
|
35 |
+
category: '<?php echo($categoryPath); ?>',
|
36 |
+
price: <?php echo($item->getProduct()->getPrice()); ?>,
|
37 |
+
quantity: <?php echo(intval($item->getQtyOrdered())); ?>
|
38 |
+
},
|
39 |
+
<?php endforeach ?>
|
40 |
+
|
41 |
+
]
|
42 |
+
});
|
43 |
+
</script>
|
app/design/frontend/base/default/template/channelengine/head.phtml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if($this->getAccountName()): ?>
|
2 |
+
<script>
|
3 |
+
(function (T, r, i, t, a, c) {
|
4 |
+
T.ce = T.ce || function () { T.ce.eq = T.ce.eq || []; T.ce.eq.push(arguments); }, T.ce.url = t;
|
5 |
+
a = r.createElement(i); a.async = 1; a.src = t + '/content/scripts/ce.js';
|
6 |
+
c = r.getElementsByTagName(i)[0]; c.parentNode.insertBefore(a, c);
|
7 |
+
})(window, document, 'script', '//www.channelengine.net');
|
8 |
+
|
9 |
+
ce('set:account', '<?php echo($this->getAccountName()); ?>');
|
10 |
+
ce('track:click');
|
11 |
+
</script>
|
12 |
+
<?php endif ?>
|
lib/Tritac/ChannelEngineApiClient/Models/Order.php
CHANGED
@@ -18,9 +18,9 @@ class Tritac_ChannelEngineApiClient_Models_Order extends Tritac_ChannelEngineApi
|
|
18 |
protected $orderDate;
|
19 |
protected $createdAt;
|
20 |
protected $updatedAt;
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
protected $billingAddress;
|
25 |
protected $cancellations;
|
26 |
protected $channelName;
|
@@ -28,7 +28,7 @@ class Tritac_ChannelEngineApiClient_Models_Order extends Tritac_ChannelEngineApi
|
|
28 |
protected $canShipPartialOrderLines;
|
29 |
|
30 |
protected $merchantId;
|
31 |
-
|
32 |
protected $shippingCostsInclVat;
|
33 |
protected $shippingCostsVat;
|
34 |
protected $subTotalInclVat;
|
@@ -76,14 +76,14 @@ class Tritac_ChannelEngineApiClient_Models_Order extends Tritac_ChannelEngineApi
|
|
76 |
function setUpdatedAt( $updatedAt) { $this->updatedAt = $updatedAt; }
|
77 |
function getUpdatedAt() { return $this->updatedAt; }
|
78 |
|
79 |
-
|
80 |
-
|
81 |
|
82 |
-
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
87 |
|
88 |
function setBillingAddress(Tritac_ChannelEngineApiClient_Models_Address $billingAddress) { $this->billingAddress = $billingAddress; }
|
89 |
function getBillingAddress() { return $this->billingAddress; }
|
@@ -103,8 +103,8 @@ class Tritac_ChannelEngineApiClient_Models_Order extends Tritac_ChannelEngineApi
|
|
103 |
function setMerchantId($merchantId) { $this->merchantId = $merchantId; }
|
104 |
function getMerchantId() { return $this->merchantId; }
|
105 |
|
106 |
-
|
107 |
-
|
108 |
|
109 |
function setShippingCostsInclVat($shippingCostsInclVat) { $this->shippingCostsInclVat = $shippingCostsInclVat; }
|
110 |
function getShippingCostsInclVat() { return $this->shippingCostsInclVat; }
|
18 |
protected $orderDate;
|
19 |
protected $createdAt;
|
20 |
protected $updatedAt;
|
21 |
+
protected $channelId;
|
22 |
+
protected $channelOrderNo;
|
23 |
+
protected $channelCustomerNo;
|
24 |
protected $billingAddress;
|
25 |
protected $cancellations;
|
26 |
protected $channelName;
|
28 |
protected $canShipPartialOrderLines;
|
29 |
|
30 |
protected $merchantId;
|
31 |
+
protected $merchantOrderNo;
|
32 |
protected $shippingCostsInclVat;
|
33 |
protected $shippingCostsVat;
|
34 |
protected $subTotalInclVat;
|
76 |
function setUpdatedAt( $updatedAt) { $this->updatedAt = $updatedAt; }
|
77 |
function getUpdatedAt() { return $this->updatedAt; }
|
78 |
|
79 |
+
function setChannelId($channelId) { $this->channelId = $channelId; }
|
80 |
+
function getChannelId() { return $this->channelId; }
|
81 |
|
82 |
+
function setChannelOrderNo($channelOrderNo) { $this->channelOrderNo = $channelOrderNo; }
|
83 |
+
function getChannelOrderNo() { return $this->channelOrderNo; }
|
84 |
|
85 |
+
function setChannelCustomerNo($channelCustomerNo) { $this->channelCustomerNo = $channelCustomerNo; }
|
86 |
+
function getChannelCustomerNo() { return $this->channelCustomerNo; }
|
87 |
|
88 |
function setBillingAddress(Tritac_ChannelEngineApiClient_Models_Address $billingAddress) { $this->billingAddress = $billingAddress; }
|
89 |
function getBillingAddress() { return $this->billingAddress; }
|
103 |
function setMerchantId($merchantId) { $this->merchantId = $merchantId; }
|
104 |
function getMerchantId() { return $this->merchantId; }
|
105 |
|
106 |
+
function setMerchantOrderNo($merchantOrderNo) { $this->merchantOrderNo = $merchantOrderNo; }
|
107 |
+
function getMerchantOrderNo() { return $this->merchantOrderNo; }
|
108 |
|
109 |
function setShippingCostsInclVat($shippingCostsInclVat) { $this->shippingCostsInclVat = $shippingCostsInclVat; }
|
110 |
function getShippingCostsInclVat() { return $this->shippingCostsInclVat; }
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tritac_ChannelEngine</name>
|
4 |
-
<version>3.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -20,11 +20,11 @@ Features of ChannelEngine:
|
|
20 |
* Receive orders from marketplaces using one single connection.
|
21 |
* Using this magento extension you can connect to ChannelEngine instantly without any further configuration.
|
22 |
* For more information, visit: ChannelEngine.com</description>
|
23 |
-
<notes>*
|
24 |
<authors><author><name>Christiaan de Ridder</name><user>christiaander</user><email>support@channelengine.com</email></author></authors>
|
25 |
-
<date>2016-
|
26 |
-
<time>
|
27 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Tritac_ChannelEngine.xml" hash="f6b4a6d9af9aa3bcd3019fd566d6a67c"/></dir></target><target name="magecommunity"><dir name="Tritac"><dir name="ChannelEngine"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Feed.php" hash="004083344207a444e00ebaf4a86835b9"/></dir></dir></dir><file name="Head.php" hash="74004d8749f6267c4ce024b47970af23"/></dir><dir name="Helper"><file name="Data.php" hash="7517ee0d0acd0567e1f1f14cf794107c"/></dir><dir name="Model"><dir name="Carrier"><file name="Channelengine.php" hash="b6e04e43096e934d57e8e8745dd67c75"/></dir><file name="Observer.php" hash="
|
28 |
<compatible/>
|
29 |
<dependencies><required><php><min>5.5.0</min><max>7.0.6</max></php><extension><name>curl</name><min>7.0</min><max>7.50</max></extension></required></dependencies>
|
30 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tritac_ChannelEngine</name>
|
4 |
+
<version>3.3.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
20 |
* Receive orders from marketplaces using one single connection.
|
21 |
* Using this magento extension you can connect to ChannelEngine instantly without any further configuration.
|
22 |
* For more information, visit: ChannelEngine.com</description>
|
23 |
+
<notes>* Fix variant stock</notes>
|
24 |
<authors><author><name>Christiaan de Ridder</name><user>christiaander</user><email>support@channelengine.com</email></author></authors>
|
25 |
+
<date>2016-11-29</date>
|
26 |
+
<time>15:36:36</time>
|
27 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Tritac_ChannelEngine.xml" hash="f6b4a6d9af9aa3bcd3019fd566d6a67c"/></dir></target><target name="magecommunity"><dir name="Tritac"><dir name="ChannelEngine"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Feed.php" hash="004083344207a444e00ebaf4a86835b9"/></dir></dir></dir><file name="Head.php" hash="74004d8749f6267c4ce024b47970af23"/></dir><dir name="Helper"><file name="Data.php" hash="7517ee0d0acd0567e1f1f14cf794107c"/></dir><dir name="Model"><dir name="Carrier"><file name="Channelengine.php" hash="b6e04e43096e934d57e8e8745dd67c75"/></dir><file name="Observer.php" hash="e81e09a3b617bc6ae38a6ce9151ec50e"/><file name="Order.php" hash="7b5d59152a0341cf5bff5b7adf6c76b7"/><dir name="Payment"><dir name="Method"><file name="Channelengine.php" hash="b938300284d504de42dd04777c45c75b"/></dir></dir><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="fedd812bdf0090a36ce7bdd23e7876f5"/></dir><file name="Order.php" hash="cab73cceec877cda4daadc5c66f356fe"/><file name="Setup.php" hash="ed5ca35f61e6158a8b617630ae84c5b8"/><dir name="Shipment"><file name="Collection.php" hash="56e7c3bee221edefdcb587801bd36cc2"/></dir><file name="Shipment.php" hash="e09302f0ff110b94fc34031ee9255caa"/></dir><file name="Shipment.php" hash="5aa413e4e1ca441456d0d28ed541d2fc"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Gtin.php" hash="d2c18169dfaf87a01d9d7357329f1c78"/><file name="Shipping.php" hash="00d71eaebba3014fe9d17ee75f7cf0a9"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="GenerateController.php" hash="b69ead94a34e01bdf093ee6282b66c18"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="2a9dc6ac1738bebb470c1aa699478467"/><file name="config.xml" hash="f9894272ec6047226a16d701863982e1"/><file name="system.xml" hash="ebd9a53cd2b8bc9c7c0ab19c68996d8c"/></dir><dir name="sql"><dir name="channelengine_setup"><file name="mysql4-install-1.0.0.php" hash="6d04678d7750ff3de5a9eb697c13d52f"/><file name="mysql4-upgrade-2.6.0-2.7.0.php" hash="1f8c2f9d0239c9fbf31d3bfdd1c6cc46"/></dir></dir></dir></dir></target><target name="magelib"><dir name="Tritac"><dir name="ChannelEngineApiClient"><file name="AddTrustExternalCARoot.crt" hash="f85d1ff17b0079709f131f3ce3f288d2"/><file name="Client.php" hash="9e0065d5902495dcf12c6526a6309998"/><dir name="Enums"><file name="CancellationLineStatus.php" hash="b48713c95dea7855255eca6d9af68ba4"/><file name="CancellationStatus.php" hash="ea61f9cdf047d615c63d49e943ef7776"/><file name="Gender.php" hash="ec9d3e083df38a188c57b1015e011bce"/><file name="MancoReason.php" hash="b5a7ecf30975a494223df3135e111760"/><file name="OrderStatus.php" hash="451569e1788da5f08b01527ee86463cd"/><file name="ReturnAcceptStatus.php" hash="760598e7176288210d349686899e76aa"/><file name="ReturnReason.php" hash="9d8aea80edbb7d012e7abcbb0f54d5e4"/><file name="ReturnStatus.php" hash="7827e8d3b27faf6073835ecbcde1db6b"/><file name="ShipmentLineStatus.php" hash="ccdddd9f80610cbf284154db5930247a"/><file name="ShipmentStatus.php" hash="0b0351af3409590614ff249e1bac688e"/></dir><dir name="Helpers"><file name="Collection.php" hash="4dcae246e9de6e847818dc3be49ddad0"/><file name="HttpMethod.php" hash="79b753f221780fbf75773669cf3d1f86"/><file name="JsonMapper.php" hash="c8742a0636d3f866c8a1c2c97365cfb8"/></dir><dir name="Models"><file name="Address.php" hash="49a1cd2a405ba2832f638979a14c7187"/><file name="BaseModel.php" hash="9604e198f22fef25d60992c2cb9f506c"/><file name="Cancellation.php" hash="edddc28fc842661311da1d79f9b6b634"/><file name="CancellationLine.php" hash="f2eb604ccc7ea5678941394cb5861c48"/><file name="Message.php" hash="658c867e131588eb2520c349d6ebc5a7"/><file name="Order.php" hash="11df07d8acb3fc985b3eec812955ef42"/><file name="OrderExtraDataItem.php" hash="965abccf11c8157b7fd85e05a8ef4e28"/><file name="OrderLine.php" hash="78252a465c5f1b9b1c5e23c8ce09552d"/><file name="ReturnLine.php" hash="c011dfcf44f25b255e529fd26755fbd9"/><file name="ReturnObject.php" hash="28378a651ad7e41b127bfd1839f25dad"/><file name="Shipment.php" hash="c8903a23b59a1cada56b8518db56ce2d"/><file name="ShipmentLine.php" hash="0ca0e5441553f722ade5ad5924c9f801"/></dir><file name="loader.php" hash="5bba6033b0bdc5cb87afdbdde2deadf9"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="channelengine.xml" hash="ae6a00b46a84a610964743034eb72081"/></dir><dir name="template"><dir name="channelengine"><dir name="checkout"><file name="success.phtml" hash="dbcb8298cd52a3c44560ae911349a3c7"/></dir><file name="head.phtml" hash="a7a7ab566adc1dc7d2645bf1cdfac0d4"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="channelengine"><dir name="system"><dir name="config"><dir name="feed"><file name="generate_button.phtml" hash="ed8c5f4a81f19c7ceaacd1b1c004772e"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
28 |
<compatible/>
|
29 |
<dependencies><required><php><min>5.5.0</min><max>7.0.6</max></php><extension><name>curl</name><min>7.0</min><max>7.50</max></extension></required></dependencies>
|
30 |
</package>
|