Skip to main content
remove tagline, clarify "from command line"
Source Link
Fabian Schmengler
  • 66.2k
  • 25
  • 191
  • 422

You can get directly all assigned group prices with a script running this PHP script from commandline:

require_once __DIR__.'/../app/Mage.php'; $product = Mage::getModel('catalog/product')->load(6); var_dump($product->getData('group_price')); 

In Magento 1.9 the array of group prices is like this:

SKU1,array(4) { [0]=> array(6) { ["price_id"]=> string(6) "151560" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "17" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [1]=> array(6) { ["price_id"]=> string(6) "151561" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "18" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [2]=> array(6) { ["price_id"]=> string(6) "151562" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "19" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } } 

If you use the $product->getGroupPrice() in the front-end, I think you get the product price assigned to the user is logged in the front-end. Because of this, for $product->getGroupPrice() you don't get an array, you get a string with only one price.

Hope it helps.

Regards.

You can get directly all assigned group prices with a script running this from commandline:

require_once __DIR__.'/../app/Mage.php'; $product = Mage::getModel('catalog/product')->load(6); var_dump($product->getData('group_price')); 

In Magento 1.9 the array of group prices is like this:

SKU1,array(4) { [0]=> array(6) { ["price_id"]=> string(6) "151560" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "17" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [1]=> array(6) { ["price_id"]=> string(6) "151561" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "18" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [2]=> array(6) { ["price_id"]=> string(6) "151562" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "19" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } } 

If you use the $product->getGroupPrice() in the front-end, I think you get the product price assigned to the user is logged in the front-end. Because of this, for $product->getGroupPrice() you don't get an array, you get a string with only one price.

Hope it helps.

Regards.

You can get directly all assigned group prices with a script running this PHP script from commandline:

require_once __DIR__.'/../app/Mage.php'; $product = Mage::getModel('catalog/product')->load(6); var_dump($product->getData('group_price')); 

In Magento 1.9 the array of group prices is like this:

SKU1,array(4) { [0]=> array(6) { ["price_id"]=> string(6) "151560" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "17" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [1]=> array(6) { ["price_id"]=> string(6) "151561" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "18" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [2]=> array(6) { ["price_id"]=> string(6) "151562" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "19" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } } 

If you use the $product->getGroupPrice() in the front-end, I think you get the product price assigned to the user is logged in the front-end. Because of this, for $product->getGroupPrice() you don't get an array, you get a string with only one price.

Hope it helps.

improved formatting.
Source Link
Khoa Truong
  • 32.5k
  • 11
  • 92
  • 159

You can get directly all assigned group prices with a script running this from commandline:

require_once __DIR__.'/../app/Mage.php'; $product = Mage::getModel('catalog/product')->load(6); var_dump($product->getData('group_price')); 

In Magento 1.9 the array of group prices is like this:

SKU1,array(4) { [0]=> array(6) { ["price_id"]=> string(6) "151560" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "17" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [1]=> array(6) { ["price_id"]=> string(6) "151561" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "18" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [2]=> array(6) { ["price_id"]=> string(6) "151562" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "19" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } } 

If you use the $product->getGroupPrice()$product->getGroupPrice() in the front-end, I think you get the product price assigned to the user is logged in the front-end. Because of this, for $product->getGroupPrice()$product->getGroupPrice() you don't get an array, you get a string with only one price.

Hope it helps.

Regards.

You can get directly all assigned group prices with a script running this from commandline:

require_once __DIR__.'/../app/Mage.php'; $product = Mage::getModel('catalog/product')->load(6); var_dump($product->getData('group_price')); 

In Magento 1.9 the array of group prices is like this:

SKU1,array(4) { [0]=> array(6) { ["price_id"]=> string(6) "151560" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "17" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [1]=> array(6) { ["price_id"]=> string(6) "151561" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "18" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [2]=> array(6) { ["price_id"]=> string(6) "151562" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "19" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } } 

If you use the $product->getGroupPrice() in the front-end, I think you get the product price assigned to the user is logged in the front-end. Because of this, for $product->getGroupPrice() you don't get an array, you get a string with only one price.

Hope it helps.

Regards.

You can get directly all assigned group prices with a script running this from commandline:

require_once __DIR__.'/../app/Mage.php'; $product = Mage::getModel('catalog/product')->load(6); var_dump($product->getData('group_price')); 

In Magento 1.9 the array of group prices is like this:

SKU1,array(4) { [0]=> array(6) { ["price_id"]=> string(6) "151560" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "17" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [1]=> array(6) { ["price_id"]=> string(6) "151561" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "18" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [2]=> array(6) { ["price_id"]=> string(6) "151562" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "19" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } } 

If you use the $product->getGroupPrice() in the front-end, I think you get the product price assigned to the user is logged in the front-end. Because of this, for $product->getGroupPrice() you don't get an array, you get a string with only one price.

Hope it helps.

Regards.

Source Link

You can get directly all assigned group prices with a script running this from commandline:

require_once __DIR__.'/../app/Mage.php'; $product = Mage::getModel('catalog/product')->load(6); var_dump($product->getData('group_price')); 

In Magento 1.9 the array of group prices is like this:

SKU1,array(4) { [0]=> array(6) { ["price_id"]=> string(6) "151560" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "17" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [1]=> array(6) { ["price_id"]=> string(6) "151561" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "18" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } [2]=> array(6) { ["price_id"]=> string(6) "151562" ["website_id"]=> string(1) "0" ["all_groups"]=> string(1) "0" ["cust_group"]=> string(2) "19" ["price"]=> string(7) "52.5000" ["website_price"]=> string(7) "52.5000" } } 

If you use the $product->getGroupPrice() in the front-end, I think you get the product price assigned to the user is logged in the front-end. Because of this, for $product->getGroupPrice() you don't get an array, you get a string with only one price.

Hope it helps.

Regards.