You are here

public function ProductHandlerInterface::addProduct in Mailchimp E-Commerce 8

Adds a product to Mailchimp.

Adds a product variant if a product with the given ID exists.

In Mailchimp, each product requires at least one product variant. This function will create a single product variant when creating new products.

A product variant is contained within a product and can be used to represent shirt size, color, etc.

Parameters

string $product_id: Unique ID of the product.

string $title: The product title.

string $url: The product url.

string $image_url: The product image url.

string $description: The product description.

string $type: The product type.

array $variants: An array of product variants. Structure defined in documentation below.

See also

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

1 method overrides ProductHandlerInterface::addProduct()
ProductHandler::addProduct in src/ProductHandler.php
@inheritdoc

File

src/ProductHandlerInterface.php, line 41

Class

ProductHandlerInterface
Interface for the Product handler.

Namespace

Drupal\mailchimp_ecommerce

Code

public function addProduct($product_id, $title, $url, $image_url, $description, $type, $variants);