Magento

Magento电子商务平台用户的问答


2
Magento 2-如何添加DateTime UI组件
我想在添加新页面时在CMS页面部分中添加新字段作为日期时间,我发现magento使用UI组件,因此在挖掘之后,我可以通过使用以下代码来添加日期字段,但无法添加日期时间字段。有人可以帮忙吗? 添加日期字段的代码: <field name="start_date"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">string</item> <item name="label" xsi:type="string" translate="true">Go Live Start Date</item> <item name="formElement" xsi:type="string">date</item> <item name="source" xsi:type="string">page</item> <item name="sortOrder" xsi:type="number">21</item> <item name="dataScope" xsi:type="string">start_date</item> <item name="validation" xsi:type="array"> <item name="required-entry" xsi:type="boolean">true</item> </item> </item> </argument> </field> 我们需要重写的文件才能实现: vendor/magento/module-cms/view/adminhtml/ui_component/cms_block_form.xml

6
Magento 2安装致命错误-无法实例化界面
我已经在命令行上安装了全新的Magento 2.1,并且在尝试访问前端或后端时始终会遇到相同的致命错误。 致命错误:未捕获错误:无法实例化接口Magento \ Framework \ App \ Config \ Scope \ ReaderPoolInterface 有人经历过吗?我找到了一些资源,但是没有真正的帮助。 更新 我删除了var / di和var / generation并将其设置为开发人员模式 Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface in /shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73 Stack trace: #0 /shop/build/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') #1 /shop/build/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...') #2 /shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'readerPool', 'Magento\\Framewo...') #3 /shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Develo in /shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on …

3
使用ui组件在表单字段下添加注释
如何使用ui组件在Magento 2中的字段下添加小文本。 使用Magento\Framework\Data\Form我可以做到这一点: /** @var \Magento\Framework\Data\Form $form */ $form = $this->formFactory->create(); $fieldset = $form->addFieldset( 'base_fieldset', [ 'legend' => __('Some legend here'), 'class' => 'fieldset-wide' ] ); $fieldset->addField( 'name', 'text', [ 'name' => 'name', 'label' => __('Name'), 'title' => __('Name'), 'note' => __('Some note here') ] ); 上面的代码将产生此结果(请注意该字段下的文本)。 如何使用表单ui-components实现同一件事? 我有这样定义的形式: <field …


5
Magento 2,带有图像选择器参数的新小部件,不保存图片
我创建了一个新的小部件,其中一个参数是图片选择器,我只是使用此 代码。一切看起来都很好。我可以打开媒体文件夹并选择要使用的图片。选择图片时,表单上的图片字段将填充以下值: http://local.magento.com/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvcHVycGxlLmpwZyJ9fQ,,/key/4c150d984998702b74709bb8f05820aff2f85a968b47d2ce50f963 但是,当我保存表单窗口小部件数据时,图片字段具有以下值: {{media url= 而已。我该如何解决?


2
如何在Magento 2中创建儿童主题
我想修改开箱即用的Luma主题的某些方面,但我想通过保留原始文件并确保每次更新Magento时也保留所做的更改来做到这一点。 我想通过儿童主题来做到这一点。 Magento 2是否支持子主题,如果支持,我如何构建目录路径以实现此目的?

3
Magento 2中“页面”和“布局”根标签之间的区别
在Magento 2中,一些布局句柄XML文件使用 <page.../> 根标签。其他人打开 <layout.../> 根标签。使用以上两个标签之一是否会对布局句柄XML文件引入任何功能差异?还是这个纯净的橱窗装饰?或介于两者之间。 两个例子 <!-- File: vendor/magento/module-weee/view/frontend/layout/default.xml --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> 和 <!-- File: vendor/magento/module-widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
18 magento2  layout  page 



2
Magento 2:如何检查是否已安装模块
在Magento 2中,是否可以在运行时检查是否安装了模块? 在Magento 1中,我要么使用isModuleEnabledhelper方法,要么手动获取全局配置树并检查下的节点<modules/>。 isModuleEnabledMagento 2中有等同功能吗?如果没有,如何获取全局配置并检查所需的模块节点?

1
SQLSTATE [42S22]:找不到列:1.9.2升级后1054未知列'e.status'
我们刚刚从1.90更新到1.92,并且显示以下错误... 知道如何解决吗? SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.status' in 'where clause', query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_flat_1` AS `e` INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.category_id = '301' AND cat_index.is_parent=1 WHERE (e.status = 1) Trace: #0 public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) #1 public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) #2 public_html/lib/Zend/Db/Adapter/Abstract.php(480): …

1
修补程序5994导致模块Adminhtml 404状态错误
前几天,我应用了补丁5994,它使我构建的模块的admin部分抛出了404。该模块虽然在前端很好。 它是Magento 1.8.1.0,回退了我的提交后,肯定是补丁5994出现了所有错误。 还有其他人遇到过同样的问题吗? 以下是我怀疑包含答案的模块的config.xml文件: <config> <modules> <Company_Playzone> <version>0.1.0</version> </Company_Playzone> </modules> <frontend> <routers> <playzone> <use>standard</use> <args> <module>Company_Playzone</module> <frontName>playzone</frontName> </args> </playzone> </routers> <layout> <updates> <playzone> <file>playzone.xml</file> </playzone> </updates> </layout> </frontend> <adminhtml> <layout> <updates> <playzone> <file>playzone.xml</file> </playzone> </updates> </layout> <acl> <resources> <all> <title>Allow Everything</title> </all> <admin> <children> <playzone> <title>Play Zone</title> <sort_order>10</sort_order> </playzone> …

4
EE 1.14.2 / CE 1.9.2块缓存更新具有非唯一的缓存键-前端显示重复的内容
当我升级到EE 1.14.2时,大多数事情进展顺利,但是当我开始检查各种前端页面时遇到了一个问题。我有一个包含几个子类别的目录节点,每个子类别上都有一个不同的静态块。升级后,缓存刷新后首先点击哪个页面,最终将显示在所有不同页面上。 我不知道在发布CE 1.9.2时是否会出现相同的问题,但是我想将解决方案放在这里,以供那些可能会发现相同问题的人使用。 更新:由于证实这里同样的问题在CE 1.9.2想出了

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.