简体   繁体   English

以编程方式将产品添加到magento时为404

[英]404 when programmatically adding products to magento

I have been working on an integration from CSV files to magento, the integration was started by another person and abandonded so i am working with their code to try and finish it. 我一直在进行从CSV文件到magento的集成,该集成是由另一个人开始的并且被放弃了,所以我正在与他们的代码一起尝试并完成它。 There are around 7000 products to import and custom pricing for groups as well. 大约有7000种产品要导入,也要为组定制价格。

Without adding code here (which i can do if need be) is there anyone with an idea about why when i run the importer it eventually ends up showing the magento 404 page? 没有在这里添加代码(如果需要的话,我可以这样做)是否有人对为什么我运行导入程序时最终会显示magento 404页面有任何想法?

If i only import categories, customer groups and customers assigned to groups it runs fine. 如果我仅导入类别,客户组和分配给组的客户,则运行良好。 However if i run proudct importing it is producing the same result. 但是,如果我运行ridectct导入,则会产生相同的结果。

If i comment out any code that adds the products, the looping over the CSV works correctly and continues to redirect and send me emails with the counter reporting. 如果我注释掉添加产品的任何代码,则CSV循环正常工作,并继续重定向并向我发送带有计数器报告的电子邮件。 It only appears to happen when importing. 它似乎仅在导入时发生。

Any advice would be greatly appreciated. 任何建议将不胜感激。

Thanks. 谢谢。

As far as I understand you run the script with a browser and I do not think your server is able to treat correctly a bunch of products like that on the php limited time. 据我了解,您是使用浏览器运行脚本的,并且我认为您的服务器无法在php有限的时间内正确处理一堆产品。

If so, you should set up a cron job that does the deal. 如果是这样,您应该设置一个完成任务的cron作业。 If you need to upload the file by yourself. 如果您需要自己上传文件。 You can create a script that set a cron in the next ten minutes for example. 例如,您可以创建一个在接下来的十分钟内设置cron的脚本。 I dealt with larger catalog but only with this method, even on a small server. 我处理的目录较大,但即使在小型服务器上也只能使用此方法。 Additionnaly, I would advise you to end up with a fixed time cron job to avoid server overload during the peak hours. 另外,我建议您结束固定时间的cron作业,以避免高峰时段服务器过载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM