[v1.2.2] Fix the error "We can't add the item to the cart right now."

Created by Rosa Truong, Modified on Mon, 30 Aug, 2021 at 8:57 PM by Rosa Truong

Issue: 

We're using version 1.2.2 on Magento 2.4.2 and we find an issue as below.

Steps to reproduce: add a configurable product to the wishlist, go to wishlist and try to add the product to the cart.

Expected result: You get redirected to the product page with a notice to select an option.

Actual result: You get an error "We can't add the item to the cart right now."

Could you please check and fix it?


Solution:

This issue is the module's bug in the current version 1.2.2.

This class treats one of its parameters, $requestInfo, as if it would be an array.

However, that parameter is an object which causes an exception on line 179  $requestInfo['super_attribute'][$key] = "";

Please change and replace the code in the file app/code/Bss_HidePrice/Plugin/Checkout/Model/Cart.php.


If you have any issues, please feel free to contact us.

We'd like to help.


Attachments (1)

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article