Php Magento-未经身份验证用户的客户组

Php Magento-未经身份验证用户的客户组,php,mysql,magento,Php,Mysql,Magento,在Magento,我为定价建立了5个客户群。组表看起来有点像:- Group ID | Group Name 1 | Northern Ireland 2 | Dublin 3 | Rest of Ireland 4 | Great Britain Zone 1 5 | Great Britain Zone 2 根据地址中的县/州,每个注册的客户都被归入其中一个组 我们的产品定价取决于交货地点,因此我们的产品定价有点像:

在Magento,我为定价建立了5个客户群。组表看起来有点像:-

Group ID | Group Name
1        | Northern Ireland
2        | Dublin
3        | Rest of Ireland
4        | Great Britain Zone 1
5        | Great Britain Zone 2 
根据地址中的县/州,每个注册的客户都被归入其中一个组

我们的产品定价取决于交货地点,因此我们的产品定价有点像:

Product 1
Group ID | Price
1        | £1.99
2        | £2.99
3        | £3.99
4        | £4.99
5        | £5.99
这对于登录的用户来说都很好,因为他们已经被放入了一个组中,所以他们将根据他们所在的位置显示正确的价格

我想给未经验证的用户从下拉列表中选择其状态的选项,然后我可以传递一个变量来选择正确的组定价

我一直在浏览各种文件,试图找到放置代码的位置,我正在查看app/code/core/Mage/Bundle/Model/Product/Price.php

这里有一个if语句,我认为它可能是要编辑的正确块

if (!$gId) {
    $gId = Mage::getSingleton('customer/session')->getCustomerGroupId();
} else if ($gId instanceof Mage_Customer_Model_Group) {
    $gId = $gId->getId();
}
有人能证实这一点吗?如果出现以下情况,我将考虑添加另一个:

if (!$gId) {
    $gId = Mage::getSingleton('customer/session')->getCustomerGroupId();
} else if ($gId instanceof Mage_Customer_Model_Group) {
    $gId = $gId->getId();
} else if **Session Variable Exists** {
    $gId = Session Variable;
}
谢谢你的帮助,利亚姆