0

I override the braintree module after that I'm getting this error. can anyone help me.

Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Braintree\Block\Paypal\Button
2
  • please add your code Commented Apr 3, 2019 at 5:38
  • I just override the app/code/Magento/Braintree/Model/Ui/ConfigProvider.php file only Commented Apr 3, 2019 at 5:51

1 Answer 1

0

In your custom module, app/code/Module/Namespace/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento/Braintree/Model/Ui/ConfigProvider" type="your/file/path" />
</config>

Then place the ConfigProvider.php in Module\Namespace\Model\Ui\ path.

Then in that file rewrite,

namespace Module\Namespace\Model\Ui;


/**
 * Class Form
 */

class ConfigProvider extends \Magento\Braintree\Model\Ui\ConfigProvider
{

    public function YourFunction()
    {
          #your code
    }

}
1
  • rewrite the file but error displaying in cart page Commented Apr 3, 2019 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.