承接 perfect-code/module-product-media-uploader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

perfect-code/module-product-media-uploader

Composer 安装命令:

composer require perfect-code/module-product-media-uploader

包简介

This module for Magento 2 helps to download an image from external URL for further save it as a product media gallery entry.

README 文档

README

This module for Magento 2 helps to download an image from external URL for further save it as a product media gallery entry.

The image will be saved on disk with the same name (name can be configured).

Configuration.

Here you can define module basic settings.

Usage.

Quickstart.

Inject \PerfectCode\ProductMediaUploader\Api\MediaEntryGeneratorInterface to your constructor and push URL to the image you want to add to your product.

$mediaEntry = $this->mediaEntryGenerator->generate(
    'http://localhost/my-image.jpg',
);
/** @var \Magento\Catalog\Api\Data\ProductInterface $product */
$product->setMediaGalleryEntries([$mediaEntry]);
// ...
$this->productRepository->save($product);

This will save my-image.jpg to pub/media folder and assign this image on the product, based on settings configured above.

Save an image with a different title.

$mediaEntry = $this->mediaEntryGenerator->generate(
    'http://localhost/my-image.jpg',
    ['some_attribute' => $yourCustomTitle]
);

Then create a plugin on \PerfectCode\ProductMediaUploader\Api\MediaEntryGeneratorInterface::getImageName method and reuse pushed parameter 'some_attribute'.

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2022-03-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固