Magento 1: update custom option price value programmaticallyUpdate product custom option price in observerUpdate price frontend based on custom option$product->getOptions() returns empty resultUpdate product custom option price on product price changeMagento How to add configurable product while placing order programatically?Pricing “Customizable Options” Stuck on Fixed Pricing - PercentMagento 1.9 custom option update priceHow to edit the custom option price type programmatically?Magento 2 - How to show amount "save $100 considering custom options also on detail page?Magento 2.2.5: Add, Update and Delete existing products Custom Options

How to respond to an upset student?

Is real public IP Address hidden when using a system wide proxy in Windows 10?

Should one buy new hardware after a system compromise?

Simple function that simulates survey results based on sample size and probability

Why do Ryanair allow me to book connecting itineraries through a third party, but not through their own website?

Adding spaces to string based on list

What are the real benefits of using Salesforce DX?

Looking for a soft substance that doesn't dissolve underwater

What was the idiom for something that we take without a doubt?

Count rotary dial pulses in a phone number (including letters)

At what point in European history could a government build a printing press given a basic description?

Computing the matrix powers of a non-diagonalizable matrix

In general, would I need to season a meat when making a sauce?

Can I install both XCode & Android Studio on MacBook Air with only 8 GB of Ram

Why is this Simple Puzzle impossible to solve?

How to pull out the underlying query syntax being used by dataset?

Does Nitrogen inside commercial airliner wheels prevent blowouts on touchdown?

Binary Search in C++17

Is the field of q-series 'dead'?

Ticket to ride, 1910: What are the big cities

Did people go back to where they were?

How to execute this code on startup?

Python program to implement pow(x, n)

I think I may have violated academic integrity last year - what should I do?



Magento 1: update custom option price value programmatically


Update product custom option price in observerUpdate price frontend based on custom option$product->getOptions() returns empty resultUpdate product custom option price on product price changeMagento How to add configurable product while placing order programatically?Pricing “Customizable Options” Stuck on Fixed Pricing - PercentMagento 1.9 custom option update priceHow to edit the custom option price type programmatically?Magento 2 - How to show amount "save $100 considering custom options also on detail page?Magento 2.2.5: Add, Update and Delete existing products Custom Options






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm trying to update the option values of an existing product custom option.



This is the code I've developed:



$product = Mage::getModel("catalog/product")->load($productId);
$titolo = 'Test';
$prezzo = 123.00;
foreach ($product->getOptions() as $custom_option)
if (self::CUSTOM_OPTION_TITLE == $custom_option->getTitle())
$custom_option_values = $custom_option->getValues();
$values = array();
foreach($custom_option_values as $custom_option_value)

if($custom_option_value["sku"] == $skuOpzione)

$values[$custom_option_value->getId()]['option_type_id']= $custom_option_value->getId();
$values[$custom_option_value->getId()]['option_id']= $custom_option_value->getOptionId();
$values[$custom_option_value->getId()]['default_title']= $titolo;
$values[$custom_option_value->getId()]['store_title']= $titolo;
$values[$custom_option_value->getId()]['title']= $titolo;
$values[$custom_option_value->getId()]['default_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['default_price_type']= 'fixed';
$values[$custom_option_value->getId()]['store_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['store_price_type']= 'fixed';
$values[$custom_option_value->getId()]['price']= floatval($prezzo);
$values[$custom_option_value->getId()]['price_type']= 'fixed';

$custom_option_value->setValues($values);
$custom_option_value->saveValues();



$product->save();




All seems to work fine but when I check the product I see 'Title' updated but not the 'Price'.
Why?










share|improve this question






















  • have you a result? I have this Problem, too :-( Dave

    – David
    Apr 13 '18 at 9:10











  • I don't know if it can still be useful but it's necessary set: $custom_option_value->setStoreId('0');

    – Shaibon
    May 20 at 16:02

















1















I'm trying to update the option values of an existing product custom option.



This is the code I've developed:



$product = Mage::getModel("catalog/product")->load($productId);
$titolo = 'Test';
$prezzo = 123.00;
foreach ($product->getOptions() as $custom_option)
if (self::CUSTOM_OPTION_TITLE == $custom_option->getTitle())
$custom_option_values = $custom_option->getValues();
$values = array();
foreach($custom_option_values as $custom_option_value)

if($custom_option_value["sku"] == $skuOpzione)

$values[$custom_option_value->getId()]['option_type_id']= $custom_option_value->getId();
$values[$custom_option_value->getId()]['option_id']= $custom_option_value->getOptionId();
$values[$custom_option_value->getId()]['default_title']= $titolo;
$values[$custom_option_value->getId()]['store_title']= $titolo;
$values[$custom_option_value->getId()]['title']= $titolo;
$values[$custom_option_value->getId()]['default_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['default_price_type']= 'fixed';
$values[$custom_option_value->getId()]['store_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['store_price_type']= 'fixed';
$values[$custom_option_value->getId()]['price']= floatval($prezzo);
$values[$custom_option_value->getId()]['price_type']= 'fixed';

$custom_option_value->setValues($values);
$custom_option_value->saveValues();



$product->save();




All seems to work fine but when I check the product I see 'Title' updated but not the 'Price'.
Why?










share|improve this question






















  • have you a result? I have this Problem, too :-( Dave

    – David
    Apr 13 '18 at 9:10











  • I don't know if it can still be useful but it's necessary set: $custom_option_value->setStoreId('0');

    – Shaibon
    May 20 at 16:02













1












1








1








I'm trying to update the option values of an existing product custom option.



This is the code I've developed:



$product = Mage::getModel("catalog/product")->load($productId);
$titolo = 'Test';
$prezzo = 123.00;
foreach ($product->getOptions() as $custom_option)
if (self::CUSTOM_OPTION_TITLE == $custom_option->getTitle())
$custom_option_values = $custom_option->getValues();
$values = array();
foreach($custom_option_values as $custom_option_value)

if($custom_option_value["sku"] == $skuOpzione)

$values[$custom_option_value->getId()]['option_type_id']= $custom_option_value->getId();
$values[$custom_option_value->getId()]['option_id']= $custom_option_value->getOptionId();
$values[$custom_option_value->getId()]['default_title']= $titolo;
$values[$custom_option_value->getId()]['store_title']= $titolo;
$values[$custom_option_value->getId()]['title']= $titolo;
$values[$custom_option_value->getId()]['default_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['default_price_type']= 'fixed';
$values[$custom_option_value->getId()]['store_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['store_price_type']= 'fixed';
$values[$custom_option_value->getId()]['price']= floatval($prezzo);
$values[$custom_option_value->getId()]['price_type']= 'fixed';

$custom_option_value->setValues($values);
$custom_option_value->saveValues();



$product->save();




All seems to work fine but when I check the product I see 'Title' updated but not the 'Price'.
Why?










share|improve this question














I'm trying to update the option values of an existing product custom option.



This is the code I've developed:



$product = Mage::getModel("catalog/product")->load($productId);
$titolo = 'Test';
$prezzo = 123.00;
foreach ($product->getOptions() as $custom_option)
if (self::CUSTOM_OPTION_TITLE == $custom_option->getTitle())
$custom_option_values = $custom_option->getValues();
$values = array();
foreach($custom_option_values as $custom_option_value)

if($custom_option_value["sku"] == $skuOpzione)

$values[$custom_option_value->getId()]['option_type_id']= $custom_option_value->getId();
$values[$custom_option_value->getId()]['option_id']= $custom_option_value->getOptionId();
$values[$custom_option_value->getId()]['default_title']= $titolo;
$values[$custom_option_value->getId()]['store_title']= $titolo;
$values[$custom_option_value->getId()]['title']= $titolo;
$values[$custom_option_value->getId()]['default_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['default_price_type']= 'fixed';
$values[$custom_option_value->getId()]['store_price']= floatval($prezzo);
$values[$custom_option_value->getId()]['store_price_type']= 'fixed';
$values[$custom_option_value->getId()]['price']= floatval($prezzo);
$values[$custom_option_value->getId()]['price_type']= 'fixed';

$custom_option_value->setValues($values);
$custom_option_value->saveValues();



$product->save();




All seems to work fine but when I check the product I see 'Title' updated but not the 'Price'.
Why?







magento-enterprise custom-options save






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 28 '17 at 10:31









WaPoNeWaPoNe

89511125




89511125












  • have you a result? I have this Problem, too :-( Dave

    – David
    Apr 13 '18 at 9:10











  • I don't know if it can still be useful but it's necessary set: $custom_option_value->setStoreId('0');

    – Shaibon
    May 20 at 16:02

















  • have you a result? I have this Problem, too :-( Dave

    – David
    Apr 13 '18 at 9:10











  • I don't know if it can still be useful but it's necessary set: $custom_option_value->setStoreId('0');

    – Shaibon
    May 20 at 16:02
















have you a result? I have this Problem, too :-( Dave

– David
Apr 13 '18 at 9:10





have you a result? I have this Problem, too :-( Dave

– David
Apr 13 '18 at 9:10













I don't know if it can still be useful but it's necessary set: $custom_option_value->setStoreId('0');

– Shaibon
May 20 at 16:02





I don't know if it can still be useful but it's necessary set: $custom_option_value->setStoreId('0');

– Shaibon
May 20 at 16:02










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f195076%2fmagento-1-update-custom-option-price-value-programmatically%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f195076%2fmagento-1-update-custom-option-price-value-programmatically%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form