Skip to content

Commit

Permalink
update amazon orderList
Browse files Browse the repository at this point in the history
  • Loading branch information
robbertdesmit committed Feb 1, 2016
1 parent c6ce1a8 commit 3d7f049
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 5 additions & 3 deletions includes/classes/AmazonOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class AmazonOrder extends AmazonOrderCore{
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
*/
public function __construct($s = null, $id = null, $data = null, $mock = false, $m = null, $config = null){
parent::__construct($s, $mock, $m, $config);
public function __construct($s = null, $id = null, $data = null, $mock = false, $m = null, $config = null, $storeData = array()){
parent::__construct($s, $mock, $m, $config,$storeData);
include($this->env);

if($id){
Expand Down Expand Up @@ -125,13 +125,15 @@ public function fetchOrder(){
* @return AmazonOrderItemList container for order's items
*/
public function fetchItems($token = false){

if (!isset($this->data['AmazonOrderId'])){
return false;
}
if (!is_bool($token)){
$token = false;
}
$items = new AmazonOrderItemList($this->storeName,$this->data['AmazonOrderId'],$this->mockMode,$this->mockFiles,$this->config);

$items = new AmazonOrderItemList($this->storeName,$this->data['AmazonOrderId'],$this->mockMode,$this->mockFiles,$this->config, $this->storeData);
$items->setLogPath($this->logpath);
$items->mockIndex = $this->mockIndex;
$items->setUseToken($token);
Expand Down
5 changes: 3 additions & 2 deletions includes/classes/AmazonOrderItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AmazonOrderItemList extends AmazonOrderCore implements Iterator{
protected $tokenUseFlag = false;
private $i = 0;
private $index = 0;
public $storeData =array();

/**
* AmazonItemLists contain all of the items for a given order.
Expand All @@ -46,8 +47,8 @@ class AmazonOrderItemList extends AmazonOrderCore implements Iterator{
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
*/
public function __construct($s = null, $id=null, $mock = false, $m = null, $config = null){
parent::__construct($s, $mock, $m, $config);
public function __construct($s = null, $id=null, $mock = false, $m = null, $config = null,$storeData){
parent::__construct($s, $mock, $m, $config,$storeData);
include($this->env);


Expand Down
6 changes: 3 additions & 3 deletions includes/classes/AmazonOrderList.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class AmazonOrderList extends AmazonOrderCore implements Iterator{
*/
public function __construct($s = null, $mock = false, $m = null, $config = null, $storeData = array()){



parent::__construct($s, $mock, $m, $config, $storeData);

//parent::setStoreData($storeData);
Expand Down Expand Up @@ -409,6 +407,8 @@ protected function prepareToken(){
* @return boolean <b>FALSE</b> if no XML data is found
*/
protected function parseXML($xml){


if (!$xml){
return false;
}
Expand All @@ -417,7 +417,7 @@ protected function parseXML($xml){
if ($key != 'Order'){
break;
}
$this->orderList[$this->index] = new AmazonOrder($this->storeName,null,$data,$this->mockMode,$this->mockFiles,$this->config);
$this->orderList[$this->index] = new AmazonOrder($this->storeName,null,$data,$this->mockMode,$this->mockFiles,$this->config, $this->storeData);
$this->orderList[$this->index]->setLogPath($this->logpath);
$this->orderList[$this->index]->mockIndex = $this->mockIndex;
$this->index++;
Expand Down

0 comments on commit 3d7f049

Please sign in to comment.