I am inserting a simple product programmatically.

the price is displaying on the grid but not on the (admin)form when I try to edit the product price. it is displaying as zero

                    ->setColor($this->addAttributeValue('color', $sortedData['cartridge_type']))
                    ->setPrice($this->calculatePrice($sortedData['reseller_price_ex_gst'], 10))
                    ->setCustomPrice($this->calculatePrice($sortedData['reseller_price_ex_gst'], 10))
                    ->setOriginalCustomPrice($this->calculatePrice($sortedData['reseller_price_ex_gst'], 10))
                    ->setPageYield($this->filterPageYield($sortedData['cartridge_yield'], $sortedData['cartridge_type']))
                    ->setMediaGallery (array('images'=>array (), 'values'=>array ()))
                    ->addImageToMediaGallery(getcwd()."/images/{$sortedData['dynamic_supply_code']}.jpg", array('image','thumbnail','small_image'), false, false)
                                    'use_config_manage_stock' => 0, //'Use config settings' checkbox
                                    'manage_stock'=>1, //manage stock
                                    'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
                                    'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart
                                    'is_in_stock' => 1, //Stock Availability
                                    'qty' => $sortedData['stock_on_hand'] //qty

  • try catalog reindexing Jul 27, 2015 at 8:12
  • already tried this. it did not work.
    – tom_cruz
    Jul 27, 2015 at 8:32

1 Answer 1


If you are doing this on the frontend (or in an sql/data install) you must initialize the Magento app as Admin, if you have flat_catalog option enabled on your store, maybe you are saving this data to: catalog_flat_{store_id} table and not in EAV tables, you should set the store_id too.

BTW Check reindex too.

  • I am doing a custom module on admin. everything is saved properly except for the price
    – tom_cruz
    Jul 27, 2015 at 8:37
  • Ok, try to save the product, then set the price and save again. Can you specify your magento version and index configuration? indexes works different in CE and EE
    – Max
    Jul 27, 2015 at 8:43
  • I am at CE 1.9 note that the price is displaying on the product grid. but when I click the product to edit the price.. it is displayed as zero
    – tom_cruz
    Jul 27, 2015 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.