I'm having an issue with updating the price on custom options. The code that I'm using is

$options = $product->getProductOptionsCollection();
foreach( $options as $option ){
    $values = $option->getValuesCollection();
    foreach( $values as $value ){

Right now I'm just using this as a test. The strange thing is that the sku, the title and other options like sort order that I had in there before would save fine, but the price will not. Do I need to do something specific for the price to save? Why would everything else update, but the price wont? Thanks for your help.

3 Answers 3


I think you want to hook int \Mage_Catalog_Model_Resource_Product_Option_Value::_saveValuePrices and check whether the conditions for the saving are met. The code looks right.

if (!$object->getData('scope', 'price')) {


if ($object->getStoreId() != '0' && $scope == Mage_Core_Model_Store::PRICE_SCOPE_WEBSITE
        && !$object->getData('scope', 'price')) {


} else if ($scope == Mage_Core_Model_Store::PRICE_SCOPE_WEBSITE && $object->getData('scope', 'price')) {

It's a magento thing, set the storeId of the product before the options.

$o = array(
61 => array(                          //OptionID
    "is_delete" => "",
    "previous_type" => "drop_down",
    "previous_group" => "select",
    "id" => "61",
    "option_id" => "61",              //OptionID
    "title" => "Detail",
    "type" => "drop_down",
    "is_require" => "1",
    "sort_order" => "0",
    "values" => array(
        286 => array(                 //ValueID
            "option_type_id" => "286",//ValueID
            "is_delete" => "",
            "title" => "title",
            "price" => "5.00",        //new price
            "price_type" => "fixed",
            "sku" => "SKUGDSFS",
            "sort_order" => "0"
//OR $productSaved->setStoreId(0);

Thanks to Fabian for the useful debugging info. The issue can occur kind of randomly. If your price scope is set to global, you have to set the store ID to 0 before saving the value. So do this:


The weird thing is that it seems to work without the store_id if your price scope is set to website.

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.