From 98a598cc2c6981d63414606addfbdea88eb7bcb1 Mon Sep 17 00:00:00 2001 From: phg Date: Mon, 12 Nov 2018 13:11:19 +0100 Subject: [PATCH] Added the ability to set ReportOptions for requesting custom reports for example set ...setReportOptions('custom',true) so amazon will return the requested report with your custom field selection. for more information visit: http://docs.developer.amazonservices.com/en_DE/reports/Reports_ReportType.html#ReportTypeCategories__ListingsReports --- includes/classes/AmazonReportRequest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/includes/classes/AmazonReportRequest.php b/includes/classes/AmazonReportRequest.php index b61d1ae3..f49e3e18 100644 --- a/includes/classes/AmazonReportRequest.php +++ b/includes/classes/AmazonReportRequest.php @@ -176,6 +176,24 @@ public function resetTimeLimits(){ unset($this->options['StartDate']); unset($this->options['EndDate']); } + + /** + * Sets ReportOptions (Optional) + * + * Use this function to add ReportOptions (for example: custom = true) + * @param string $option

ReportOption

+ * @param string|boolean $value

"true" or "false", or boolean

+ * @return boolean FALSE if improper input + */ + public function setReportOptions($option, $value){ + if ($value == 'true' || (is_bool($value) && $value == true)){ + $this->options['ReportOptions'] = $option.'=true'; + } else if ($value == 'false' || (is_bool($value) && $value == false)){ + $this->options['ReportOptions'] = $option.'=false'; + } else { + return false; + } + } /** * Sets whether or not the report should return the Sales Channel column. (Optional)