-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display minimal configurable product special price cause Error : Call to undefined method ReflectionUnionType::getName() in /var/www/html/vendor/magento/framework/Interception/Code/Generator/Interceptor.php:216 #39719
Comments
Hi @Nolwennig-Jeulin. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Thank you for your reporting and collaboration. To speed up the processing of this issue, please provide us with the following information:
Thanks. |
@Nolwennig-Jeulin Hello, I'm pretty sure that this error is due to the fact that you are using a Union type as a return type in your class : [...]
public function getMinimalChildPriceAMount() : Base|bool // <==== This is the error
// You might replace it with
public function getMinimalChildPriceAMount() // <==== No return type
// Or with
public function getMinimalChildPriceAMount() : ?Base // <==== You need to return null instead of false
[...] This error is caused by the interceptor generator not managing correctly Union Type return before the latest magento version. You can take a look at this file if you want to apply patch to the core yourself but I'm pretty sure that removing the union typing is a better solution. Anyway, this is not an issue on the current magento branch. @engcom-Bravo I think the issue can be closed if @Nolwennig-Jeulin confirms the solution. |
@bhennesAdv Hello, Thank you very much for the answer Yes I'm on Your solution sounds like good. I check this out this week and I close afterwards |
Hello @Nolwennig-Jeulin, Could you confirm the resolution (and close the issue if so) ? Kind Regards, |
Hi Baptiste, It's work like a charm. Thank again |
In file
src/app/code/Custom/Catalog/view/frontend/templates/product/list.phtml
at line 303 I have call to<?= /* @noEscape */ $block->getProductPrice($product); ?>
This call use
src/vendor/magento/module-catalog/Block/Product/ListProduct.php
src/app/code/Custom/ConfigurableProduct/view/frontend/templates/product/price/final_price.phtml
$block
issrc/app/code/Custom/ConfigurableProduct/Pricing/Render/FinalPriceBox.php
In
src/app/code/Custom/ConfigurableProduct/Pricing/Render/FinalPriceBox.php
, I have :In frontend
https://custom.local/store_code/path/to/category/with/configurable-products.html
(aftersetup:upgrade
) I'm block by the errorThe error is located in
magento2/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php
Line 216 in ca0c22e
The text was updated successfully, but these errors were encountered: