How to solve Magento2.3.2 optionConfig[optionValue].prices undefined?Magento 2: New module causing crashHow to display tier prices in custom page in magento 2?Magento2 : Problem in block creationMagento2 Product Listing - Show product optionsMagento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formWhat is the proper way to override the getFinalPrice method based on value of 2 customizable option text fields?Magento 2 - Get Custom Options Price in Transactional EmailAdd class or data-attribute to product optionsHow to create custom form in Magento 2.2.3

Print the last, middle and first character of your code

Is Trump personally blocking people on Twitter?

Professor falsely accusing me of cheating in a class he does not teach, two months after end of the class. What precautions should I take?

How can I deal with a player trying to insert real-world mythology into my homebrew setting?

What explains 9 speed cassettes price differences?

The monorail explodes before I can get on it

Is an acid a salt or not?

Single word for "refusing to move to next activity unless present one is completed."

A pyramid from a square

Why are they 'nude photos'?

Why would guns not work in the dungeon?

How do Windows version numbers work?

Is there any word for "disobedience to God"?

How do you create draggable points inside a graphic image?

As the Dungeon Master, how do I handle a player that insists on a specific class when I already know that choice will cause issues?

<schwitz>, <zwinker> etc. Does German always use 2nd Person Singular Imperative verbs for emoticons? If so, why?

How were Martello towers supposed to work?

Why are Hobbits so fond of mushrooms?

Who Can Help Retag This?

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?

Robbers: The Hidden OEIS Substring

Should I intentionally omit previous work experience when applying for jobs?

Was lunar module "pilot" Harrison Schmitt legally a "pilot" at the time?

Why isn't there research to build a standard lunar, or Martian mobility platform?



How to solve Magento2.3.2 optionConfig[optionValue].prices undefined?


Magento 2: New module causing crashHow to display tier prices in custom page in magento 2?Magento2 : Problem in block creationMagento2 Product Listing - Show product optionsMagento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formWhat is the proper way to override the getFinalPrice method based on value of 2 customizable option text fields?Magento 2 - Get Custom Options Price in Transactional EmailAdd class or data-attribute to product optionsHow to create custom form in Magento 2.2.3






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








0















I have a custom module creating a custom option group for products. I managed to have the admin and frontend display working, I can see the custom options checkboxes and I can select them in the PDP page. Although when I select a normal custom option checkbox the price is updated, when I select this custom option group checkbox I get:




VM34870 price-options.js:71 Uncaught TypeError: Cannot read property 'prices' of undefined




I noticed that




optionConfig[optionValue].prices : is not defined




The checkboxes look fine on the frontend page and their ids and values seem to be correctly defined.



enter image description here



enter image description here



[![enter image description here][3]][3]



but I get this error on checking any checkbox of this specific group and the product price do not get updated:



enter image description here



The phtml file looks like this:



<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */

// @codingStandardsIgnoreFile
use MagentoCatalogModelProductOption;
use VendorModuleApiDataProductCustomOptionInterface as ProductCustomOptionInterface;

/** * @var MagentoCatalogBlockProductViewOptionsViewCheckable $block */ $option = $block->getOption(); if ($option) : ?>
<?php
$configValue = $block->getPreconfiguredValue($option);
$optionType = $option->getType();
$arraySign = $optionType === ProductCustomOptionInterface::OPTION_TYPE_CUSTOM ? '[]' : '';
$count = 1;
?>

<div class="options-list nested" id="options-<?php echo /* @noEscape
*/ $option->getId() ?>-list">

<?php foreach ($option->getValues() as $value) : ?>
<?php
$checked = 'checked';
$count++;
$dataSelector = 'options[' . $option->getId() . ']';
if ($arraySign)
$dataSelector .= '[' . $value->getOptionTypeId() . ']';

?>

<div class="field choice admin__field admin__field-option <?php >echo /* @noEscape */
$option->getIsRequire() ? 'required': '' ?>">
<input type="checkbox"
class="checkbox admin__control-checkbox required product-custom-option custom-checkbox
<?php echo $block->getSkipJsReloadPrice() ? '' : >'opConfig.reloadPrice()' ?>"
name="options[<?php echo $option->getId() ?>]<?php >echo /* @noEscape */
$arraySign ?>"
id="options_<?php echo /* @noEscape */
$option->getId() . '_' . $count ?>"
value="<?php echo /* @noEscape */
$value->getOptionTypeId() ?>"
<?php echo /* @noEscape */
$checked ?>
data-selector="<?php echo /* @noEscape */
$dataSelector ?>"
price="<?php echo /* @noEscape */
$block->getCurrencyByStore($value) ?>"
/>
<label class="label admin__field-label custom-checkbox"
for="options_<?php echo /* @noEscape */
$option->getId() . '_' . $count ?>">
<span>
<?php echo $block->escapeHtml($value->getTitle()) ?>
</span>
<?php echo /* @noEscape */
$block->formatPrice($value) ?>
</label>
</div>
<?php endforeach; ?>
</div> <?php endif; ?>

<script>
require([
'jquery',
'module', ], function ($)
$(document).ready(function ()
//$('.custom-checkbox').hide();
); );
</script>









share|improve this question






























    0















    I have a custom module creating a custom option group for products. I managed to have the admin and frontend display working, I can see the custom options checkboxes and I can select them in the PDP page. Although when I select a normal custom option checkbox the price is updated, when I select this custom option group checkbox I get:




    VM34870 price-options.js:71 Uncaught TypeError: Cannot read property 'prices' of undefined




    I noticed that




    optionConfig[optionValue].prices : is not defined




    The checkboxes look fine on the frontend page and their ids and values seem to be correctly defined.



    enter image description here



    enter image description here



    [![enter image description here][3]][3]



    but I get this error on checking any checkbox of this specific group and the product price do not get updated:



    enter image description here



    The phtml file looks like this:



    <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */

    // @codingStandardsIgnoreFile
    use MagentoCatalogModelProductOption;
    use VendorModuleApiDataProductCustomOptionInterface as ProductCustomOptionInterface;

    /** * @var MagentoCatalogBlockProductViewOptionsViewCheckable $block */ $option = $block->getOption(); if ($option) : ?>
    <?php
    $configValue = $block->getPreconfiguredValue($option);
    $optionType = $option->getType();
    $arraySign = $optionType === ProductCustomOptionInterface::OPTION_TYPE_CUSTOM ? '[]' : '';
    $count = 1;
    ?>

    <div class="options-list nested" id="options-<?php echo /* @noEscape
    */ $option->getId() ?>-list">

    <?php foreach ($option->getValues() as $value) : ?>
    <?php
    $checked = 'checked';
    $count++;
    $dataSelector = 'options[' . $option->getId() . ']';
    if ($arraySign)
    $dataSelector .= '[' . $value->getOptionTypeId() . ']';

    ?>

    <div class="field choice admin__field admin__field-option <?php >echo /* @noEscape */
    $option->getIsRequire() ? 'required': '' ?>">
    <input type="checkbox"
    class="checkbox admin__control-checkbox required product-custom-option custom-checkbox
    <?php echo $block->getSkipJsReloadPrice() ? '' : >'opConfig.reloadPrice()' ?>"
    name="options[<?php echo $option->getId() ?>]<?php >echo /* @noEscape */
    $arraySign ?>"
    id="options_<?php echo /* @noEscape */
    $option->getId() . '_' . $count ?>"
    value="<?php echo /* @noEscape */
    $value->getOptionTypeId() ?>"
    <?php echo /* @noEscape */
    $checked ?>
    data-selector="<?php echo /* @noEscape */
    $dataSelector ?>"
    price="<?php echo /* @noEscape */
    $block->getCurrencyByStore($value) ?>"
    />
    <label class="label admin__field-label custom-checkbox"
    for="options_<?php echo /* @noEscape */
    $option->getId() . '_' . $count ?>">
    <span>
    <?php echo $block->escapeHtml($value->getTitle()) ?>
    </span>
    <?php echo /* @noEscape */
    $block->formatPrice($value) ?>
    </label>
    </div>
    <?php endforeach; ?>
    </div> <?php endif; ?>

    <script>
    require([
    'jquery',
    'module', ], function ($)
    $(document).ready(function ()
    //$('.custom-checkbox').hide();
    ); );
    </script>









    share|improve this question


























      0












      0








      0








      I have a custom module creating a custom option group for products. I managed to have the admin and frontend display working, I can see the custom options checkboxes and I can select them in the PDP page. Although when I select a normal custom option checkbox the price is updated, when I select this custom option group checkbox I get:




      VM34870 price-options.js:71 Uncaught TypeError: Cannot read property 'prices' of undefined




      I noticed that




      optionConfig[optionValue].prices : is not defined




      The checkboxes look fine on the frontend page and their ids and values seem to be correctly defined.



      enter image description here



      enter image description here



      [![enter image description here][3]][3]



      but I get this error on checking any checkbox of this specific group and the product price do not get updated:



      enter image description here



      The phtml file looks like this:



      <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */

      // @codingStandardsIgnoreFile
      use MagentoCatalogModelProductOption;
      use VendorModuleApiDataProductCustomOptionInterface as ProductCustomOptionInterface;

      /** * @var MagentoCatalogBlockProductViewOptionsViewCheckable $block */ $option = $block->getOption(); if ($option) : ?>
      <?php
      $configValue = $block->getPreconfiguredValue($option);
      $optionType = $option->getType();
      $arraySign = $optionType === ProductCustomOptionInterface::OPTION_TYPE_CUSTOM ? '[]' : '';
      $count = 1;
      ?>

      <div class="options-list nested" id="options-<?php echo /* @noEscape
      */ $option->getId() ?>-list">

      <?php foreach ($option->getValues() as $value) : ?>
      <?php
      $checked = 'checked';
      $count++;
      $dataSelector = 'options[' . $option->getId() . ']';
      if ($arraySign)
      $dataSelector .= '[' . $value->getOptionTypeId() . ']';

      ?>

      <div class="field choice admin__field admin__field-option <?php >echo /* @noEscape */
      $option->getIsRequire() ? 'required': '' ?>">
      <input type="checkbox"
      class="checkbox admin__control-checkbox required product-custom-option custom-checkbox
      <?php echo $block->getSkipJsReloadPrice() ? '' : >'opConfig.reloadPrice()' ?>"
      name="options[<?php echo $option->getId() ?>]<?php >echo /* @noEscape */
      $arraySign ?>"
      id="options_<?php echo /* @noEscape */
      $option->getId() . '_' . $count ?>"
      value="<?php echo /* @noEscape */
      $value->getOptionTypeId() ?>"
      <?php echo /* @noEscape */
      $checked ?>
      data-selector="<?php echo /* @noEscape */
      $dataSelector ?>"
      price="<?php echo /* @noEscape */
      $block->getCurrencyByStore($value) ?>"
      />
      <label class="label admin__field-label custom-checkbox"
      for="options_<?php echo /* @noEscape */
      $option->getId() . '_' . $count ?>">
      <span>
      <?php echo $block->escapeHtml($value->getTitle()) ?>
      </span>
      <?php echo /* @noEscape */
      $block->formatPrice($value) ?>
      </label>
      </div>
      <?php endforeach; ?>
      </div> <?php endif; ?>

      <script>
      require([
      'jquery',
      'module', ], function ($)
      $(document).ready(function ()
      //$('.custom-checkbox').hide();
      ); );
      </script>









      share|improve this question
















      I have a custom module creating a custom option group for products. I managed to have the admin and frontend display working, I can see the custom options checkboxes and I can select them in the PDP page. Although when I select a normal custom option checkbox the price is updated, when I select this custom option group checkbox I get:




      VM34870 price-options.js:71 Uncaught TypeError: Cannot read property 'prices' of undefined




      I noticed that




      optionConfig[optionValue].prices : is not defined




      The checkboxes look fine on the frontend page and their ids and values seem to be correctly defined.



      enter image description here



      enter image description here



      [![enter image description here][3]][3]



      but I get this error on checking any checkbox of this specific group and the product price do not get updated:



      enter image description here



      The phtml file looks like this:



      <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */

      // @codingStandardsIgnoreFile
      use MagentoCatalogModelProductOption;
      use VendorModuleApiDataProductCustomOptionInterface as ProductCustomOptionInterface;

      /** * @var MagentoCatalogBlockProductViewOptionsViewCheckable $block */ $option = $block->getOption(); if ($option) : ?>
      <?php
      $configValue = $block->getPreconfiguredValue($option);
      $optionType = $option->getType();
      $arraySign = $optionType === ProductCustomOptionInterface::OPTION_TYPE_CUSTOM ? '[]' : '';
      $count = 1;
      ?>

      <div class="options-list nested" id="options-<?php echo /* @noEscape
      */ $option->getId() ?>-list">

      <?php foreach ($option->getValues() as $value) : ?>
      <?php
      $checked = 'checked';
      $count++;
      $dataSelector = 'options[' . $option->getId() . ']';
      if ($arraySign)
      $dataSelector .= '[' . $value->getOptionTypeId() . ']';

      ?>

      <div class="field choice admin__field admin__field-option <?php >echo /* @noEscape */
      $option->getIsRequire() ? 'required': '' ?>">
      <input type="checkbox"
      class="checkbox admin__control-checkbox required product-custom-option custom-checkbox
      <?php echo $block->getSkipJsReloadPrice() ? '' : >'opConfig.reloadPrice()' ?>"
      name="options[<?php echo $option->getId() ?>]<?php >echo /* @noEscape */
      $arraySign ?>"
      id="options_<?php echo /* @noEscape */
      $option->getId() . '_' . $count ?>"
      value="<?php echo /* @noEscape */
      $value->getOptionTypeId() ?>"
      <?php echo /* @noEscape */
      $checked ?>
      data-selector="<?php echo /* @noEscape */
      $dataSelector ?>"
      price="<?php echo /* @noEscape */
      $block->getCurrencyByStore($value) ?>"
      />
      <label class="label admin__field-label custom-checkbox"
      for="options_<?php echo /* @noEscape */
      $option->getId() . '_' . $count ?>">
      <span>
      <?php echo $block->escapeHtml($value->getTitle()) ?>
      </span>
      <?php echo /* @noEscape */
      $block->formatPrice($value) ?>
      </label>
      </div>
      <?php endforeach; ?>
      </div> <?php endif; ?>

      <script>
      require([
      'jquery',
      'module', ], function ($)
      $(document).ready(function ()
      //$('.custom-checkbox').hide();
      ); );
      </script>






      magento2 requirejs






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 5 at 3:59









      poojan sharma

      8651 silver badge10 bronze badges




      8651 silver badge10 bronze badges










      asked Jul 3 at 21:53









      AndradaAndrada

      366 bronze badges




      366 bronze badges




















          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%2f280699%2fhow-to-solve-magento2-3-2-optionconfigoptionvalue-prices-undefined%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%2f280699%2fhow-to-solve-magento2-3-2-optionconfigoptionvalue-prices-undefined%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

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

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?