Magento

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

4
Magento 2在“ section-config.js”中存储切换器错误未捕获的TypeError:无法读取未定义(...)的属性'*'
我在自定义主题中实现了自定义商店切换器。 块模板如下: <?php if (count($block->getStores())>1): ?> <?php $id = $block->getIdModifier() ? '-' . $block->getIdModifier() : ''?> <span><?php echo $block->escapeHtml($block->getStoreName()) ?></span> <span>/</span> <?php foreach ($block->getStores() as $_lang): ?> <?php if ($_lang->getId() != $block->getCurrentStoreId()): ?> <span class="view-<?php echo $block->escapeHtml($_lang->getCode()); ?> switcher-option"> <a href="#" data-post='<?php /* @escapeNotVerified */ echo $block->getTargetStorePostData($_lang); ?>'> <?php echo …

6
如何从主页中删除页面标题(h1),cms_index_index.xml不起作用
我正在尝试删除自定义主题上的主页主标题(目前在luma主题上运行)。 我尝试添加通常的标签来删除当前cms_index_index.xml文件的全部内容,如下所示(并且在此处已经得到答复): <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="page.main.title" remove="true"/> </body> </page> 我已经尝试过其他方法,例如 <referenceBlock name="page.main.title" display="false"/> 和 <referenceBlock name="cms_page" display="false"/> 也没有成功。正在清理缓存并部署文件。我正在使用的cms_index_index.xml文件位于文件夹中 /app/design/frontend/<vendor>/<theme>/Magento_Cms/layout 我还有什么其他选择?为什么这种方法不起作用?

2
如何在淘汰模板文件中调用静态块?
我正在使用Magento 2.1。 想要在结帐页面上显示一些自定义运输消息以用于运输方法,我已经通过直接编辑到剔除模板文件来完成。 Magento_Checkout / web / template / shipping.html 但我想在后端使用此设置。因此,可以在敲除模板文件中调用静态块,如果可以,我该怎么做。 我希望红色框中的内容来自静态块。

3
1.9.3.0更新后的SOAP连接问题
我已经将我的Magento商店从1.9.2.4更新为1.9.3.0 我们使用通过SOAP / XML-RPC用户连接的运输软件(Shipworks)。 更新后,worksworks日志记录将在日志中显示以下响应: <?xml version="1.0" encoding="UTF-8"?> -<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> -<SOAP-ENV:Body> -<SOAP-ENV:Fault> <faultcode>1</faultcode> <faultstring>Internal Error. Please see log for details.</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 因此,我打开了Magento中的异常日志记录,并得到以下错误: 2016-10-13T18:24:14+00:00 ERR (3): SoapFault exception: [1] Internal Error. Please see log for details. in /public_html/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php:196 Stack trace: #0 /public_html/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php(140): Mage_Api_Model_Server_Adapter_Soap->fault('1', 'Internal Error....') #1 /public_html/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php(48): Mage_Api_Model_Server_Handler_Abstract->_fault('internal') #2 …

5
Magento和HTTP / 2:当前状态是什么?
你们中有些人知道,HTTP / 2是最近诞生的。 据我了解,它已经被开发为只能与现有网站一起使用,这表明与Magento兼容并没有任何关系。 但是,所有浏览器都决定仅为TLS(https)连接实现HTTP / 2。 那就是我的问题: 如果我想通过HTTP / 2服务Magento,我应该考虑什么? 为所有页面启用https(使用安全URL)是否足够? 如果不是,是否需要进行任何核心更改? 我正在寻找Magento 1和2的答案。

3
自定义页面上的自定义集合的分层导航-magento2
我正在为自己的产品集合在magento2中获取分层导航。我已经在自定义页面上获取了自定义集合,需要显示分层导航。试图适应这种 magento1解决方案,但步伐遥遥无期。 任何想法我怎么能在magento2中实现它。我到目前为止所做的如下: 在我的自定义页面上扩展了Catalog ListProduct块,以获取自定义产品列表。 class View extends \Magento\Catalog\Block\Product\ListProduct { public function __construct( \Magento\Catalog\Block\Product\Context $context, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, \Magento\Catalog\Model\Layer\Resolver $layerResolver, CategoryRepositoryInterface $categoryRepository, \Magento\Framework\Url\Helper\Data $urlHelper, array $data = [], \Custom\LayerNavigation\Model\Layer $testlayerobj ) { parent::__construct($context,$postDataHelper,$layerResolver, $categoryRepository,$urlHelper,$data); $this->_coreRegistry = $context->getRegistry(); $this->_testlayer = $testlayerobj; } protected function _getProductCollection() { if ($this->_productCollection === null) { $this->_productCollection …




3
Magento 2 Rest Api获取缩略图图像URL
我们如何通过rest API获取产品缩略图的网址。 /V1/products/{sku}/media 会获得相对网址,例如 "/m/b/mb01-blue-0.jpg" 并且图片网址为 baseurl/catalog/product/m/b/mb01-blue-0.jpg 这很好。但是,我们如何获取通常驻留在缓存文件夹中的缩略图。

1
在产品编辑页面中添加新标签并在Magento 2.1中调用自定义phtml
我想在产品编辑页面中添加新标签,为此,我按照以下步骤操作: 创建di.xml并添加以下代码: <virtualType name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Pool"> <arguments> <argument name="modifiers" xsi:type="array"> <item name="custommodule" xsi:type="array"> <item name="class" xsi:type="string">Namespace\Custommodule\Ui\DataProvider\Product\Modifier\Customtab</item> <item name="sortOrder" xsi:type="number">200</item> </item> </argument> </arguments> </virtualType> 创建Customtab.php并按modifyMeta()功能创建新选项卡。 现在,我想调用自定义phtml文件来呈现html。如何调用自定义phtml文件?

1
Magento 2:`resources.xml`文件用于什么?
在Magento 2中,模块可能具有的XML配置文件之一是resources.xmlfile。例如,销售模块有一个 #File: vendor/magento/module-sales/etc/resources.xml <?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/resources.xsd"> <resource name="sales_setup" extends="core_setup" /> <resource name="sales" extends="core" /> </config> 有谁知道这些文件在Magento 2中的用途是什么?它们似乎是旧的Magento 1顶级<resources/>节点。然而,由于Magento的不再使用设置资源模型/迁移(相反在Magento的2使用类Setup/InstallSchema.php,Setup/InstallData.php,Setup/UpgradeSchema.php,Setup/UpgradeData.php用于安装/迁移样脚本),它不是100%清除哪些sales_setup资源是。 对于非设置资源,这是否是添加具有不同凭据/连接字符串信息的数据库连接类的另一种方法?或者是其他东西?

2
将图像表单元素添加到添加/编辑表单
我正在使用用于管理列表和表单的ui组件为Magento 2构建CRUD模块,我的一个实体具有一个图像字段。 但是我无法使其正常工作。 这是它应该如何工作的。 在添加模式或编辑模式下,没有上传的图像时,它看起来应该像一个简单的文件输入。 上传文件后,它应显示图像预览,并在其下方显示一个删除框。 我不是在寻找这种设计。它的外观可能不同,但功能相同。 在Magento 1中,仅通过创建自己的块渲染器就可以做到这一点 class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Helper_Image extends Varien_Data_Form_Element_Image { protected function _getUrl() { $url = false; if ($this->getValue()) { $url = Mage::helper('{{namespace}}_{{module}}/{{entity}}_image')->getImageBaseUrl().$this->getValue(); } return $url; } } 并将其添加到我的表单块中 $fieldset->addType( 'image', Mage::getConfig()->getBlockClassName('{{namespace}}_{{module}}/adminhtml_{{entity}}_helper_image') ); 但是我在Magento 2中没有表单块。 我知道我可以在ui组件文件中为表单字段使用类名。 <field name="image" class="Class\Name\Here"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item …


2
repo.magento.com的源代码可在任何地方使用吗?
Magento 2的作曲者资料库http://repo.magento.com似乎是一个会话编辑作曲者资料库。也就是说,不同的用户可以基于HTTP Auth凭据访问不同的程序包。 有谁知道一个可以托管类似存储库的现成项目?更具体地说,有人知道Magento是否使用现成的软件来实现此功能,或者是否是自定义应用程序?

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.