使用J2t的rewardpoints插件,cart页面选择区域计算运费时出现如下类似的错误:
Recoverable Error: Argument 1 passed to Mage_SalesRule_Model_Validator::process() must be an instance of Mage_Sales_Model_Quote_Item_Abstract, instance of Mage_Sales_Model_Quote_Address given, called in D:\xampp\htdocs\beads\app\code\community\Rewardpoints\Model\Validator.php on line 7 and defined in D:\xampp\htdocs\beads\app\code\core\Mage\SalesRule\Model\Validator.php on line 270
出现这个错误的原因:Mage_SalesRule_Model_Validator::process() 它获得的对象不是Mage_Sales_Model_Quote_Item_Abstract类的实例,所以应该使用正确的方法,Rewardpoints_Model_Validator这个类的第七行代码应该这样写:
parent::processShippingAmount($address);
这样替换下问题就解决了~
Translate for English: The reason for this issue is the Mage_SalesRule_Model_Validator::process() is not the instance of the class Mage_Sales_Model_Quote_Item_Abstract,but it must be,so the solution is just to change the code line7 of the app\code\community\Rewardpoints\Model\Validator.php to
parent::processShippingAmount($address);
That's all enjoy it,happy coding!