Magento-无法应用目录价格规则 [英] Magento - Unable to Apply Catalog Price Rules

查看:141
本文介绍了Magento-无法应用目录价格规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在让Magento商店应用目录价格规则时,我们遇到了一些问题.这是一家相当大的商店(2个商店门面,有30000种产品),我们正在尝试对商店中的大多数产品应用全球折扣.

We are having some issues with getting a Magento store to apply catalog price rules. It is a fairly large store (2 store fronts, 30000 products), and we are trying to apply a global discount to most of the products in the store.

我们可以设置价格规则,但是当我们应用它时,它只会旋转一个小时左右,然后挂起,而没有应用任何价格.

We can set up the price rule, but when we go to apply it it just spins for up to an hour or so and then hangs, without applying any prices.

猜测是因为它试图向数据库写入这么多的记录,并且最终会超时,但这似乎与我们在服务器和PHP级别设置的时间限制无关紧要,但是它永远不会完成.

At a guess it's because it's trying to write so many records to the DB and it's eventually timing out, but it doesn't seem to matter what time limits we set at the server and PHP level, it never completes.

我不知道我们是否可以通过其他方式来提高效率呢?

I didn't know if there was a way we could do this differently to make it more efficient?

推荐答案

以下是在保存目录价格规则时向大型目录申请的方法.

Below is approach which we apply for large catalog when saving catalog price rule.

我创建了一个脚本来应用目录规则,并通过命令行运行.并创建cron作业以在晚上运行此脚本.

I've created one script to apply catalog rule, run with command line. And also create cron job to run this script over night.

只需在您的magento的根目录上创建一个php文件,并将其放置在该文件的代码下方

Just create one php file on root of your magento and placed below code in this file

 try {
        Mage::getModel('catalogrule/rule')->applyAll();
        Mage::app()->removeCache('catalog_rules_dirty');
        echo Mage::helper('catalogrule')->__('The rules have been applied.');
    } catch (Exception $e) {
        echo Mage::helper('catalogrule')->__('Unable to apply rules.');
        print_r($e);
    }

并使用命令行运行或为此脚本创建cron作业.这将应用您的所有目录规则,

And run with command line or create cron job for this script. This will apply your all catalog rules,

这篇关于Magento-无法应用目录价格规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆