Question on DzProductAssetContainer.addAsset

If I select an asset in the content library and use “create product from”, I can add my asset to any existing product.
If I use DzProductAssetContainer.addAsset(), I can only add assets to products that I have created manually.
How can I add an asset to any product regardless of whether it was created manually or installed?

Comments

  • Richard HaseltineRichard Haseltine Posts: 101,482

    Vendor data vs. user data, with the complications hidden when using the UI?

  • kabexefkabexef Posts: 77

    Richard Haseltine said:

    Vendor data vs. user data, with the complications hidden when using the UI?

    It works via DzAssetMgr.createProductFromAssets() ... but now I can't remove the asset from the product via DzProductAssetContainer.removeAsset(). 

  • Richard HaseltineRichard Haseltine Posts: 101,482

    I am not seeing an addAsset member - there is an insertAsset member.

  • kabexefkabexef Posts: 77
    edited November 3

    Richard Haseltine said:

    I am not seeing an addAsset member - there is an insertAsset member.

    Sorry, my fault. The insertAsset() won't work for any product. DzAssetMgr.createProductFromAssets() will work for any product ... but now I can't remove the asset from the product via DzProductAssetContainer.removeAsset().

    Post edited by kabexef on
  • Richard HaseltineRichard Haseltine Posts: 101,482

    Do other members of DzProductAssetContainer work as expected?

Sign In or Register to comment.