Magento

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

5
如何在magento2中创建表单弹出模式
我是magento2的新手。我正在尝试为我的新表格创建一个弹出模式。我创建了一个弹出窗口,可以正常工作,但无法创建模式。 以下是在页面加载时加载的弹出代码- require([ 'jquery', 'Magento_Ui/js/modal/alert' ], function($, alert) { alert({ title: "Some title", content: "we can show popuop based on cookies later", autoOpen: true, clickableOverlay: false, focus: "", actions: { always: function(){ console.log("modal closed"); } } }); } ); 请帮助我创建一个模态。任何帮助都非常感谢。

2
Magento2的xml中所有允许的`xsi:type`值是什么
在Magento 2中,(几乎)在xml文件中列出的所有参数都有一个属性xsi:type,该属性确定如何解释参数的值。 例如,在di.xml后端模块的文件中有以下内容: <argument name="scopeType" xsi:type="const">Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT</argument> 这意味着参数scopeType的值是常量的值Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT 或这个 <argument name="template" xsi:type="string">Magento_Theme::root.phtml</argument> 这意味着参数的值template是字符串Magento_Theme::root.phtml。 此xsi:type属性的所有可能值是什么?
20 magento2  xml  di 

5
Magento 2如何将新列添加到订单网格
我已经在sales_order名为的表中添加了一个新列export_status,现在我想使用新列中的数据添加新订单网格sales_order列。 我设法添加列到the sales_order_grid表中。 $installer->getConnection()->addColumn($installer->getTable("sales_order_grid"), "xml_exported", [ 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 'comment' => 'XML Exported' ]); 现在如何使它与sales_order export_status列中的值一起实际显示在订单网格中?

4
Magento 2:什么是服务合同
在Magento 2中,是否有使用服务合同概念构建的具体示例?我已经看过这个词很多,但是现在来看Magento 2的存在,我不清楚服务合同是否更指导性,或者它们是否确实与Magento 2中特定事物的实现联系在一起。

4
如何使用自定义模块覆盖HTML文件?
我正在开发Magento 2中用于付款方式的自定义模块。目前,我正在使用供应商目录中的cc-form.html,并且模块运行正常。参见下面的路径: 供应商/ magento /模块付款/视图/前端/网络/模板/付款/cc-form.html 有什么方法可以覆盖HTML文件吗? 注意:我想使用自定义扩展名覆盖它。参见下面的路径: 应用/代码/命名空间/模块/视图/前端/网络/模板/付款/cc-form.html 任何帮助,将不胜感激。谢谢!

1
如何禁用特定产品上的“添加到购物车”,而在类别列表视图中显示“查看详细信息”按钮?
我想知道如何在某些特定产品上禁用“添加到购物车”按钮,但是我发现了一个废弃的指南,该指南虽然有效,但是由于它只是产品视图页面上的一个解决方案,因此它并不完整,而不是在类别列表或网格页面上。 在我解释了第一步之后,我将在8个小时内在这里回答我自己的问题(由于我的声誉低于某个点,我需要等待8个小时),所以我的答案将是我必须弄清楚的缺少的第三步为我自己。我将尝试使其易于理解: [步骤1] [1] 创建一个将在不需要“添加到购物车”按钮的产品上使用的属性。在管理控制台中,转到... 目录>属性>管理属性> 添加新属性 随便命名属性,例如:“ No_cart_button” 具有属性: Attribute Code: No_cart_button Catalog Input Type for Store Owner: Yes/No Use in Quick Search: No Use in Advanced Search: No Comparable on Front-end: No Visible on Product View Page on Front-end: No Used in Product Listing: YES Used for Sorting …


3
什么是Magento2中的IdentityInterface
我看到Magento 2中的许多模型都实现了Magento\Framework\DataObject\IdentityInterface。 该接口有一个称为getIdentities 的方法return [self::CACHE_TAG . '_' . $this->getId()];。该方法的实现通常返回。 可以在此处找到示例 这是做什么用的?

7
Magento 2:使用xml调用静态块
我如何使用xml在页面中包含静态块。例如,我创建了一个带有标识符promo的静态块。在magento 1中,我们使用以下代码包含一个静态块 <block type="cms/block" name="Promo"> <action method="setBlockId"><block_id>promo</block_id></action> </block> 我想在magento 2中做完全一样的事情

13
在“缓存”名称空间中没有定义任何命令
更新资料 现在一切正常,但There are no commands defined in the "cache" namespace仍然存在。我尝试过chmod 777 -R var/generation,没有解决问题。AFAIK未启用任何模块 public_html]# bin/magento module:status List of enabled modules: Nosto_Tagging List of disabled modules: Magento_Store Magento_AdvancedPricingImportExport Magento_Directory Magento_Theme Magento_Backend Magento_Backup Magento_Eav Magento_Customer Magento_BundleImportExport Magento_AdminNotification Magento_CacheInvalidate Magento_Indexer Magento_Cms Magento_CatalogImportExport Magento_Catalog Magento_Rule Magento_Msrp Magento_Search Magento_Bundle Magento_Quote Magento_CatalogUrlRewrite Magento_Widget Magento_SalesSequence Magento_CheckoutAgreements Magento_Payment …


6
Magento 2:我什么时候应该运行哪些命令?
我已经使用Magento 2了2个月了。我意识到我使用bin/magento setup:upgrade太多了。我想我不知道何时需要运行该命令。 这是我运行上述命令的情况。 当我创建一个新模块时, 当我在安装目录中添加一些内容时, 当我编辑 etc/module.xml, 当我编辑 etc/di.xml, 当我编辑 etc/webapi.xml, 当我编辑 etc/adminhtml/system.xml 题:在哪种情况下绝对需要运行bin/magento setup:upgrade命令? (我问的原因是完成该命令需要一些时间。我相信,如果我停止使用它,它确实可以提高生产率。)


3
Magento 2从购物车中删除“运费和税费”
我想摆脱购物车中的“估计运费和税费”栏。devdocs告诉我们禁用组件是一种方法,因此我尝试了以下方法: <body> <referenceBlock name="checkout.cart.shipping"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="block-summary" xsi:type="array"> <!-- My custom part: --> <item name="config" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> </item> </item> </argument> </arguments> </referenceBlock> </body> 没有效果。还尝试了: <referenceBlock name="checkout.cart.shipping" remove="true"/> 这样,我的总计块完全空白。 有人有建议吗?
20 magento2  layout  cart  totals 

5
Magento 2:如何从数据库中重置客户密码
它是数据库中客户密码的哈希值。因此,MD5和Sha1无法正常工作。 UPDATE `customer_entity` SET `password` = MD5('test123') WHERE `email` = 'X@X.com'; 那么如何使用数据库查询来更新密码。可能是MD5(Sha1('test123'))吗? Magento如何通过代码进行操作。去vendor\magento\module-customer\Console\Command\UpgradeHashAlgorithmCommand.php protected function execute(InputInterface $input, OutputInterface $output) { $this->collection = $this->customerCollectionFactory->create(); $this->collection->addAttributeToSelect('*'); $customerCollection = $this->collection->getItems(); /** @var $customer Customer */ foreach ($customerCollection as $customer) { $customer->load($customer->getId()); if (!$this->encryptor->validateHashVersion($customer->getPasswordHash())) { list($hash, $salt, $version) = explode(Encryptor::DELIMITER, $customer->getPasswordHash(), 3); $version .= …

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.