Skip to content

Commit cce1847

Browse files
committed
Merge pull request #37 from Peardian/productfix
Product-related bugfixes
2 parents 4adde08 + e93aa29 commit cce1847

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

includes/classes/AmazonProduct.php

+10
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ public function loadXML($xml){
142142
}
143143
}
144144
}
145+
//child relations use namespace but parent does not
146+
foreach($xml->Relationships->children('ns2',true) as $x){
147+
foreach($x->children() as $y){
148+
foreach($y->children() as $z){
149+
foreach($z->children() as $zzz){
150+
$this->data['Relationships'][$x->getName()][$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz;
151+
}
152+
}
153+
}
154+
}
145155
}
146156

147157
//CompetitivePricing

includes/classes/AmazonProductInfo.php

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ private function resetSKUs(){
8484
unset($this->options[$op]);
8585
}
8686
}
87+
//remove Category-specific name
88+
unset($this->options['SellerSKU']);
8789
}
8890

8991
/**
@@ -125,6 +127,8 @@ private function resetASINs(){
125127
unset($this->options[$op]);
126128
}
127129
}
130+
//remove Category-specific name
131+
unset($this->options['ASIN']);
128132
}
129133

130134
/**
@@ -394,9 +398,11 @@ protected function prepareCategories(){
394398
if (array_key_exists('SellerSKUList.SellerSKU.1',$this->options)){
395399
$this->options['Action'] = 'GetProductCategoriesForSKU';
396400
$this->resetASINs();
401+
$this->options['SellerSKU'] = $this->options['SellerSKUList.SellerSKU.1'];
397402
} else if (array_key_exists('ASINList.ASIN.1',$this->options)){
398403
$this->options['Action'] = 'GetProductCategoriesForASIN';
399404
$this->resetSKUs();
405+
$this->options['ASIN'] = $this->options['ASINList.ASIN.1'];
400406
}
401407
}
402408

0 commit comments

Comments
 (0)