Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Shipping Order Model
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Nexus
|
||||
* @since 19 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -228,7 +228,7 @@ class _Order extends \IPS\Patterns\ActiveRecord
|
||||
*/
|
||||
public function sendNotification()
|
||||
{
|
||||
$email = \IPS\Email::buildFromTemplate( 'nexus', 'shipment', array( $this ) );
|
||||
$email = \IPS\Email::buildFromTemplate( 'nexus', 'shipment', array( $this ), \IPS\Email::TYPE_TRANSACTIONAL );
|
||||
$email->send( $this->invoice->member );
|
||||
}
|
||||
|
||||
@@ -344,4 +344,46 @@ class _Order extends \IPS\Patterns\ActiveRecord
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @return array
|
||||
* @apiresponse int id ID number
|
||||
* @apiresponse string status Status: 'done' = Shipped; 'pend' = Waiting to be shipped; 'canc' = Canceled
|
||||
* @apiresponse int invoiceId Invoice ID Number
|
||||
* @apiresponse \IPS\nexus\Shipping\FlatRate method The shipment method (may be null if using EasyPost)
|
||||
* @apiresponse object items The items in the shipment and their quantities
|
||||
* @apiresponse datetime requestDate When the shipment was requested
|
||||
* @apiresponse datetime shipDate When the shipment was shipped
|
||||
* @apiresponse \IPS\GeoLocation address The delivery address
|
||||
* @apiresponse string trackingUrl The URL to view tracking information, if available
|
||||
*/
|
||||
public function apiOutput()
|
||||
{
|
||||
$items = array();
|
||||
foreach ( $this->items as $item )
|
||||
{
|
||||
if ( isset( $items[ $item['name'] ] ) )
|
||||
{
|
||||
$items[ $item['name'] ] += $item['quantity'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$items[ $item['name'] ] = $item['quantity'];
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'id' => $this->id,
|
||||
'status' => $this->status,
|
||||
'invoiceId' => $this->invoice->id,
|
||||
'method' => $this->method ? $this->method->apiOutput() : null,
|
||||
'items' => $items,
|
||||
'requestDate' => $this->date->rfc3339(),
|
||||
'shipDate' => $this->shipped_date ? $this->shipped_date->rfc3339() : null,
|
||||
'address' => $this->address()->apiOutput(),
|
||||
'trackingUrl' => $this->trackingUrl() ? ( (string) $this->trackingUrl() ) : null
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user