Skip to content

Can't add product images roles with $product->addImageToMediaGallery #30385

Open
@hm-harshit

Description

@hm-harshit

I tried To Upload Images by using

 $imagePath = $mediapath."image_upload/tmp/products/".$value['image_path'];// path of the image
 $product->addImageToMediaGallery($imagePath, ['image', 'small_image', 'thumbnail', 'swatch_image'], true, false);

Images are uploded success, but Images roles are not assign to this uploded Image

image

Metadata

Metadata

Assignees

Labels

Area: ProductComponent: MediaGalleryEvent: dmcdindia2020Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions