According to mailchimp documentation: https://developer.mailchimp.com/documentation/mailchimp/guides/getting-s...

Adding product category is possible with the vendor attribute. Product category might be needed when you want to use the trigger "Purchase product from category".

Comments

carstenG created an issue. See original summary.

carsteng’s picture

Here is a patch.
Because https://www.drupal.org/project/mailchimp_ecommerce/issues/2916820 is very similar (description field).
This patch also includes that one.

carsteng’s picture

StatusFileSize
new14.04 KB

Small fix to ubercart submodule.

carsteng’s picture

Status: Active » Needs review
samuel.mortenson’s picture

Status: Needs review » Needs work
+++ b/src/ProductHandler.php
@@ -14,7 +14,7 @@ class ProductHandler implements ProductHandlerInterface {
-  public function addProduct($product_id, $title, $url, $image_url, $description, $type, $variants) {
+  public function addProduct($product_id, $title, $url, $image_url, $description, $type, $category, $variants) {

@@ -42,7 +43,7 @@ class ProductHandler implements ProductHandlerInterface {
-  public function updateProduct($product, $title, $url, $image_url, $description, $type, $variants) {
+  public function updateProduct($product, $title, $url, $image_url, $description, $type, $category, $variants) {

+++ b/src/ProductHandlerInterface.php
@@ -33,12 +33,14 @@ interface ProductHandlerInterface {
-  public function addProduct($product_id, $title, $url, $image_url, $description, $type, $variants);
+  public function addProduct($product_id, $title, $url, $image_url, $description, $type, $category, $variants);

@@ -59,11 +61,13 @@ interface ProductHandlerInterface {
-  public function updateProduct($product_id, $title, $url, $image_url, $description, $type, $variants);
+  public function updateProduct($product_id, $title, $url, $image_url, $description, $type, $category, $variants);

New parameters should always be added to the end of methods, and should probably have a default value (like $category = NULL) to prevent BC breaks.