Questions tagged «file-upload»

2
Magento 2:实现UI Fileuploader
我最近在Magento 2.1.7上以自己的形式实现了FileUploader Ui组件。 它的代码在这里(app / code / Vendor / Blog / view / adminhtml / ui_component / vendor_blog_form.xml): <field name="featured_images"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> <item name="label" translate="true" xsi:type="string">Hervorgehobene Bilder:</item> <item name="formElement" xsi:type="string">fileUploader</item> <item name="componentType" xsi:type="string">fileUploader</item> <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item> <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item> <item name="allowedExtensions" xsi:type="string">jpg jpeg …


1
请指定产品所需的选项“自定义选项”类型文件
我只有一个自定义选项,即文件类型,我试图通过编程方式将产品添加到购物车,如下所示: $logoSku = 'lg-brnd01'; $productLogo = Mage::getModel('catalog/product')->loadByAttribute('sku',$logoSku); $logoOptions = $productLogo->getOptions(); $opts = Mage::getSingleton('catalog/product_option')->getProductOptionCollection($productLogo); $i =0; $cart = Mage::getModel('checkout/cart'); $cart->init(); $params = array( 'product' => $productLogo->getId(), 'qty' => 1, 'form_key' => Mage::getSingleton('core/session')->getFormKey(), ); foreach ($opts->getData() as $data) { $optionId = $data['option_id']; $image = $paths[0]['name']; $options = array( $optionId => array( 'type' …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.