Search code examples
productsap-commerce-cloudcommerce

SAP Commerce Cloud - Attribute values inheritance from Product to Variant Product


we are using SAP Commerce Cloud 2011 and we need to know (if there is a possibility) how inheriting a Product attribute value within its Variant Product Master Data.

Our case is the following one: we have a T-shirt (Product) that has the attribute "colour" with value "black". Within Master Data of Product, into variants section, we have created a Variant Product which should have two attributes, "colour" (that is that one of its supertype product, so the T-shirt) and "size".

At the moment it doesn't work, so we are looking for a solution that permits us to automatically inherit the colour value of product (value is "black") on its variant, after its saving.

Is there a way to fix that?

Thanks for your attention. Best regards, Anthony


Solution

  • Interceptors can solve your issue (either Init or Prepare, depending on your needs), you can get the value of the attribute from the baseProduct before saving the variant,

    Related documentaion for interceptors : https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1905/en-US/8bfbf43e8669101480d0f060d79b1baa.html