Magento

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

2
如何使用mixins Magento 2.1.1重写小部件功能
我们有 swatch-renderer.js 此文件中有一些小部件。 .... $.widget('mage.SwatchRenderer', { .... /** * @private */ _init: function () { if (this.options.jsonConfig !== '' && this.options.jsonSwatchConfig !== '') { this._sortAttributes(); this._RenderControls(); } else { console.log('SwatchRenderer: No input data received'); } }, /** * @private */ _sortAttributes: function () { this.options.jsonConfig.attributes = _.sortBy(this.options.jsonConfig.attributes, function (attribute) { …

3
Magento 2:%_ entity表中的row_id和entity_id有什么区别?
在Magento 1中,row_id实体表中没有任何列,而您只有entity_id: CREATE TABLE `catalog_category_entity` ( `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID', `entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Type ID', `attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Attriute Set ID', `parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Parent Category ID', `created_at` timestamp …
17 magento2  database  eav 

1
在哪里可以找到系统值的默认值?magento 2.1
我想稍微更改url重写区域-我想问一下这个困扰了我一段时间的问题: 默认设置在哪里?例如对于url重写,我必须取消选中“使用系统值”以更改行为。在哪里可以更改此“系统值”? Use Categories Path for Product URLs Yes/No [x] Use system value Create Permanent Redirect for URLs if URL Key Changed Yes/No [x] Use system value

3
基本网址变更Magento2.1
我已经更改了Magento 2.1中的基本URL,但是它不起作用。 安装时,我已将基本网址设置为www.domain1.net。我需要将其更改为www.domain2.net。 我试过的 更新baseurl core_config_data: UPDATE core_config_data SET value = 'http://www.domain2.net/' WHERE path IN ('web/secure/base_url', 'web/unsecure/base_url'); 更换 design/head/includes/ UPDATE core_config_data SET value = REPLACE(value, 'http://www.domain1.net/', 'http://www.domain2.net/') WHERE path = 'design/head/includes'; 然后更改商店网址 php bin/magento setup:store-config:set --base-url="http://www.domain2.net/" php bin/magento setup:store-config:set --base-url-secure="https://www.domain2.net/" 最后清除了缓存: php bin/magento cache:flush 在搜索www.domain2.net之后,找不到服务器。 参考: https://mage2.pro/t/topic/22 http://blog.netgloo.com/2016/05/13/magento-2-change-base-url-using-the-command-line/ 在magento 2.1中更改基本url的正确方法是什么?


4
Magento 2日志数据库查询
在magento 1.x中,我使用该n98-magerun工具来获取所有数据库查询的日志文件: n98-magerun.phar dev:log:db [--on] [--off] 是否可以在Magento2中记录数据库查询?
17 magento2 


1
为什么Magento 2使用RequireJS`map`而不是`path`
在Magento 2的RequireJS实现中,许多核心模块都使用类似这样的配置 map: { '*': { editTrigger: 'mage/edit-trigger', addClass: 'Magento_Translation/add-class' } } 在RequireJS中,map配置指令允许开发人员告诉RequireJS 加载模块X并使用模块Y时,请用模块Z替换模块Y- 但仅适用于模块X 或者,在代码中 map: { 'modulex':{ 'moduley':'modulez' } } 该map功能基本上允许您通过配置交换模块定义-用Magento来说,它是javascript的模块重写功能。 不过,我不清楚Magento大量使用物业*的钥匙map。 map: { '*': { editTrigger: 'mage/edit-trigger', addClass: 'Magento_Translation/add-class' } } 所述*基本上说*为做到这一点映射所有模块,以及其预期用途的情况下是是提供一个基本模块的混叠,可以更具体的模块被改变。 但是,Magento似乎用它代替了RequireJS的pathsproperty。即似乎Magento可以通过以下方法实现相同的目的 paths: { 'editTrigger': 'mage/edit-trigger', 'addClass': 'Magento_Translation/add-class', } 然后在需要时有选择地进行特定映射。 有谁知道为什么Magento选择map:*路径别名作为其方法?即-是我对map与path不完整的区别的理解-还是这是“一件六件,另一件六件”的事情之一。还是Magento通过这种方式获得一些额外的行为。 不要求解决特定问题,而是在开始撰写有关它的要求之前澄清对RequireJS和Magento实现的误解:)

2
Magento 2的view.xml文件中的“ exclude”标记有什么作用
Magento 2“空白”主题包括以下标记层次。 <exclude> <item type="file">Lib::jquery/jquery-ui-1.9.2.js</item> <item type="file">Lib::jquery/jquery.ba-hashchange.min.js</item> <item type="file">Lib::jquery/jquery.details.js</item> <item type="file">Lib::jquery/jquery.details.min.js</item> <item type="file">Lib::jquery/jquery.hoverIntent.js</item> <item type="file">Lib::jquery/jquery.min.js</item> <item type="file">Lib::mage/captcha.js</item> <item type="file">Lib::mage/dropdown_old.js</item> <item type="file">Lib::mage/list.js</item> <item type="file">Lib::mage/loader_old.js</item> <item type="file">Lib::mage/webapi.js</item> <item type="file">Lib::moment.js</item> <item type="file">Lib::requirejs/require.js</item> <item type="file">Lib::date-format-normalizer.js</item> <item type="file">Lib::legacy-build.min.js</item> <item type="directory">Lib::modernizr</item> <item type="directory">Lib::tiny_mce</item> <item type="directory">Lib::varien</item> <item type="directory">Lib::jquery/editableMultiselect</item> <item type="directory">Lib::jquery/jstree</item> <item type="directory">Lib::jquery/fileUploader</item> <item type="directory">Lib::css</item> <item type="directory">Lib::lib</item> <item …
17 magento2  theme 

6
Magento2不读我的requirejs-config.js
嗨,我是Magento2的新手,试图弄清楚RequireJS在Magento中的工作方式。 这是我的情况: 我有以下模块: app/code/Mymodule/Test/view/frontend/requirejs-config.js 这是此文件的内容: var config = { map: { '*': { jQuery110: "Mymodule_Test/js/jquery-1.10.2", jqueryNoConflict: 'Mymodule_Test/js/jquery.no-conflict', flexslider: 'Mymodule_Test/js/jquery.flexslider-min', header: 'Mymodule_Test/js/store/header' } } }; 我的主题在这个位置: app/design/frontend/Mycompany/Basic 我的Javascript位于以下位置: app/code/Mymodule/Test/view/frontend/web/js/jquery.no-conflict.js app/code/Mymodule/Test/view/frontend/web/js/jquery.flexslider-min.js app/code/Mymodule/Test/view/frontend/web/js/store/header.js 在PHTML文件中: app/code/Mymodule/Test/view/frontend/templates/home.phtml 我添加了以下行: require(['jqueryNoConflict', 'flexslider'],function($, flexslider){ (function($) { $(window).load(function () { $('.flexslider').flexslider(); }); })(jQuery); }); 当我在浏览器中检查页面时,出现404错误,并显示以下路径: http://mag2.com.local/pub/static/frontend/Mycompany/Basic/en_US/flexslider.js 但是,如果我将require []行更改为此: require(['Mymodule_Test/js/jquery.no-conflict', …

4
目前的皮肤网址
我想获取当前主题的皮肤URL。目前,我正在研究Magento“ rwd”主题。 我正在使用下面的代码来获取皮肤URL: Mage::getDesign()->getSkinUrl(); 这会返回我URL http:// localhost / magento / skin / frontend / default / default / 但我需要以下网址:http:// localhost / magento / skin / frontend / rwd / default / 请帮我。
17 magento-1  theme  skin 

5
Magento根据位置显示适当的本地化
我想将Magento网站配置为能够识别用户的默认语言和位置,并以该语言和适当的本地化显示该网站。 例如: 来自俄罗斯的默认俄语用户将直接使用卢布作为默认货币和价格进入俄语网站。 这可能吗?如果可以,怎么办?

4
Magento 2:什么是代理类的实际解释?
因此,我从理论上知道Magento 2中的代理类是什么。我已经阅读了有关Alan Storm的精彩文章,并且我完全理解了这些类是如何生成的。 但是,我不知道这是因为我不是英语母语人士,还是Alan的解释是否使用了非常抽象的非核心类,但是我很难理解它的工作原理,特别是何时使用在开发过程中。 因此,让我们以以下示例为核心app/code/Magento/GoogleAdwords/etc/di.xml: <?xml version="1.0"?> <!-- /** * Copyright © 2016 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:ObjectManager/etc/config.xsd"> <type name="Magento\GoogleAdwords\Observer\SetConversionValueObserver"> <arguments> <argument name="collection" xsi:type="object">Magento\Sales\Model\ResourceModel\Order\Collection\Proxy</argument> </arguments> </type> </config> 我想知道: 为什么在这种特定情况下使用代理类? 通常,什么时候应该使用代理类?


6
管理员配置错误:未定义索引:第59行的Iterator.php中的ID
有人可以向我解释这个错误吗? Exception #0 (Exception): Notice: Undefined index: id in /home/staging/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php on line 59 #0 /home/staging/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php(59): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined index...', '/home/asconveyo...', 59, Array) #1 /home/staging/vendor/magento/module-config/Model/Config/Structure.php(92): Magento\Config\Model\Config\Structure\Element\Iterator->setElements(Array, 'default') #2 /home/staging/var/generation/Magento/Config/Model/Config/Structure/Interceptor.php(24): Magento\Config\Model\Config\Structure->getTabs() #3 /home/staging/vendor/magento/module-config/Model/Config/Structure.php(135): Magento\Config\Model\Config\Structure\Interceptor->getTabs() #4 /home/staging/var/generation/Magento/Config/Model/Config/Structure/Interceptor.php(63): Magento\Config\Model\Config\Structure->getFirstSection() #5 /home/staging/vendor/magento/module-config/Controller/Adminhtml/System/AbstractConfig.php(57): Magento\Config\Model\Config\Structure\Interceptor->getFirstSection() #6 /home/staging/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Config\Controller\Adminhtml\System\AbstractConfig->dispatch(Object(Magento\Framework\App\Request\Http)) #7 /home/staging/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor->___callParent('dispatch', Array) #8 /home/staging/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Config\\...', 'dispatch', Object(Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor), Array, …
17 magento2  admin  xml 

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.