Version Notes
* You can now add tracking codes in ChannelEngine after shipping an order
Download this release
Release Info
| Developer | Christiaan de Ridder |
| Extension | Tritac_ChannelEngine |
| Version | 2.7.0 |
| Comparing to | |
| See all releases | |
Code changes from version 2.5.0 to 2.7.0
- app/code/community/Tritac/ChannelEngine/Model/Observer.php +81 -86
- app/code/community/Tritac/ChannelEngine/Model/Resource/Shipment.php +34 -0
- app/code/community/Tritac/ChannelEngine/Model/Resource/Shipment/Collection.php +7 -0
- app/code/community/Tritac/ChannelEngine/Model/Shipment.php +20 -0
- app/code/community/Tritac/ChannelEngine/etc/config.xml +4 -1
- app/code/community/Tritac/ChannelEngine/sql/channelengine_setup/mysql4-upgrade-2.5.0-2.6.0.php +25 -0
- app/code/community/Tritac/ChannelEngine/sql/channelengine_setup/mysql4-upgrade-2.6.0-2.7.0.php +25 -0
- lib/Tritac/ChannelEngineApiClient/Client.php +11 -0
- package.xml +5 -5
app/code/community/Tritac/ChannelEngine/Model/Observer.php
CHANGED
|
@@ -4,7 +4,6 @@
|
|
| 4 |
*/
|
| 5 |
class Tritac_ChannelEngine_Model_Observer
|
| 6 |
{
|
| 7 |
-
|
| 8 |
/**
|
| 9 |
* API client
|
| 10 |
*
|
|
@@ -52,7 +51,7 @@ class Tritac_ChannelEngine_Model_Observer
|
|
| 52 |
|
| 53 |
/**
|
| 54 |
* Fetch new orders from ChannelEngine.
|
| 55 |
-
*
|
| 56 |
*
|
| 57 |
* @return bool
|
| 58 |
*/
|
|
@@ -276,115 +275,111 @@ class Tritac_ChannelEngine_Model_Observer
|
|
| 276 |
* @return bool
|
| 277 |
* @throws Exception
|
| 278 |
*/
|
| 279 |
-
public function
|
| 280 |
{
|
|
|
|
| 281 |
$event = $observer->getEvent();
|
| 282 |
/** @var $_shipment Mage_Sales_Model_Order_Shipment */
|
| 283 |
$_shipment = $event->getShipment();
|
|
|
|
| 284 |
/** @var $_order Mage_Sales_Model_Order */
|
| 285 |
$_order = $_shipment->getOrder();
|
| 286 |
|
| 287 |
$storeId = $_order->getStoreId();
|
| 288 |
-
|
| 289 |
-
$
|
|
|
|
| 290 |
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
if(
|
| 295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
*/
|
| 300 |
-
if(!isset($this->_client[$storeId]))
|
| 301 |
-
return false;
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
);
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
}
|
| 314 |
|
| 315 |
-
|
| 316 |
-
// Initialize new ChannelEngine shipment object
|
| 317 |
-
$shipment = new Tritac_ChannelEngineApiClient_Models_Shipment();
|
| 318 |
-
$shipment->setOrderId($channelOrderId);
|
| 319 |
-
$shipment->setMerchantShipmentNo($_shipment->getId());
|
| 320 |
-
$shipment->setTrackTraceNo($_track->getNumber());
|
| 321 |
-
$shipment->setMethod($_track->getTitle());
|
| 322 |
|
| 323 |
-
|
| 324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
|
| 326 |
-
|
|
|
|
|
|
|
| 327 |
|
| 328 |
-
|
| 329 |
-
|
|
|
|
|
|
|
| 330 |
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
foreach ($_shipment->getItemsCollection() as $item) {
|
| 334 |
-
if ($item->getOrderItemId()==$_orderItem->getId()) {
|
| 335 |
-
$_shipmentItem = $item;
|
| 336 |
-
break;
|
| 337 |
-
}
|
| 338 |
-
}
|
| 339 |
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
}
|
| 343 |
|
| 344 |
-
|
| 345 |
-
$orderedQty = (int) $_orderItem->getQtyOrdered();
|
| 346 |
-
$shippedQty = (int) $_orderItemOrigin->getQtyShipped();
|
| 347 |
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
continue;
|
| 351 |
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
$shipmentLine = new Tritac_ChannelEngineApiClient_Models_ShipmentLine();
|
| 355 |
-
// Fill required data
|
| 356 |
-
$shipmentLine->setShipmentId($_shipment->getId());
|
| 357 |
-
$shipmentLine->setOrderLineId($_orderItem->getChannelengineOrderLineId());
|
| 358 |
-
$shipmentLine->setQuantity($orderedQty - $qtyToShip - $shippedQty);
|
| 359 |
-
$shipmentLine->setStatus(Tritac_ChannelEngineApiClient_Enums_ShipmentLineStatus::IN_BACKORDER);
|
| 360 |
-
$expectedDate = $this->_helper->getExpectedShipmentDate($storeId);
|
| 361 |
-
$shipmentLine->setExpectedDate($expectedDate->format('Y-m-d'));
|
| 362 |
-
$shipmentLines[] = $shipmentLine;
|
| 363 |
-
// Put shipment line to shipments collection
|
| 364 |
-
$linesCollection->append($shipmentLine);
|
| 365 |
-
}
|
| 366 |
-
// Initialize new ChannelEngine Shipment Line
|
| 367 |
-
if($qtyToShip > 0) {
|
| 368 |
-
$shipmentLine = new Tritac_ChannelEngineApiClient_Models_ShipmentLine();
|
| 369 |
-
// Fill required data
|
| 370 |
-
$shipmentLine->setShipmentId($_shipment->getId());
|
| 371 |
-
$shipmentLine->setOrderLineId($_orderItem->getChannelengineOrderLineId());
|
| 372 |
-
$shipmentLine->setQuantity($qtyToShip);
|
| 373 |
-
$shipmentLine->setStatus(Tritac_ChannelEngineApiClient_Enums_ShipmentLineStatus::SHIPPED);
|
| 374 |
-
$shipmentLines[] = $shipmentLine;
|
| 375 |
-
// Put shipment line to shipments collection
|
| 376 |
-
$linesCollection->append($shipmentLine);
|
| 377 |
-
}
|
| 378 |
-
}
|
| 379 |
|
| 380 |
-
$shipment
|
| 381 |
-
|
| 382 |
-
|
|
|
|
|
|
|
|
|
|
| 383 |
|
| 384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
|
| 386 |
-
return true;
|
| 387 |
}
|
|
|
|
|
|
|
|
|
|
| 388 |
}
|
| 389 |
|
| 390 |
/**
|
| 4 |
*/
|
| 5 |
class Tritac_ChannelEngine_Model_Observer
|
| 6 |
{
|
|
|
|
| 7 |
/**
|
| 8 |
* API client
|
| 9 |
*
|
| 51 |
|
| 52 |
/**
|
| 53 |
* Fetch new orders from ChannelEngine.
|
| 54 |
+
* Ran by cron. The cronjob is set in extension config file.
|
| 55 |
*
|
| 56 |
* @return bool
|
| 57 |
*/
|
| 275 |
* @return bool
|
| 276 |
* @throws Exception
|
| 277 |
*/
|
| 278 |
+
public function saveShipment(Varien_Event_Observer $observer)
|
| 279 |
{
|
| 280 |
+
Mage::log('--------------------------------------');
|
| 281 |
$event = $observer->getEvent();
|
| 282 |
/** @var $_shipment Mage_Sales_Model_Order_Shipment */
|
| 283 |
$_shipment = $event->getShipment();
|
| 284 |
+
|
| 285 |
/** @var $_order Mage_Sales_Model_Order */
|
| 286 |
$_order = $_shipment->getOrder();
|
| 287 |
|
| 288 |
$storeId = $_order->getStoreId();
|
| 289 |
+
|
| 290 |
+
$ceOrder = Mage::getModel('channelengine/order')->loadByOrderId($_order->getId());
|
| 291 |
+
$ceOrderId = $ceOrder->getChannelOrderId();
|
| 292 |
|
| 293 |
+
if(!$ceOrderId) return false;
|
| 294 |
+
|
| 295 |
+
// Check if the API client was initialized for this order
|
| 296 |
+
if(!isset($this->_client[$storeId])) return false;
|
| 297 |
+
|
| 298 |
+
// Initialize new ChannelEngine shipment object
|
| 299 |
+
$ceShipment = new Tritac_ChannelEngineApiClient_Models_Shipment();
|
| 300 |
+
$ceShipment->setOrderId($ceOrderId);
|
| 301 |
+
$ceShipment->setMerchantShipmentNo($_shipment->getId());
|
| 302 |
+
|
| 303 |
+
// Set tracking info if available
|
| 304 |
+
$trackingCode = null;
|
| 305 |
+
$trackingCodes = $_shipment->getAllTracks();
|
| 306 |
+
if(count($trackingCodes) > 0) {
|
| 307 |
+
|
| 308 |
+
$trackingCode = $trackingCodes[0];
|
| 309 |
+
$ceShipment->setTrackTraceNo($trackingCode->getNumber());
|
| 310 |
+
$ceShipment->setMethod($trackingCode->getTitle());
|
| 311 |
+
}
|
| 312 |
|
| 313 |
+
// If the shipment is already known to ChannelEngine we will just update it
|
| 314 |
+
$_channelShipment = Mage::getModel('channelengine/shipment')->loadByShipmentId($_shipment->getId());
|
|
|
|
|
|
|
|
|
|
| 315 |
|
| 316 |
+
if($_channelShipment->getId() != null) {
|
| 317 |
+
|
| 318 |
+
if($trackingCode != null) {
|
| 319 |
+
Mage::Log("TrackTrace: {$trackingCode->getNumber()}");
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
Mage::log("CE Shipment Id: #{$_channelShipment->getChannelengineShipmentId()}");
|
| 323 |
+
$ceShipment->setId($_channelShipment->getChannelengineShipmentId());
|
| 324 |
+
$this->_client[$storeId]->putShipment($ceShipment);
|
| 325 |
+
return true;
|
| 326 |
}
|
| 327 |
|
| 328 |
+
Mage::log('New shipment, continue');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
|
| 330 |
+
// Add the shipment lines
|
| 331 |
+
$ceShipmentLines = new Tritac_ChannelEngineApiClient_Helpers_Collection('Tritac_ChannelEngineApiClient_Models_ShipmentLine');
|
| 332 |
+
foreach($_shipment->getAllItems() as $_shipmentItem) {
|
| 333 |
+
|
| 334 |
+
// Get the quantity for this shipment
|
| 335 |
+
$shippedQty = (int)$_shipmentItem->getQty();
|
| 336 |
+
if($shippedQty == 0) continue;
|
| 337 |
|
| 338 |
+
// Get the original order item
|
| 339 |
+
$_orderItem = Mage::getModel('sales/order_item')->load($_shipmentItem->getOrderItemId());
|
| 340 |
+
if($_orderItem == null) continue;
|
| 341 |
|
| 342 |
+
$ceShipmentLine = new Tritac_ChannelEngineApiClient_Models_ShipmentLine();
|
| 343 |
+
$ceShipmentLine->setOrderLineId($_orderItem->getChannelengineOrderLineId());
|
| 344 |
+
$ceShipmentLine->setQuantity($shippedQty);
|
| 345 |
+
$ceShipmentLine->setStatus(Tritac_ChannelEngineApiClient_Enums_ShipmentLineStatus::SHIPPED);
|
| 346 |
|
| 347 |
+
$ceShipmentLines->append($ceShipmentLine);
|
| 348 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
|
| 350 |
+
// Check if there are any shipment lines
|
| 351 |
+
if(count($ceShipmentLines) == 0) return false;
|
|
|
|
| 352 |
|
| 353 |
+
$ceShipment->setLines($ceShipmentLines);
|
|
|
|
|
|
|
| 354 |
|
| 355 |
+
// Post shipment to ChannelEngine
|
| 356 |
+
try{
|
|
|
|
| 357 |
|
| 358 |
+
$result = $this->_client[$storeId]->postShipment($ceShipment);
|
| 359 |
+
if($result == null) return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 360 |
|
| 361 |
+
$_channelShipment = Mage::getModel('channelengine/shipment')
|
| 362 |
+
->setShipmentId($_shipment->getId())
|
| 363 |
+
->setChannelengineShipmentId($result->getId());
|
| 364 |
+
$_channelShipment->save();
|
| 365 |
+
|
| 366 |
+
Mage::log("Shipment #{$_shipment->getId()} (CE #{$result->getId()}) was placed successfully.");
|
| 367 |
|
| 368 |
+
|
| 369 |
+
|
| 370 |
+
} catch(Exception $e) {
|
| 371 |
+
|
| 372 |
+
Mage::getModel('adminnotification/inbox')->addCritical(
|
| 373 |
+
"A shipment (#{$_shipment->getId()}) could not be exported",
|
| 374 |
+
"Please contact ChannelEngine support at <a href='mailto:support@channelengine.com'>support@channelengine.com</a> or +31(0)71-5288792"
|
| 375 |
+
);
|
| 376 |
+
|
| 377 |
+
Mage::logException($e);
|
| 378 |
|
|
|
|
| 379 |
}
|
| 380 |
+
|
| 381 |
+
|
| 382 |
+
return true;
|
| 383 |
}
|
| 384 |
|
| 385 |
/**
|
app/code/community/Tritac/ChannelEngine/Model/Resource/Shipment.php
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Tritac_ChannelEngine_Model_Resource_Shipment extends Mage_Core_Model_Resource_Db_Abstract {
|
| 3 |
+
|
| 4 |
+
protected function _construct()
|
| 5 |
+
{
|
| 6 |
+
$this->_init('channelengine/shipment', 'entity_id');
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Load channel shipment by magento shipment ID
|
| 11 |
+
*
|
| 12 |
+
* @param Tritac_ChannelEngine_Model_Shipment $shipment
|
| 13 |
+
* @param int $shipmentId
|
| 14 |
+
* @return Tritac_ChannelEngine_Model_Resource_Shipment
|
| 15 |
+
*/
|
| 16 |
+
public function loadByShipmentId(Tritac_ChannelEngine_Model_Shipment $shipment, $shipmentId)
|
| 17 |
+
{
|
| 18 |
+
|
| 19 |
+
$adapter = $this->_getReadAdapter();
|
| 20 |
+
$bind = array('shipment_id' => $shipmentId);
|
| 21 |
+
$select = $adapter->select()
|
| 22 |
+
->from($this->getMainTable(), array($this->getIdFieldName()))
|
| 23 |
+
->where('shipment_id = :shipment_id');
|
| 24 |
+
|
| 25 |
+
$entityId = $adapter->fetchOne($select, $bind);
|
| 26 |
+
if ($entityId) {
|
| 27 |
+
$this->load($shipment, $entityId );
|
| 28 |
+
} else {
|
| 29 |
+
$shipment->setData(array());
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
return $this;
|
| 33 |
+
}
|
| 34 |
+
}
|
app/code/community/Tritac/ChannelEngine/Model/Resource/Shipment/Collection.php
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Tritac_ChannelEngine_Model_Resource_Shipment_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
|
| 3 |
+
|
| 4 |
+
protected function _construct() {
|
| 5 |
+
$this->_init('channelengine/shipment');
|
| 6 |
+
}
|
| 7 |
+
}
|
app/code/community/Tritac/ChannelEngine/Model/Shipment.php
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Tritac_ChannelEngine_Model_Shipment extends Mage_Core_Model_Abstract {
|
| 3 |
+
|
| 4 |
+
protected function _construct()
|
| 5 |
+
{
|
| 6 |
+
$this->_init('channelengine/shipment');
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Load channel shipment by magento shipment ID
|
| 11 |
+
*
|
| 12 |
+
* @param $shipmentId
|
| 13 |
+
* @return Tritac_ChannelEngine_Model_Shipment
|
| 14 |
+
*/
|
| 15 |
+
public function loadByShipmentId($shipmentId)
|
| 16 |
+
{
|
| 17 |
+
$this->_getResource()->loadByShipmentId($this, $shipmentId);
|
| 18 |
+
return $this;
|
| 19 |
+
}
|
| 20 |
+
}
|
app/code/community/Tritac/ChannelEngine/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Tritac_ChannelEngine>
|
| 5 |
-
<version>2.
|
| 6 |
</Tritac_ChannelEngine>
|
| 7 |
</modules>
|
| 8 |
|
|
@@ -28,6 +28,9 @@
|
|
| 28 |
<order>
|
| 29 |
<table>channelengine_order</table>
|
| 30 |
</order>
|
|
|
|
|
|
|
|
|
|
| 31 |
</entities>
|
| 32 |
</channelengine_resource>
|
| 33 |
</models>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Tritac_ChannelEngine>
|
| 5 |
+
<version>2.7.0</version>
|
| 6 |
</Tritac_ChannelEngine>
|
| 7 |
</modules>
|
| 8 |
|
| 28 |
<order>
|
| 29 |
<table>channelengine_order</table>
|
| 30 |
</order>
|
| 31 |
+
<shipment>
|
| 32 |
+
<table>channelengine_shipment</table>
|
| 33 |
+
</shipment>
|
| 34 |
</entities>
|
| 35 |
</channelengine_resource>
|
| 36 |
</models>
|
app/code/community/Tritac/ChannelEngine/sql/channelengine_setup/mysql4-upgrade-2.5.0-2.6.0.php
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$installer = $this;
|
| 4 |
+
$installer->startSetup();
|
| 5 |
+
|
| 6 |
+
$table = $installer->getConnection()
|
| 7 |
+
->newTable($installer->getTable('channelengine/shipment'))
|
| 8 |
+
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
| 9 |
+
'identity' => true,
|
| 10 |
+
'nullable' => false,
|
| 11 |
+
'primary' => true,
|
| 12 |
+
), 'Entity ID')
|
| 13 |
+
->addColumn('shipment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
| 14 |
+
'nullable' => false,
|
| 15 |
+
'unsigned' => true,
|
| 16 |
+
), 'Magento Shipment ID')
|
| 17 |
+
->addColumn('channelengine_shipment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
| 18 |
+
'nullable' => false,
|
| 19 |
+
'unsigned' => true,
|
| 20 |
+
), 'ChannelEngine Shipment ID')
|
| 21 |
+
->setComment('ChannelEngine Shipment ID');
|
| 22 |
+
|
| 23 |
+
$installer->getConnection()->createTable($table);
|
| 24 |
+
|
| 25 |
+
$installer->endSetup();
|
app/code/community/Tritac/ChannelEngine/sql/channelengine_setup/mysql4-upgrade-2.6.0-2.7.0.php
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$installer = $this;
|
| 4 |
+
$installer->startSetup();
|
| 5 |
+
|
| 6 |
+
$table = $installer->getConnection()
|
| 7 |
+
->newTable($installer->getTable('channelengine/shipment'))
|
| 8 |
+
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
| 9 |
+
'identity' => true,
|
| 10 |
+
'nullable' => false,
|
| 11 |
+
'primary' => true,
|
| 12 |
+
), 'Entity ID')
|
| 13 |
+
->addColumn('shipment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
| 14 |
+
'nullable' => false,
|
| 15 |
+
'unsigned' => true,
|
| 16 |
+
), 'Magento Shipment ID')
|
| 17 |
+
->addColumn('channelengine_shipment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
| 18 |
+
'nullable' => false,
|
| 19 |
+
'unsigned' => true,
|
| 20 |
+
), 'ChannelEngine Shipment ID')
|
| 21 |
+
->setComment('ChannelEngine Shipment ID');
|
| 22 |
+
|
| 23 |
+
$installer->getConnection()->createTable($table);
|
| 24 |
+
|
| 25 |
+
$installer->endSetup();
|
lib/Tritac/ChannelEngineApiClient/Client.php
CHANGED
|
@@ -91,6 +91,17 @@ class Tritac_ChannelEngineApiClient_Client {
|
|
| 91 |
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Models_Shipment');
|
| 92 |
}
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
/* RETURNS */
|
| 95 |
|
| 96 |
/**
|
| 91 |
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Models_Shipment');
|
| 92 |
}
|
| 93 |
|
| 94 |
+
/**
|
| 95 |
+
* Update an existing Shipment
|
| 96 |
+
* @param ChannelEngineApiClient\Models\Shipment $shipment The shipment to send
|
| 97 |
+
*/
|
| 98 |
+
public function putShipment(Tritac_ChannelEngineApiClient_Models_Shipment $shipment)
|
| 99 |
+
{
|
| 100 |
+
$url = self::BASE_PATH . self::SHIPMENTS_PATH;
|
| 101 |
+
$result = $this->makeRequest(Tritac_ChannelEngineApiClient_Helpers_HttpMethod::PUT, $url, '', Tritac_ChannelEngineApiClient_Helpers_JsonMapper::toJson($shipment));
|
| 102 |
+
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Models_Shipment');
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
/* RETURNS */
|
| 106 |
|
| 107 |
/**
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Tritac_ChannelEngine</name>
|
| 4 |
-
<version>2.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Connect your Magento shop to the ChannelEngine platform.</summary>
|
| 10 |
<description>Easily offer your products on comparison websites and marketplaces using the ChannelEngine platform.</description>
|
| 11 |
-
<notes>*
|
| 12 |
<authors><author><name>ChannelEngine</name><user>christiaander</user><email>christiaan@tritac.com</email></author></authors>
|
| 13 |
-
<date>2014-09-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Tritac_ChannelEngine.xml" hash="014b02d581d1039764cdc422e8f86643"/></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="cbc5bf15ab9cd9bb5b2bc97375db3eb2"/></dir></dir></dir><file name="Head.php" hash="98a65067f1ae6074f2c276624164c183"/><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="097e10d1e9e6dd8c5aee66124376cae4"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="bf1203d5f080b340404f02c51967f328"/></dir><dir name="Model"><dir name="Carrier"><file name="Channelengine.php" hash="a9f4a062739d3ae4c542093888a0f5fc"/></dir><file name="Observer.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Tritac_ChannelEngine</name>
|
| 4 |
+
<version>2.7.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>
|
| 8 |
<extends/>
|
| 9 |
<summary>Connect your Magento shop to the ChannelEngine platform.</summary>
|
| 10 |
<description>Easily offer your products on comparison websites and marketplaces using the ChannelEngine platform.</description>
|
| 11 |
+
<notes>* You can now add tracking codes in ChannelEngine after shipping an order</notes>
|
| 12 |
<authors><author><name>ChannelEngine</name><user>christiaander</user><email>christiaan@tritac.com</email></author></authors>
|
| 13 |
+
<date>2014-09-04</date>
|
| 14 |
+
<time>14:22:24</time>
|
| 15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Tritac_ChannelEngine.xml" hash="014b02d581d1039764cdc422e8f86643"/></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="cbc5bf15ab9cd9bb5b2bc97375db3eb2"/></dir></dir></dir><file name="Head.php" hash="98a65067f1ae6074f2c276624164c183"/><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="097e10d1e9e6dd8c5aee66124376cae4"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="bf1203d5f080b340404f02c51967f328"/></dir><dir name="Model"><dir name="Carrier"><file name="Channelengine.php" hash="a9f4a062739d3ae4c542093888a0f5fc"/></dir><file name="Observer.php" hash="d358102987b485b0a2cec5779e9ed3de"/><file name="Order.php" hash="66c8e7c0ac47f9dbabb156eaa8c97f1e"/><dir name="Payment"><dir name="Method"><file name="Channelengine.php" hash="49ef02953b486cfbf813d37e681172a3"/></dir></dir><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="989bbd95481d2954d7813e19d8c27d18"/></dir><file name="Order.php" hash="3813fe3ad637daf069d79bca1feea540"/><file name="Setup.php" hash="24934fe022e3bb93331fcbfb7a116d37"/><dir name="Shipment"><file name="Collection.php" hash="2d4c72b65c0307cf40d0cf4dfdfba654"/></dir><file name="Shipment.php" hash="5e881080c990a0ba3d2b10084133a0c8"/></dir><file name="Shipment.php" hash="e61312be8fc74ac745951567dec0bda3"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Gtin.php" hash="d182d37bc836ef718858c985c27b3c3c"/><file name="Shipping.php" hash="103486f575dcd6205fc9cfd40f2fa5ea"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="GenerateController.php" hash="edde582db1fbb091e14396b247cd0d45"/></dir><file name="TestController.php" hash="1f579ff8fd8ffeb9a8ce25dde0d0fc11"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5a976b638c6ad66287ba3084fdbfc157"/><file name="config.xml" hash="777f008b387868ae43e953549d91e254"/><file name="system.xml" hash="de0e1158e239833891707739313ac8c6"/></dir><dir name="sql"><dir name="channelengine_setup"><file name="mysql4-install-0.1.0.0.php" hash="312e7c69f98c8d13d251b8ed1ca93448"/><file name="mysql4-install-1.0.0.php" hash="3664f3c5b6e01db69cbea8b4b0beb9ab"/><file name="mysql4-upgrade-2.5.0-2.6.0.php" hash="c71593dfb564cae848aa7846201bd708"/><file name="mysql4-upgrade-2.6.0-2.7.0.php" hash="c71593dfb564cae848aa7846201bd708"/></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="559c57f945fdb7cd4fea599979bc16d8"/><dir name="Enums"><file name="CancellationLineStatus.php" hash="0fe455ad75e49b2796d4bcd1230a3c0d"/><file name="CancellationStatus.php" hash="e4a26c1a29afe02d92320187277f5d03"/><file name="Gender.php" hash="49645506c67b6ad530e1463da256d403"/><file name="MancoReason.php" hash="80388c0545fa091fd9e651fc1284b77d"/><file name="OrderStatus.php" hash="855341235149ff3c9d3a36a5a23f8db0"/><file name="ReturnAcceptStatus.php" hash="de4252a8f9d7b94493b470cccd9feaec"/><file name="ReturnReason.php" hash="05d5fd5b23af84508b8bec92137c421d"/><file name="ReturnStatus.php" hash="ba9350e9ba015ec9cac4b1ab7702333c"/><file name="ShipmentLineStatus.php" hash="8329dce7182fc7705bb8008da6a7e26f"/><file name="ShipmentStatus.php" hash="d73e4a5b58487c7b0c80b114601d3279"/></dir><dir name="Helpers"><file name="Collection.php" hash="2278a5e6d8d65ebca92ba1e968680315"/><file name="HttpMethod.php" hash="4949b2cfe4a309a54b1642fa09bda53b"/><file name="JsonMapper.php" hash="f8e30cab83a2f2ccfdb2a64636c2346b"/></dir><dir name="Models"><file name="Address.php" hash="543aff76425e3335cbba2a1cdd25564d"/><file name="BaseModel.php" hash="65f09d298baa6496807a2f71ea93a8f8"/><file name="Cancellation.php" hash="4e845b4bd2076a5426f13e6763b41271"/><file name="CancellationLine.php" hash="e8820be847e77d5f77a2de8cb551a8a0"/><file name="Message.php" hash="e0cea12494684d58abea051958082036"/><file name="Order.php" hash="db5ecd35bf5e2158ac27565bd1c95a8a"/><file name="OrderExtraDataItem.php" hash="eaf59ef83070360c4c7bb2c3f5c5633a"/><file name="OrderLine.php" hash="11372030afba1ed751e5a99ccf14d7c9"/><file name="ReturnLine.php" hash="c1cbf7c45a85280782955be400c478e6"/><file name="ReturnObject.php" hash="6cf979eb91ce737464620575ada1c8e9"/><file name="Shipment.php" hash="246d699692e4fd9bad5db370648f717f"/><file name="ShipmentLine.php" hash="5c738023584cd6513940be54b8f8dc60"/></dir><file name="loader.php" hash="3daea8be627858c27383a79a29663c82"/></dir></dir></target><target name="magedesign"><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="11f261e8aee3ddfe2cd611bb8eae573e"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="channelengine.xml" hash="d4019283d7ff05708cfac73363f598b8"/></dir><dir name="template"><dir name="channelengine"><dir name="checkout"><file name="success.phtml" hash="eea5605084a179e06c8ea922bfcdd55c"/></dir><file name="head.phtml" hash="638dd695feb9aeaf343183cc3c5d77e1"/></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
