Skip to content

Commit

Permalink
Merge pull request #37 from Peardian/productfix
Browse files Browse the repository at this point in the history
Product-related bugfixes
  • Loading branch information
Peardian committed Feb 13, 2015
2 parents 4adde08 + e93aa29 commit cce1847
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions includes/classes/AmazonProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ public function loadXML($xml){
}
}
}
//child relations use namespace but parent does not
foreach($xml->Relationships->children('ns2',true) as $x){
foreach($x->children() as $y){
foreach($y->children() as $z){
foreach($z->children() as $zzz){
$this->data['Relationships'][$x->getName()][$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz;
}
}
}
}
}

//CompetitivePricing
Expand Down
6 changes: 6 additions & 0 deletions includes/classes/AmazonProductInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ private function resetSKUs(){
unset($this->options[$op]);
}
}
//remove Category-specific name
unset($this->options['SellerSKU']);
}

/**
Expand Down Expand Up @@ -125,6 +127,8 @@ private function resetASINs(){
unset($this->options[$op]);
}
}
//remove Category-specific name
unset($this->options['ASIN']);
}

/**
Expand Down Expand Up @@ -394,9 +398,11 @@ protected function prepareCategories(){
if (array_key_exists('SellerSKUList.SellerSKU.1',$this->options)){
$this->options['Action'] = 'GetProductCategoriesForSKU';
$this->resetASINs();
$this->options['SellerSKU'] = $this->options['SellerSKUList.SellerSKU.1'];
} else if (array_key_exists('ASINList.ASIN.1',$this->options)){
$this->options['Action'] = 'GetProductCategoriesForASIN';
$this->resetSKUs();
$this->options['ASIN'] = $this->options['ASINList.ASIN.1'];
}
}

Expand Down

0 comments on commit cce1847

Please sign in to comment.