You are here

public function MailchimpEcommerce::updateProduct in Mailchimp 8

Update a product in a store.

Parameters

string $store_id: The store id.

string $id: A unique identifier for the product.

array $variants: An array of the product's variants.

  • id (string) A unique identifier for the product variant.
  • title (string) The title of a product variant.

array $parameters: An array of additional parameters. See API docs.

Return value

object The API Product response object.

Throws

\Mailchimp\MailchimpAPIException

See also

http://developer.mailchimp.com/documentation/mailchimp/reference/ecommer...

File

lib/mailchimp-api-php/src/MailchimpEcommerce.php, line 860

Class

MailchimpEcommerce
Mailchimp Ecommerce library.

Namespace

Mailchimp

Code

public function updateProduct($store_id, $product_id, $variants = [], $parameters = []) {
  $tokens = [
    'store_id' => $store_id,
    'product_id' => $product_id,
  ];
  $parameters += [
    'variants' => $variants,
  ];
  return $this
    ->request('PATCH', '/ecommerce/stores/{store_id}/products/{product_id}', $tokens, $parameters);
}