0

finding this issue

Call to a member function renderAmount() on false in /var/www/html/fccstgdec/vendor/magento/module-catalog/Block/Product/View/Options/AbstractOptions.php:206

currently we are using Magento version 2.4.7 and Mageplaza One Step checkout version 4.3.3 and Stripe payment gatway version 4.3.1 Please review all conditions and suggest for fixing issue

2
  • You would need to provide more information here to get any useful advice. For example, where do you see this error? Here are a couple of clarifications to begin with; Is it when you're on a product page or checkout? Have you confirmed the product is set up correctly and across all store views? Commented Feb 26 at 9:28
  • You need to cross verify first by disabling third party extensions one by one. Commented Feb 28 at 13:27

1 Answer 1

0

The error from $this->getLayout()->getBlock('product.price.render.default') returns false because it cannot find the block with the name product.price.render.default. I have installed One Step Checkout version 4.3.3 and Stripe Payment Gateway version 4.3.1. But I did not get any errors. You can debug more by logging this in the function _formatPrice at line 206:

 $writer = new \Zend_Log_Writer_Stream(BP . '/var/log/Layout.log'); $logger = new \Zend_Log(); $logger->addWriter($writer); $logger->info($this->getLayout()->getUpdate()->asString()); $priceStr .= $this->getLayout()->getBlock('product.price.render.default')->renderAmount( $optionAmount, $customOptionPrice, $this->getProduct() ); 

Then, get this block:

.... <body> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> <arguments> <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> </arguments> </block> </body> .... 

Magento creates the product.price.render.default block, so after that, $this->getLayout()->getBlock('product.price.render.default') should not be false. If you cannot find this block or see the following code:

 <referenceBlock name="product.price.render.default" remove="true"> 

then Magento cannot render the price HTML. Maybe some module remove this block.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.