Question regarding Magento: I need to make a PHP script where I grab the ‘final_price’ (the price after applying category and shopping cart price rules), of a product for a particular customer group, and use this in a calculation to populate a specific attribute with the outcome.
Example:
I have been searching all over the place how to use final_price for a specific customer group in a PHP script in Magento CE 1.7.2, but can’t find a proper method. The idea is to call the script nightly through cron.
I have full access to Magento, the dedicated (Centos 5, LAMP) server, and all databases. The database has 15000 products.
Does anybody have an idea how I best do this?
Regards, Jan
What is used in the product to determine the customer group is
Mage::getSingleton('customer/session')->getCustomerGroupId();
So what you want to do is to ensure that you set the customer group id in the customer session before calling the getFinalPrice() method on the catalog/product model.