当我想将任何产品(简单)添加到我的购物车时,按钮会显示一条成功消息,但是从我得到的主要消息中:"We can't add this item to your shopping cart right now".我选择哪种产品并不重要,而且我还尝试了隐身模式或缓存刷新后重新加载。
我正在运行新安装的 Magento 2.3.0 版本,并且处于开发人员模式。
从日志中我得到以下信息:
main.CRITICAL: Notice: tempnam(): file created in the system's temporary directory in /www/htdocs/[...]/[...]/vendor/magento/zendframework1/library/Zend/Cache/Backend.php on line 203 {"exception":"[object] (Exception(code: 0): Notice: tempnam(): file created in the system's temporary directory in /www/htdocs/[...]/[...]/vendor/magento/zendframework1/library/Zend/Cache/Backend.php on line 203 at /www/htdocs/[...]/[...]/vendor/magento/framework/App/ErrorHandler.php:61)"} []
从 Backend.php 的第 203 行开始:
$tempFile = tempnam(md5(uniqid(rand(), TRUE)), '');
if ($tempFile) {
$dir = realpath(dirname($tempFile));
unlink($tempFile);
if ($this->_isGoodTmpDir($dir)) {
return $dir;
}
}
Run Code Online (Sandbox Code Playgroud)
由于产品有库存,我希望它们能够正确添加到购物车中。
我正在测试升级到 Magento 2.4 但出现以下错误。我读到此错误可能与自定义扩展中缺少标题属性有关。为了尝试隔离问题,我从 /app/code/ 文件夹中删除了所有扩展,然后再次运行升级,编译过程,但即使删除了所有扩展,问题仍然存在。
知道如何调试吗?
1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 13
Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 13
<pre>#1 Magento\Framework\Acl\Builder\Proxy->getAcl() called at [vendor/magento/module-backend/Model/Auth/Session.php:229]
#2 Magento\Backend\Model\Auth\Session->processLogin() called at [vendor/magento/module-backend/Model/Auth.php:165]
#3 Magento\Backend\Model\Auth->login() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Magento\Backend\Model\Auth\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Magento\Backend\Model\Auth\Interceptor->___callPlugins() …Run Code Online (Sandbox Code Playgroud) 这个问题是关于让 Xdebug 使用托管在 Web 服务器 Docker 实例中的 CLI PHP 脚本。
我有docker 容器:web-server、、varnish-cache。nginx-proxy我能够使用以下 VS Code 启动配置通过浏览器成功调试 Magento 2 网页:
这是新的 XDebug v3,它删除了很多 v2 配置设置
客户端(Windows 10)IP(我的笔记本电脑):192.168.1.150,主机(Ubuntu 20.04)IP:192.168.1.105,使用 Docker 容器托管 IP:172.100.0.2-5
VS 代码启动:
"name": "(Magento 2) Listen for XDebug on 192.168.1.5/105",
"type": "php",
"request": "launch",
"port": 9099,
"stopOnEntry": false, // Set to true to test any script on entry
"log": false,
// Remember to update remote_connect_back or remote_host
// inside xdebug PHP …Run Code Online (Sandbox Code Playgroud) 如何在magento 2中加载模型
Mage::getModel('catalog/product')->load()
Run Code Online (Sandbox Code Playgroud)
因为我们以前进入magento 1.
我们可以用unsetBlock()方法删除Magento1中的块,但是在Magento2中它不起作用.那么,请帮助如何以编程方式删除Magento2中的块?
我在自动生成文件pub/static夹中的静态文件时遇到了一些问题
使用后,magento setup:static-content:deploy如果我删除一些由css之类的deploy生成的静态文件,并且指向如下网址:
<my_domain>/pub/static/frontend/<my_module>/<my_theme>/en_US/css/theme.css
Run Code Online (Sandbox Code Playgroud)
magento2不再自动生成了...我需要一些提示!
var/cache和var/view_preprocessed文件夹我已经写了一个基本的Magento 2自定义模块。我运行时,该模块可以向Magento 2注册bin/magento module:enable <module name>。我已经检查了setup_module表,并且模块条目在那里并且模块已启用。
我在Setup/InstallSchema.php运行时遇到问题。不管我做什么,都不会执行架构安装程序。我认为这是因为当我第一次执行bin/magento setup:upgrade命令时,我有一个空白InstallSchema.php。禁用和重新启用该模块不会执行任何操作。我已经检查了数据库,Magento似乎没有使用数据库来跟踪模块setup_version。我试图找到Magento在磁盘上跟踪当前安装位置的位置,setup_version但到目前为止,我已经绘制了一个空白。我知道Magento可以调用我的模块,因为它Setup/InstallData.php非常愉快地执行了文件。
有人对如何强制Magento 2执行Setup/InstallSchema.php文件有任何想法吗?
我大约1个月没有使用Magento 2.0.2.0 CE。之后,我登录到admin之后,打开了我的帐户/帐户信息页面,显示了标题“是时候更改密码了。”。当我尝试打开产品(或设置页面)时,显示了类似的页面“是时候更改密码了。”
我更改了密码,然后按了“保存帐户”。没什么改变,我仍然看到“是时候更改密码了。”,所有菜单项都指向此页面“是时候更改密码了。”
I am working on magento 2 api. I need products based on below filters
I have try with this api but no option available
index.php/rest/V1/categories/{id}/products
Please someone suggest how to archive this.
Thanks