我只是想在成功登录后设置条款和条件页面。一切似乎运作良好。我通过我放置在 CMS 页面中的表格获取帖子数据,标识符为“一般条件”。问题只在
header('Location: '.Mage::getUrl('general-conditions'));
如果我注释掉这一行..页面加载正确,但如果我不这样做,它就会陷入无限循环。
谁能帮帮我,这是唯一剩下的事情,我花了很多时间。提前致谢。
<?php
Class Rik_Terms_Model_Observer{
public function checkGeneralTerms(){
if (Mage::helper('customer')->isLoggedIn()) {
$id = Mage::getModel('customer/session')->getId();
$customer = Mage::getModel('customer/customer')->load($id);
$customerData = $customer->getData();
$groupId = Mage::helper('customer')->getCustomer()->getGroupId();
$groupName = Mage::getModel('customer/group')->load($groupId)->getCode();
$storeId = Mage::app()->getStore()->getId();
if($customer->getGeneralTerms()=='0'){
$pageIdentifier = Mage::getModel('cms/page')->checkIdentifier("general-conditions", $storeId);
if ($pageIdentifier){
header('Location: '.Mage::getUrl('general-conditions')); // problem
die();
}
}
}
}
}