创建 magento 组需要重新索引

发布于 2024-10-14 01:23:11 字数 191 浏览 2 评论 0 原文

我们正在 Magento 中以编程方式创建客户组,并将其分配给来到我们网站的新客户。该客户登录后,将无法看到产品目录中的任何产品。一旦我们运行重新索引,客户就可以看到产品目录中的产品。如果已经创建了客户组并完成了重新索引,并且如果我们将客户添加到该现有客户组,则客户就能够看到产品。我们需要知道为什么每次创建新的客户组时都需要重新索引。还有其他方法可以避免重新索引吗?

We are programmatically creating a customer groups in Magento, and assigning it to the new customers coming to our site. Once this customer logs in, he is not able to see any of the products in the product catalog. Once we run the reindexing, the customer is able to see the products in the product catalog. If a customer group is already created and reindexing is done, and if we add the customer to that existing customer group, the customer is able to see the products. We need to know why is it necessary to reindex every time we create a new customer group. Is there any other way to avoid reindexing?

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

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

发布评论

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

评论(2

清君侧 2024-10-21 01:23:11

也许您可以在创建该组后尝试运行重新索引。您可以使用以下代码来实现此目的:

Mage::getResourceModel('catalog/product_flat_indexer')->rebuild();
//assuming you already imported the Mage-class

我不知道哪个索引导致了此问题,请查看以下链接以了解如何重建其他索引:

由于 nvncbl.com/2010/03/refresh-magento-cache-programmatically/" rel="nofollow" title="以编程方式刷新 Magento 缓存">以编程方式刷新 Magento 缓存

用于重新索引的函数的完整列表

maybe you could just try to run the reindex after you created that group. You could achieve this with the following code:

Mage::getResourceModel('catalog/product_flat_indexer')->rebuild();
//assuming you already imported the Mage-class

Since I don't know which index is causing this problem, please have a look at the following links to see how to rebuild the other indexes:

Refresh Magento Cache programmatically

Full list of functions for reindexing

┈┾☆殇 2024-10-21 01:23:11

重新索引是必要的,因为 magento 为平面表中的每个客户组创建自己的价格字段。在这些字段中,产品价格是预先计算的。

我在1.4.1中也有同样的问题。但是当尝试使用 magento 后端重新索引时会发生错误。

Reindexing is neccessary, because magento creates own price fields for each customer group in the flat tables. In these fields product prices are pre-calculated.

I have the same problem in 1.4.1. But the error occurs when try to reindexing with magento backend.

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