cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 - customer - products in cart

Magento 2 - customer - products in cart

I have a question about the products(with options) in cart in connection with a customer account(login).

In my Magento 2.4.3 the following issue occures:

If I´m not logged in as a customer and add a product to cart and afterwards I login as a customer then the product I added to cart before I logged in there is the following issue:

Blank page with the following note:


<div class="product-add-form">
<form action=".../checkout/cart/add/uenc/aHR0cHM...bWw%2C/product/1351/" method="post"
id="product_addtocart_form" enctype="multipart/form-data">
<input type="hidden" name="product" value="1351" />
<input type="hidden" name="selected_configurable_option" value="" />
<input type="hidden" name="related_product" id="related-products-field" value="" />
<input type="hidden" name="item" value="1351" />
<input name="form_key" type="hidden" value="51Sed...Hju4" />

<div class="product-options-wrapper" id="product-options-wrapper" data-hasrequired="&#x2A;&#x20;required">
<div class="fieldset" tabindex="0">

<script type="text/x-magento-init">
{
"#product_addtocart_form": {
"priceOptions": {
"optionConfig": An error has happened during application run.

 

the products that are already saved in customer account are all accessible and if I now logout and login again than I can view the product without any issues.

I looks like this have something to do with customer account(session) and products with options.

Thanks for any advice.

3 REPLIES 3

Re: Magento 2 - customer - products in cart

The key is "An error has happened during application run."

 

Check your exception log and see what the error is.

Founder at https://agency418.com

Re: Magento 2 - customer - products in cart

Here is the debug.log:

main.CRITICAL: TypeError: Argument 1 passed to Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule::execute() must be an instance of Magento\Catalog\Model\Product, null given,
called in /.../vendor/magento/module-catalog/Model/Product/Option/Value.php on line 270 and defined in /.../vendor/magento/module-catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php:49
Stack trace:
#0 /.../vendor/magento/module-catalog/Model/Product/Option/Value.php(270): Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule->execute(NULL, 0, false)
#1 /.../generated/code/MageWorx/OptionBase/Model/Product/Option/Value/Interceptor.php(140): Magento\Catalog\Model\Product\Option\Value->getPrice(true)
#2 /.../vendor/magento/module-catalog/Block/Product/View/Options.php(171): MageWorx\OptionBase\Model\Product\Option\Value\Interceptor->getPrice(true)
#3 /.../vendor/magento/module-catalog/Block/Product/View/Options.php(227): Magento\Catalog\Block\Product\View\Options->_getPriceConfiguration(Object(MageWorx\OptionBase\Model\Product\Option\Value\Interceptor))
#4 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Catalog\Block\Product\View\Options->getJsonConfig()
#5 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\View\Options\Interceptor->___callParent('getJsonConfig', Array)
#6 /.../app/code/MageWorx/OptionAdvancedPricing/Plugin/ExtendPriceConfig.php(97): Magento\Catalog\Block\Product\View\Options\Interceptor->Magento\Framework\Interception\{closure}()
#7 /.../generated/code/MageWorx/OptionAdvancedPricing/Plugin/ExtendPriceConfig/Interceptor.php(23): MageWorx\OptionAdvancedPricing\Plugin\ExtendPriceConfig->aroundGetJsonConfig(Object(Magento\Catalog\Block\Product\View\Options\Interceptor), Object(Closure))
#8 /.../vendor/magento/framework/Interception/Interceptor.php(150): MageWorx\OptionAdvancedPricing\Plugin\ExtendPriceConfig\Interceptor->aroundGetJsonConfig(Object(Magento\Catalog\Block\Product\View\Options\Interceptor), Object(Closure))
#9 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Catalog\Block\Product\View\Options\Interceptor->Magento\Framework\Interception\{closure}()
#10 /.../generated/code/Magento/Catalog/Block/Product/View/Options/Interceptor.php(68): Magento\Catalog\Block\Product\View\Options\Interceptor->___callPlugins('getJsonConfig', Array, NULL)
#11 /.../app/design/frontend/Codazon/fastest/fashion/Magento_Catalog/templates/product/view/options.phtml(18): Magento\Catalog\Block\Product\View\Options\Interceptor->getJsonConfig()
#12 /.../vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/usr/local/www/...')
#13 /.../vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Options\Interceptor), '/usr/local/www/...', Array)
#14 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Element\Template->fetchView('/usr/local/www/...')
#15 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\View\Options\Interceptor->___callParent('fetchView', Array)
#16 /.../app/code/Manadev/Core/Plugins/ViewWithTemplate.php(33): Magento\Catalog\Block\Product\View\Options\Interceptor->Magento\Framework\Interception\{closure}('/usr/local/www/...')
#17 /.../vendor/magento/framework/Interception/Interceptor.php(150): Manadev\Core\Plugins\ViewWithTemplate->aroundFetchView(Object(Magento\Catalog\Block\Product\View\Options\Interceptor), Object(Closure), '/usr/local/www/...')
#18 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Catalog\Block\Product\View\Options\Interceptor->Magento\Framework\Interception\{closure}('/usr/local/www/...')
#19 /.../generated/code/Magento/Catalog/Block/Product/View/Options/Interceptor.php(149): Magento\Catalog\Block\Product\View\Options\Interceptor->___callPlugins('fetchView', Array, NULL)
#20 /.../vendor/magento/framework/View/Element/Template.php(303): Magento\Catalog\Block\Product\View\Options\Interceptor->fetchView('/usr/local/www/...')
#21 /.../vendor/magento/framework/View/Element/AbstractBlock.php(1114): Magento\Framework\View\Element\Template->_toHtml()
#22 /.../vendor/magento/framework/View/Element/AbstractBlock.php(1118): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#23 /.../vendor/magento/framework/View/Element/AbstractBlock.php(678): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#24 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Element\AbstractBlock->toHtml()
#25 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\View\Options\Interceptor->___callParent('toHtml', Array)
#26 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Catalog\Block\Product\View\Options\Interceptor->Magento\Framework\Interception\{closure}()
#27 /.../generated/code/Magento/Catalog/Block/Product/View/Options/Interceptor.php(374): Magento\Catalog\Block\Product\View\Options\Interceptor->___callPlugins('toHtml', Array, Array)
#28 /.../vendor/magento/framework/View/Layout.php(578): Magento\Catalog\Block\Product\View\Options\Interceptor->toHtml()
#29 /.../vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock('product.info.op...')
#30 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('product.info.op...')
#31 /.../vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('product.info.op...')
#32 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('product.info.op...', true)
#33 /.../vendor/magento/framework/View/Element/AbstractBlock.php(529): Magento\Framework\View\Layout\Interceptor->renderElement('product.info.op...', true)
#34 /.../generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(545): Magento\Framework\View\Element\AbstractBlock->getChildHtml('', true)
#35 /.../vendor/magento/module-catalog/view/frontend/templates/product/view/options/wrapper.phtml(17): Magento\Catalog\Block\Product\View\Interceptor->getChildHtml('', true)
#36 /.../vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/usr/local/www/...')
#37 /.../vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Interceptor), '/usr/local/www/...', Array)
#38 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Element\Template->fetchView('/usr/local/www/...')
#39 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\View\Interceptor->___callParent('fetchView', Array)
#40 /.../app/code/Manadev/Core/Plugins/ViewWithTemplate.php(33): Magento\Catalog\Block\Product\View\Interceptor->Magento\Framework\Interception\{closure}('/usr/local/www/...')
#41 /.../vendor/magento/framework/Interception/Interceptor.php(150): Manadev\Core\Plugins\ViewWithTemplate->aroundFetchView(Object(Magento\Catalog\Block\Product\View\Interceptor), Object(Closure), '/usr/local/www/...')
#42 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Catalog\Block\Product\View\Interceptor->Magento\Framework\Interception\{closure}('/usr/local/www/...')
#43 /.../generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(383): Magento\Catalog\Block\Product\View\Interceptor->___callPlugins('fetchView', Array, NULL)
#44 /.../vendor/magento/framework/View/Element/Template.php(303): Magento\Catalog\Block\Product\View\Interceptor->fetchView('/usr/local/www/...')
#45 /.../vendor/magento/framework/View/Element/AbstractBlock.php(1114): Magento\Framework\View\Element\Template->_toHtml()
#46 /.../vendor/magento/framework/View/Element/AbstractBlock.php(1118): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#47 /.../vendor/magento/framework/View/Element/AbstractBlock.php(678): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#48 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Element\AbstractBlock->toHtml()
#49 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\View\Interceptor->___callParent('toHtml', Array)
#50 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Catalog\Block\Product\View\Interceptor->Magento\Framework\Interception\{closure}()
#51 /.../generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(608): Magento\Catalog\Block\Product\View\Interceptor->___callPlugins('toHtml', Array, Array)
#52 /.../vendor/magento/framework/View/Layout.php(578): Magento\Catalog\Block\Product\View\Interceptor->toHtml()
#53 /.../vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock('product.info.op...')
#54 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('product.info.op...')
#55 /.../vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('product.info.op...')
#56 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('product.info.op...', true)
#57 /.../vendor/magento/framework/View/Element/AbstractBlock.php(560): Magento\Framework\View\Layout\Interceptor->renderElement('product.info.op...', true)
#58 /.../generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(554): Magento\Framework\View\Element\AbstractBlock->getChildChildHtml('options_contain...', '', true)
#59 /.../app/design/frontend/Codazon/fastest/fashion/Magento_Catalog/templates/product/view/form.phtml(38): Magento\Catalog\Block\Product\View\Interceptor->getChildChildHtml('options_contain...')
#60 /.../vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/usr/local/www/...')
#61 /.../vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Interceptor), '/usr/local/www/...', Array)
#62 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Element\Template->fetchView('/usr/local/www/...')
#63 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\View\Interceptor->___callParent('fetchView', Array)
#64 /.../app/code/Manadev/Core/Plugins/ViewWithTemplate.php(33): Magento\Catalog\Block\Product\View\Interceptor->Magento\Framework\Interception\{closure}('/usr/local/www/...')
#65 /.../vendor/magento/framework/Interception/Interceptor.php(150): Manadev\Core\Plugins\ViewWithTemplate->aroundFetchView(Object(Magento\Catalog\Block\Product\View\Interceptor), Object(Closure), '/usr/local/www/...')
#66 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Catalog\Block\Product\View\Interceptor->Magento\Framework\Interception\{closure}('/usr/local/www/...')
#67 /.../generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(383): Magento\Catalog\Block\Product\View\Interceptor->___callPlugins('fetchView', Array, NULL)
#68 /.../vendor/magento/framework/View/Element/Template.php(303): Magento\Catalog\Block\Product\View\Interceptor->fetchView('/usr/local/www/...')
#69 /.../vendor/magento/framework/View/Element/AbstractBlock.php(1114): Magento\Framework\View\Element\Template->_toHtml()
#70 /.../vendor/magento/framework/View/Element/AbstractBlock.php(1118): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#71 /.../vendor/magento/framework/View/Element/AbstractBlock.php(678): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#72 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Element\AbstractBlock->toHtml()
#73 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\View\Interceptor->___callParent('toHtml', Array)
#74 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Catalog\Block\Product\View\Interceptor->Magento\Framework\Interception\{closure}()
#75 /.../generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(608): Magento\Catalog\Block\Product\View\Interceptor->___callPlugins('toHtml', Array, Array)
#76 /.../vendor/magento/framework/View/Layout.php(578): Magento\Catalog\Block\Product\View\Interceptor->toHtml()
#77 /.../vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock('product.info')
#78 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('product.info')
#79 /.../vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('product.info')
#80 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('product.info', false)
...
#120 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('root', true)
#121 /.../vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout\Interceptor->renderElement('root')
#122 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Layout->getOutput()
#123 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', Array)
#124 /.../app/code/Manadev/LayeredNavigationAjax/Plugins/LayoutPlugin.php(34): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}()
#125 /.../vendor/magento/framework/Interception/Interceptor.php(150): Manadev\LayeredNavigationAjax\Plugins\LayoutPlugin->aroundGetOutput(Object(Magento\Framework\View\Layout\Interceptor), Object(Closure))
#126 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}()
#127 /.../generated/code/Magento/Framework/View/Layout/Interceptor.php(347): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, NULL)
#128 /.../vendor/magento/framework/View/Result/Page.php(260): Magento\Framework\View\Layout\Interceptor->getOutput()
#129 /.../vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#130 /.../vendor/magento/framework/Interception/Interceptor.php(64): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#131 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#132 /.../app/code/Manadev/LayeredNavigationAjax/Plugins/LayoutResultPlugin.php(35): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#133 /.../vendor/magento/framework/Interception/Interceptor.php(150): Manadev\LayeredNavigationAjax\Plugins\LayoutResultPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#134 /.../vendor/magento/framework/Interception/Interceptor.php(168): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#135 /.../generated/code/Magento/Framework/View/Result/Page/Interceptor.php(95): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, NULL)
#136 /.../vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#137 /.../generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#138 /.../vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#139 /.../pub/index.php(32): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#140 {main} [] []

Re: Magento 2 - customer - products in cart

You have some sort of MageWorx custom options extension that is causing the issue. Try disabling that extension and see if the issue persists. If that fixes it, if you have support fromt hat extension provider, send them over the exception log you posted here and ask for their help in fixing it.

 

If not, contact an experience development agency to fix it for you.

Founder at https://agency418.com