我是按照本教程https://www.javatpoint.com/how-to-install-magento-2-using-composer第一次安装 Magento 2 。XAMPP 已安装(Apache 和 MySQL 正在运行),数据库已在 PHPMyAdmin 上设置,但是当我尝试运行php bin/magento setup:install(教程中的步骤 23)时,出现错误:Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
我怎样才能解决这个问题?
我们最近更新到 2.4.4,此后我们注意到“行”页面构建器部分不再工作。
当拖动“row”部分时触发JS错误:
Unable to load preview component (Magento_PageBuilder/js/content-type/row/preview) for row. Please check preview component exists and content type configuration is correct.
Run Code Online (Sandbox Code Playgroud)
我查看了 Stack Overflow 上的其他问题,但找不到任何人遇到同样的问题。
创建全新的 m2 安装。按照我们通常的步骤进行。通过作曲家安装它。
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition
Run Code Online (Sandbox Code Playgroud)
但随后出现以下错误。
有任何想法吗?
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition
Creating a "magento/project-community-edition" project at "./project-community-edition"
Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html
In CurlDownloader.php line 617:
The "https://repo.magento.com/packages.json" file could not be downloaded (HTTP/2 404 ):
{"warning":"You haven\u0027t provided your Magento authentication keys. For instructions, visit https:\/\/devdocs.magento.com\/guides\/v2.3\/install-gde\/prereq\/connect-auth.html"}
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--no-audit] …Run Code Online (Sandbox Code Playgroud) 如何在Magento2中获取媒体文件的绝对路径?我写了一个函数来获取绝对路径,但它不起作用.
public function getAbsolutePath()
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
/** @var \Magento\Framework\Filesystem $filesystem */
$filesystem = $objectManager->get('Magento\Framework\Filesystem');
/** @var \Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */
$mediaDirectory = $filesystem->getDirectoryWrite(Magento\Framework\App\Filesystem\DirectoryList::MEDIA);
$mediaPath = $mediaDirectory->getAbsolutePath();
return $mediaPath;
}
Run Code Online (Sandbox Code Playgroud) 我们已经知道如何从观察者重定向到 magento 1.x版本。
但是对于magento 2,我们不知道如何从观察者那里强制执行重定向。
我已经完成了google,但没有得到任何答案。
我如何删除Magento默认表单ui组件。如市场营销中的图像->购物车价格规则-> [选择已创建的规则]->安排新更新
我要删除规则信息,条件,操作,标签顶部横幅,产品说明横幅之后,产品标签
如您所见,与默认的Magento EE相比,它具有一些额外的ui_components。这是因为Amasty_Promo模块。所以我想将其删除。
我正在使用Magento 2.1.3.我想在成功页面之前在访客结账时获取订单ID.我在谷歌搜索,发现了一些这样的代码.
$orderIncrementId = $this->checkoutSession->getLastRealOrderId();
Run Code Online (Sandbox Code Playgroud)
使用chcekout seesion\Magento\Checkout\Model\Session对象,我尝试获取订单ID但它不起作用.在magento 1.x中,我们可以使用相同的方法轻松地从结账会话中获取订单ID.在magento 2.x中,我们无法做到这一点.
在magento 2.x如何在成功页面之前在访客结账中获取订单ID?
任何帮助,将不胜感激.
谢谢
在Magento 2中,我们如何使用形式为ui component xml文件的文本区域字段添加WYSIWYG编辑器?要添加文本区域,我在xml文件中使用以下代码.
<field name="detail">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="visible" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">text</item>
<item name="formElement" xsi:type="string">textarea</item>
<item name="source" xsi:type="string">sample_shop</item>
<item name="label" xsi:type="string">Detail</item>
</item>
</argument>
</field>
Run Code Online (Sandbox Code Playgroud) 我已经创建了一个PHP函数来显示来自数据库的数据,
我想把它包含在我的megento2块函数中,
这是我选择数据的代码
$dates = date("Y-m-d");
$phone = $_POST["phone"];
$sql = "SELECT * FROM otpp WHERE phone = '$phone' AND dates = '$dates'";
$result = mysqli_query($conn, $sql);
$count = mysqli_num_rows($result);
// if exists ?
if ($count > 0) {
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$otppass = $row["otp"];
echo $otppass;
} else {
echo "0 results";
}
Run Code Online (Sandbox Code Playgroud)
我是否可以继续这种方式从数据库或任何其他方式获取数据来使用数据库中的数据?
我启用了Magento的前端调试路径提示,但未显示。
Infos:
- Magento 2.3.0 with Porto Theme
- Php 7.2
- Already tested to change Magento Single Store MOde and Multistore Mode
- Already made di:compile
- Already tested blank Dev IP and my own IP
- Already changed Magento Modes default and developer
- Already cleaned and flushed the cache
- Already removed generated and pub static folders
Run Code Online (Sandbox Code Playgroud)
但是,Frontend中的红色提示线仍未显示。
magento2 ×10
magento ×2
php ×2
absolute ×1
composer-php ×1
installation ×1
magento2.1 ×1
media ×1
observers ×1
path ×1
redirect ×1
uicomponents ×1
xampp ×1