0
votes

How do I access the price in one of the simple products? The following is the beginning of the array I want to access from my var_dump($_product->debug()); (stackoverflow wouldn't let me post the whole thing). I am working on the issue related to this post: Magento Retrieve simple product price for configurable product

["_cache_instance_products"]=>
  array(9) {
    ["0 (Mage_Catalog_Model_Product)"]=>
    array(33) {
      ["entity_id"]=>
      string(2) "69"
      ["entity_type_id"]=>
      string(1) "4"
      ["attribute_set_id"]=>
      string(2) "10"
      ["type_id"]=>
      string(6) "simple"
      ["sku"]=>
      string(13) "1001-blu-ven1"
      ["has_options"]=>
      string(1) "0"
      ["required_options"]=>
      string(1) "0"
      ["created_at"]=>
      string(19) "2013-04-02 22:12:27"
      ["updated_at"]=>
      string(19) "2013-04-02 23:54:41"
      ["parent_id"]=>
      string(2) "78"
      ["color"]=>
      string(1) "6"
      ["vendor"]=>
      string(1) "5"
      ["name"]=>
      string(14) "test_1 blue v1"
      ["url_key"]=>
      string(14) "test-1-blue-v1"
      ["msrp_enabled"]=>
      string(1) "2"
      ["msrp_display_actual_price_type"]=>
      string(1) "4"
      ["image"]=>
      string(12) "no_selection"
      ["small_image"]=>
      string(12) "no_selection"
      ["thumbnail"]=>
      string(12) "no_selection"
      ["options_container"]=>
      string(10) "container2"
      ["url_path"]=>
      string(19) "test-1-blue-v1.html"
      ["weight"]=>
      string(6) "0.0000"
      ["price"]=>
      string(6) "1.0000"
      ["status"]=>
      string(1) "1"
      ["visibility"]=>
      string(1) "1"
      ["enable_googlecheckout"]=>
      string(1) "1"
      ["tax_class_id"]=>
      string(1) "0"
      ["is_recurring"]=>
      string(1) "0"
      ["description"]=>
      string(19) "test_1 blue v1 desc"
      ["short_description"]=>
      string(19) "test_1 blue v1 desc"
1
did you try sth like $_product->getData('price'); ? or do you mean tier prices? - Nasaralla
I need the price of the associated simple product. That gives me "0" which is the price of the configurable product. - CaitlinHavener
Are you in the template and you are sure that the product loaded? else you need to reload the product like $product->load(); - Nasaralla
If var_dump($_product->debug()) shows all the details of the configurable product including listing the simple products, then it is indeed loaded, is it not? - CaitlinHavener

1 Answers

0
votes

I was able to get this question answered in the other forum: https://magento.stackexchange.com/questions/4050/access-price-variable-in-product-object/4051?noredirect=1#comment5583_4051

$childProducts = Mage::getModel('catalog/product_type_configurable')
                    ->getUsedProducts(null,$_product);   
foreach($childProducts as $child) {
    print_r($child->getPrice());
}