0

Are there any SFCC API to remove a product from the product set?

It is a very easy thing to do from BM: just go to the Product Sets tab, select a product set from which to remove, go to Products tab, remove the product. But I can not find any API for that.

The only two options I have is to generate an .xml file and run its import at runtime so that to change the product set or use OCAPI. I would like to achieve the same with the API. Is it possible?

Thank you.

1

Why do you need an Script API for this? Products are read-only in storefront context for a good reason - you have multiple users accessing them in a concurrent manner. What exactly are you trying to accomplish?

UPDATE:

Just construct an xml following the pattern below with the list of products you want to remain in the product set:

<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.demandware.com/xml/impex/catalog/2006-10-31" catalog-id="apparel-catalog">

    <product product-id="fall-look">
        <product-set-products>
            <product-set-product product-id="013742003314"/>
            <product-set-product product-id="25592648"/>
            <product-set-product product-id="25698039"/>
        </product-set-products>
    </product>
</catalog>

After that use the standard catalog import job step component https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/DWAPI/jobstepapi/html/api/jobstep.ImportCatalog.html

  • I am creating a job which would create specific product sets and remove others. I need this so that the client would not have to create the product sets manually, but uploaded a file specifying the product sets. The file which specifies the product sets is going to be created manually. – Yaroslav Trofimov Sep 2 at 13:36
  • And why not manipulate the file to generate a standard catalog.xml where you can both create and remove objects using the "mode" attribute of the product element? See documentation.b2c.commercecloud.salesforce.com/DOC1/topic/… – Zlatin Zlatev Sep 3 at 10:29
  • I have updated the answer above (I figured you want to add/remove products in the product set, not the actual product set), hope this helps. – Zlatin Zlatev Sep 3 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.