diff --git a/src/Resources/Product.php b/src/Resources/Product.php index 99c4d8e..2da97a0 100644 --- a/src/Resources/Product.php +++ b/src/Resources/Product.php @@ -183,4 +183,15 @@ public function getCategoryRule($category_id) ] ]); } + + public function categoryRecommended(string $product_name, string $description = '', array $images = []) + { + return $this->call('POST', 'product/category_recommend', [ + RequestOptions::QUERY => [ + 'product_name' => $product_name, + 'description' => $description, + 'images' => $images, + ] + ]); + } } diff --git a/tests/Resources/ProductTest.php b/tests/Resources/ProductTest.php index b703a63..5286bd8 100644 --- a/tests/Resources/ProductTest.php +++ b/tests/Resources/ProductTest.php @@ -121,4 +121,10 @@ public function testGetCategoryRule() $this->caller->getCategoryRule(1); $this->assertPreviousRequest('GET', 'products/categories/rules'); } + + public function testCategoryRecommended() + { + $this->caller->categoryRecommended('product name', 'description'); + $this->assertPreviousRequest('POST', 'product/category_recommend'); + } }