cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent: error on cart and checkout

Urgent: error on cart and checkout

Hi.

Using magento 2.4.1 i was just trying some setting in admin ( enabled paypal express ) and shopping cart and checkout page just shows all sorts of errors . here is the errors displayed on the site .

Loading...TypeError: explode() expects parameter 2 to be string, null given in /var/www/comeau/html/vendor/paypal/module-braintree-core/Model/Lpm/Config.php:125 Stack trace: #0 /var/www/comeau/html/vendor/paypal/module-braintree-core/Model/Lpm/Config.php(125): explode() #1 /var/www/comeau/html/vendor/paypal/module-braintree-core/Model/Lpm/Ui/ConfigProvider.php(39): PayPal\Braintree\Model\Lpm\Config->getAllowedMethods() #2 /var/www/comeau/html/vendor/magento/module-checkout/Model/CompositeConfigProvider.php(39): PayPal\Braintree\Model\Lpm\Ui\ConfigProvider->getConfig() #3 /var/www/comeau/html/vendor/magento/module-checkout/Block/Onepage.php(106): Magento\Checkout\Model\CompositeConfigProvider->getConfig() #4 /var/www/comeau/html/vendor/magento/module-checkout/Block/Onepage.php(128): Magento\Checkout\Block\Onepage->getCheckoutConfig() #5 /var/www/comeau/html/vendor/magento/module-checkout/view/frontend/templates/onepage.phtml(27): Magento\Checkout\Block\Onepage->getSerializedCheckoutConfig() #6 /var/www/comeau/html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/var/www/comeau...') #7 /var/www/comeau/html/vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render() #8 /var/www/comeau/html/vendor/magento/framework/View/Element/Template.php(303): Magento\Framework\View\Element\Template->fetchView() #9 /var/www/comeau/html/vendor/magento/framework/View/Element/AbstractBlock.php(1111): Magento\Framework\View\Element\Template->_toHtml() #10 /var/www/comeau/html/vendor/magento/framework/View/Element/AbstractBlock.php(1115): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() #11 /var/www/comeau/html/vendor/magento/framework/View/Element/AbstractBlock.php(675): Magento\Framework\View\Element\AbstractBlock->_loadCache() #12 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(566): Magento\Framework\View\Element\AbstractBlock->toHtml() #13 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Layout->_renderBlock() #14 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement() #15 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() #16 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement() #17 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement() #18 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer() #19 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement() #20 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() #21 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement() #22 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement() #23 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer() #24 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement() #25 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() #26 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement() #27 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement() #28 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer() #29 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement() #30 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() #31 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement() #32 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement() #33 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer() #34 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement() #35 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() #36 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement() #37 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement() #38 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer() #39 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement() #40 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() #41 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement() #42 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement() #43 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer() #44 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement() #45 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() #46 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement() #47 /var/www/comeau/html/vendor/magento/framework/View/Layout.php(963): Magento\Framework\View\Layout\Interceptor->renderElement() #48 /var/www/comeau/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput() #49 /var/www/comeau/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent() #50 /var/www/comeau/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() #51 /var/www/comeau/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(347): Magento\Framework\View\Layout\Interceptor->___callPlugins() #52 /var/www/comeau/html/vendor/magento/framework/View/Result/Page.php(258): Magento\Framework\View\Layout\Interceptor->getOutput() #53 /var/www/comeau/html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render() #54 /var/www/comeau/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult() #55 /var/www/comeau/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent() #56 /var/www/comeau/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() #57 /var/www/comeau/html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(23): Magento\Framework\View\Result\Page\Interceptor->___callPlugins() #58 /var/www/comeau/html/vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult() #59 /var/www/comeau/html/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->launch() #60 /var/www/comeau/html/pub/index.php(40): Magento\Framework\App\Bootstrap->run() #61 {main}

I have put the setting back to what it was . cleared flushed and deployed , even compiled with no changes. I just put the store in maintenance mode and still trying to figure what has gone wrong . I also changed the template to Luma and got same result any help would be greatly appreciated.

Thanks.

3 REPLIES 3

Re: Urgent: error on cart and checkout

hi. 

managed to fix this by rolling back database to previous backup. however, I still like to know why this happened. i the error , it shows paypal_braintree . although i have paypal express but I never enabled braintree . i appreciate if anyone can shed some light on this matter. 

 

Thanks.  

Re: Urgent: error on cart and checkout

Hello @tonysargma79f8 

 

Kindly refer below code and make changes in file.

File path : // /vendor/paypal/module-braintree-core/Model/Lpm/Config.php

public function getAllowedMethods(): array
{

    $this->allowedMethods = [];

    $allowedMethods = [];

    

    if ($this->getValue(self::KEY_ALLOWED_METHODS,$this->storeConfigResolver->getStoreId()))

    {

        $allowedMethods = explode(

                                  ',',

                                  $this->getValue(

                                                  self::KEY_ALLOWED_METHODS,

                                                  $this->storeConfigResolver->getStoreId()

                                                  )

                                  );

    }

 

    foreach ($allowedMethods as $allowedMethod) {

        $this->allowedMethods[] = [

            'method' => $allowedMethod,

            'label' => constant('self::LABEL_'.strtoupper($allowedMethod)),

            'countries' => constant('self::COUNTRIES_'.strtoupper($allowedMethod))

        ];

    }

    return $this->allowedMethods;

}

It may help you!
Thank you

Problem solved? Click Accept as Solution!

Re: Urgent: error on cart and checkout

Hi @tonysargma79f8 ,

 

This is because of some bug in module-braintree-core.

 

Quick fix you can implement by adding data in merchant ID field.

 

If you are enabling just for testing purpose and you don't have even real data still you can add  value testmode into merchant ID field and then it will not gives you any error on cart and checkout.

 

Problem solved? Click Accept as Solution!

 

Hope it helps!

Thanks

Ankit Jasani