コード例 #1
0
ファイル: ApiTest.php プロジェクト: vynyl/campaigner
 public function testAddProductCategoryAndProduct(Connection $connection)
 {
     $productCategory = new ProductCategory();
     $productCategory->setName("name")->setDescription("description")->setImage("image")->setUrl("url");
     $productCategoryResource = new ProductCategories($connection);
     $categoryResponse = $productCategoryResource->post($productCategory);
     $categoryId = $categoryResponse['CategoryID'];
     $product = new Product();
     $product->addCategory($categoryId);
     $product->setCost("2")->setLongDescription("long description")->setPrice("3")->setProductImage("image")->setProductName("NEWWW")->setProductURL("url")->setShortDescription("short description")->setSku("sku")->setWeight("2");
     $productResource = new Products($connection);
     return $productResource->post($product);
 }
コード例 #2
0
ファイル: Products.php プロジェクト: vynyl/campaigner
 private function formProduct($body)
 {
     $product = new Product();
     $product->setProductId($body['ProductID'])->setSku($body['SKU'])->setProductName($body['ProductName'])->setLongDescription($body['LongDescription'])->setShortDescription($body['ShortDescription'])->setProductURL($body['ProductURL'])->setProductImage($body['ProductImage'])->setWeight($body['Weight'])->setCost($body['Cost'])->setPrice($body['Price'])->setActive($body['Active'])->setCreated($body['Created'])->setLastUpdated($body['LastUpdated']);
     return $product;
 }