我在 Mac OSX 上运行。我拉下了一个兼容Magento的vagrant box,然后通过 拉下了Magento 2.0代码库(开发分支)git clone,安装成功。
我现在有一个为我们公司量身定制的已安装、已配置的代码库。我想做的是:
逻辑是,现在开发团队可以将其拉入他们的 vagrant box,对结果数据库进行 mysql 导入,然后跳过安装。
我怎么做#1和#2?
我正在尝试向 customer_entity 添加一个自定义列,该列应该可以在后端以客户形式进行编辑。
我可以通过模块中的 UpdateSchema 脚本将该列添加到数据库表中。
但是如何在客户表单和网格中填充它?
到目前为止我尝试过的:
如何正确设置自定义列,使其值保存在“customer_entity”中而不是“customer_entity_varchar”中?
我们如何从 id 而不是从 Magento2 中的客户会话中获取客户数据。
请让我知道。
这是我使用Magento 2的第一个项目.我很难获得登录客户的默认账单/送货地址,以显示在我的自定义模块的前端.
到目前为止我有这个:
//this gets the billing id which is an integer. I'm thinking it must be loaded to get the whole data of the address
$billingId = $customerSession->getCustomer()->getDefaultBilling();
//just found this in the internet and thought it might be the same as loading an order, but it doesn't work
$address = $objectManager->create('\Magento\Customer\Model\AddressFactory')->load($billingId);
Run Code Online (Sandbox Code Playgroud)
但错误说:
Call to undefined method Magento\Customer\Model\AddressFactory::load()
我想我很接近,但我不知道接下来该做什么.提前致谢.
当我从 magento 中的根脚本发送电子邮件时,出现以下错误。
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Missing required argument $debugHintsPath of Magento\Developer\Model\TemplateEngine\Plugin\DebugHints.' in /var/www/html/2x/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:45
Stack trace:
0 /var/www/html/2x/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Develop...', Array, Array)
1 /var/www/html/2x/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Develop...')
2 /var/www/html/2x/vendor/magento/framework/Interception/PluginList/PluginList.php(234): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Develop...')
3 /var/www/html/2x/vendor/magento/framework/Interception/Interceptor.php(149): Magento\Framework\Interception\PluginList\PluginList->getPlugin('Magento\\Framewo...', 'debug_hints')
4 /var/www/html/2x/var/generati in /var/www/html/2x/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 45
Run Code Online (Sandbox Code Playgroud)
以下是我使用过的代码。
$orderid = '000000003';
$order = $obj->create('Magento\Sales\Model\Order')->loadByIncrementId($orderid);
// print_r($order->getData());
$obj->create('Magento\Sales\Model\Order\Email\Sender\OrderSender')->send($order,true);
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题。
我试图在 magento2 帐单地址部分添加新字段。我已按照以下链接在送货地址块中添加新字段
http://oyenetwork.com/articles/magento2-devliery-date-module-creation-from-scratch/
我已成功将新字段添加到送货地址部分。但是在我的网站上,我一直在使用“虚拟产品”。所以我想将我的新自定义字段添加到计费部分。我刚刚修改了“ LayoutProcessorPlugin.php ”代码,如下所示
$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children'][ '付款清单']['儿童']['交货日期']
代替
$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children'][ 'shipping-address-fieldset']['children']['delivery_date']
但它不起作用。如何将我的新自定义字段添加到 magento2 中的帐单地址块?
我需要自定义 Magento_Checkout 模块。
我试图将该 html 文件复制到我的主题路径中,但覆盖不起作用
覆盖下面提到的路径
/app/design/frontend/Vendor/ThemeName/Magento_Checkout/web/template
Run Code Online (Sandbox Code Playgroud)
但该文件取自
/vendor/magento/module-checkout/view/frontend/web/template
Run Code Online (Sandbox Code Playgroud)
如何覆盖此模板 html 文件?
我想在我的 magento2 模块中显示记录列表。数据已成功加载,但加载进度条从未消失:

我的 ui_component 文件名为:paymentconfirmations_paymentconfirmation_listing.xml:
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">paymentconfirmations_paymentconfirmation_listing.paymentconfirmations_paymentconfirmation_listing_data_source</item>
<item name="deps" xsi:type="string">paymentconfirmations_paymentconfirmation_listing.paymentconfirmations_paymentconfirmation_listing_data_source</item>
</item>
<item name="spinner" xsi:type="string">blog_post_columns</item>
</argument>
<dataSource name="paymentconfirmations_paymentconfirmation_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">PaymentConfirmationDataProvider</argument>
<argument name="name" xsi:type="string">paymentconfirmations_paymentconfirmation_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
</item> …Run Code Online (Sandbox Code Playgroud) 我正在开发一个自定义CLI命令,我想知道从PHP代码调用其他命令的最佳方法是什么(没有shell_exec()或类似命令).
例如:
当运行"php bin/magento my:custom:command"时,它会做它的事情并最终运行"php bin/magento cache:flush".
有任何想法吗?
谢谢.
我在运行命令"php bin/magento setup:upgrade"时遇到了奇怪的错误.
错误:我们找不到您想要的用户的角色...
无法完成我的所有命令过程.
请帮忙.