2
如何在magento 2中保存图像自定义属性
我需要根据条件在前端显示少量产品图像:应该检查虚拟镜像的使用情况。 <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Dcw\Vm\Observer; use Magento\Framework\Event\ObserverInterface; class ChangeTemplateObserver extends \Magento\ProductVideo\Observer\ChangeTemplateObserver { /** * @param mixed $observer * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @return void */ public function execute(\Magento\Framework\Event\Observer $observer) { $observer->getBlock()->setTemplate('Dcw_Vm::helper/gallery.phtml'); } } 模板: <div class="admin__field field-image-vm"> …