ProductsSales.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Rest\Wrapper\Reports; |
| 4 | |
| 5 | use WCML\Rest\Exceptions\InvalidLanguage; |
| 6 | use WCML\Rest\Wrapper\Handler; |
| 7 | use WPML\FP\Obj; |
| 8 | |
| 9 | class ProductsSales extends Handler { |
| 10 | |
| 11 | public function prepare( $response, $object, $request ) { |
| 12 | |
| 13 | $currency = Obj::prop( 'currency', $request->get_params() ); |
| 14 | |
| 15 | if ( $currency ) { |
| 16 | |
| 17 | $response->data['currency'] = $currency; |
| 18 | } |
| 19 | |
| 20 | return $response; |
| 21 | } |
| 22 | |
| 23 | } |