3

I added a required customization option (not sure about the name in English, in French, it's "Option personalisable").

On the front, there is no problem until you try to add the product to the cart. At this moment it's printing you this message :

"The product's required option(s) weren't entered. Make sure the options are entered and try again."

I tried to get where the problem was happening in the code, and I found the place where the error was triggered :

vendor/magento/module-catalog/Model/Product/Option/Type/DefaultType.php
l216.

When I tried to print get type($value), it gave me a "null".

I tried to go further in the core but cannot find where the bug is happening.

1 Answer 1

0

I don't have 50 reputation, so I can't comment yet.

I had your same problem, so I decided to trace back my steps until things were working. I found out that I actually made some changes in the catalog_product_view file, in my

MAGENTO_ROOT*/app/design/frontend/vendor/module/Magento_Catalog/layout

and that was the source of the problem. I also noticed that not only I was unable to add product to cart, but also when trying to select options for products WITHOUT required options, the product price was not changing (while it should have, since those options have a price increase/decrease)

Reverting the changes I made in this file solved the problem for me. Even if this may not be your case, it's worth to check what happens in the product page. It may sound obvious, but maybe you made a little change in the "add to cart" button or dropdown menu to make them look better, something that you might think does not affect Magento but it does instead (just like in my case, I thought a layout file had nothing to do with the code behind).

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.