错误:并非所有产品都能满足要求的数量!这是什么意思?

发布于 2024-09-11 04:04:07 字数 107 浏览 1 评论 0原文

我在尝试提交购物车中的订单时收到此错误: 并非所有产品都能满足要求的数量,

我已将数量设置为 1000 并有库存...我刚刚安装了 magento 和其他一些扩展,所以我做错了什么,,

i get this error when trying to submit the order in the shopping cart :
Not all products are available in the requested quantity

I have set the quantity to 1000 and made it in stock ... I have just installed magento and some other extensions , , so what i did wrong ,,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

太傻旳人生 2024-09-18 04:04:07

好的,我想我最好添加一个新答案,以便我可以添加链接和格式化代码等。对于重复的内容表示歉意。

嗯,学习调试代码绝对是一大进步,但它将提供对代码实际功能的大量洞察,而不是依赖 echo 和 print_r! :) 特别是对于复杂且真正面向对象的代码,您总是在对象之间跳转。

首先,确保您使用的是正确的 IDE。我再次推荐 Netbeans,但 Eclipse 也可以。从这里开始的所有链接都将采用 Netbeans。

Netbeans wiki 上有一个关于调试是什么的精彩教程,其中包含一个示例。还有 OSX 的设置指南,< a href="http://netbeans.org/kb/docs/php/configure-php-environment-windows.html" rel="noreferrer">Windows 和 Ubuntu,所以选择你的毒药!

我之所以建议使用 CartController.php 和 updatePostAction 是因为您可以从 Magento 的 URL 结构中读取正在调用的模块、控制器和操作。因此,如果您检查购物车页面 (/checkout/cart) 中的表单,您将看到表单提交到 /checkout/cart/updatePost/,这意味着 Mage_Checkout 是模块,CartController 是控制器,updatePostAction 是方法。因此,当用户点击“更新购物车”按钮时,控件(以及购物车的内容)将传递给该方法,从而触发断点。您还可以在同一类中选择 addAction 来捕获从产品页面添加的操作。

进入活动调试会话后,检查变量并添加监视(如有必要)以观察正在发生的情况。使用 F8 键浏览,使用 F7 键跳转到感兴趣的呼叫。

调试肯定会花费您至少一天的时间来熟悉整个过程,但投资绝对是值得的,它会让您成为更好的开发人员。

祝你好运!
京东

OK, I thought I'd better add a new answer so that I can add links and format code, etc. Apologies for the duplicate.

Well, learning to debug your code is definitely a big step up, but one that will provide a huge amount of insight into what the code is actually doing rather than relying on echo and print_r! :) Particularly for complex and genuinely object-oriented code where you jump around between objects all the time.

Firstly, make sure you're using a proper IDE. Again, I recommend Netbeans, but Eclipse will work. All links from here on will assume Netbeans.

There's a great tutorial on what debugging is with an example here on the Netbeans wiki. There are also setup guides for OSX, Windows and Ubuntu, so choose your poison!

The reason why I suggested the CartController.php and updatePostAction is because you can read from Magento's URL structure what module, controller and action are being called. So, if you inspect the form in the cart page (/checkout/cart), you'll see that the form submits to /checkout/cart/updatePost/, which means Mage_Checkout is the module, CartController is the controller and updatePostAction is the method. So when the user hits the "Update Shopping Cart" button, control (and the contents of the cart) will be passed to that method, hitting your breakpoint. You could also choose addAction in the same class to catch it as it is added from the product page.

Once you're in the active debugging session, inspect the variables and add watches (if necessary) to observe what's going on. Use your F8 key to move through and F7 to dive to interesting calls.

Debugging will definitely take you at least a day to get your head around the process, but the investment is definitely worthwhile, it will make you a much better developer.

Good luck!
JD

只为一人 2024-09-18 04:04:07

我会想威尔的建议,而你显然已经检查过了。

不幸的是,这可能是您需要调试核心代码以了解发生了什么情况的情况之一。使用 xdebug 设置本地开发环境(有一些很好的教程介绍如何执行此操作,具体取决于您的操作系统、IDE 和 Web 服务器,但我发现 Netbeans 和 apache2.2 可以完美地协同工作),然后在 updatePostAction 内的 CartController.php 中设置断点() 并追踪它。

请随意发回您发现的内容,这可能对其他人有用。

干杯,
京东

I'd be thinking what Will suggested and you obviously checked.

Unfortunately, this is probably one of those situations where you'll need to debug the core code to find out what's going on. Setup your local dev environment with xdebug (there are some good tutorials on how to do this depending on your OS, IDE and webserver but I find that Netbeans and apache2.2 work beautifully together) and then set a breakpoint in CartController.php inside updatePostAction() and trace it through.

Feel free to post back what you find, it might be useful to others.

Cheers,
JD

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文