0
votes

I hope someone can help me with this, I am trying to extract the product prices from magento based on customer group.

I am not using tier pricing, I simply have a product with a standard price and I have specified different prices for each customer group. For some reason I have been unable to extract this information.

I can see that the price mappings seems to be held in the table 'catalog_product_index_group_price' so I guess I could write direct SQL to extract these but I would much rather use the PHP Mage model to do this, or the V2 SOAP API.

I have tried many methods, currently im using something like below, but without success the price variable is always empty.

$rules = Mage::getResourceModel('catalogrule/rule');

$price = $rules->getRulePrice($now, $websiteId, $customer_group_id, $productID);
2

2 Answers

0
votes

Please try the following

$product = Mage::getModel('catalog/product')->load($productId);
$groupPrices = $product->getData('group_price')

$groupPrices should now be an array with the data you are looking for.

0
votes

the code didnt format well in the comment so here it is again!

<?php

include_once '../App/Mage.php';

 Mage::app();

$productID = $_GET["id"];

$pd = Mage::getModel('catalog/product')->load($productID);
$groupPrices = $pd->getData('group_price');
echo json_encode($groupPrices);

?>