Subdivition in product partition

107 views
Skip to first unread message

cvit sandeep

unread,
Apr 11, 2015, 10:15:27 AM4/11/15
to adwor...@googlegroups.com
Hi Team,
I am currently working on Subdivide opertaion in product partition section.I need your support on following issues.

1.Getting the error 'An error has occurred: [RequiredError.REQUIRED @ operations[6].operand.criterion.caseValue.type]'

   while performing product partition.

   The following is my code,

      $root = $helper->createSubdivision();
  
      $helper->createUnit($root, new ProductCanonicalCondition('NEW'), 200000);

      $helper->createUnit($root, new ProductCanonicalCondition('USED'), 100000);

      $otherCondition = $helper->createSubdivision($root,new ProductCanonicalCondition());
  

      $helper->createUnit($otherCondition,new ProductType('PRODUCT_TYPE_L1','sametou1'), 900000);

      $helper->createUnit($otherCondition,new ProductType('PRODUCT_TYPE_L1','sametou2'), 10000);

      $otherBrand = $helper->createSubdivision($otherCondition, new ProductType());

      $helper->createUnit($otherBrand,new ProductType('PRODUCT_TYPE_L2'), 110000);


   I tried as in your documentation.

   Why this error and how can i resolve this?

Regards

sandeep cv

Josh Radcliff (AdWords API Team)

unread,
Apr 13, 2015, 8:39:45 AM4/13/15
to adwor...@googlegroups.com
Hi sandeep cv,

The issue is with the otherBrand object you created:

$otherBrand = $helper->createSubdivision($otherCondition, new ProductType());

On a ProductType object, the value can be null (for the "other" case), but you must set the type attribute to the proper level. In your case, it looks like you'd want to set this to PRODUCT_TYPE_L1 since your otherBrand object is for the group of nodes for that product type level/type.

Cheers,
Josh, AdWords API Team

cvit sandeep

unread,
Apr 13, 2015, 9:08:07 AM4/13/15
to adwor...@googlegroups.com
Hi Josh,

Thank you.Now it's works.

What is the easiest way to update  already existing product partition?

I read somewhere that need to 'REMOVE' the root first and then 'ADD' the updated tree.

Please provide me any code to perform these operations.

Regards

Sandeep cv

Josh Radcliff (AdWords API Team)

unread,
Apr 13, 2015, 11:34:31 AM4/13/15
to adwor...@googlegroups.com
Hi Sandeep,

We only have examples of updating a partition tree in the Java library, where we also have a shopping utility.

You won't always have to remove the root and rebuild the entire tree. You can make changes to a subtree as long as each of your mutate calls leaves the tree in a valid state. See the section on modifying trees in our guide.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages