B2B quick order add to cart throws error when gift card is added.

Preconditions (*)

  • Magento 2.4.2 EE installed
  • B2B modules are installed

Steps to reproduce (*)

  • Enable Quick order in B2B configuration
  • On frontend quick order page add gift card sku in Enter SKU or Product Name field
  • Then click on Add to Cart

Expected result (*)

  • It should redirect to cart page with warning 1 product requires your attention.

Actual result (*)

It redirects to following url http://local.m242ee.com/quickorder/sku/uploadfile/ and shows error as below in the browser.

Error: Call to undefined method Magento\Catalog\Api\Data\ProductExtension::getDiscounts() in /var/www/html/m242ee/vendor/magento/module-sales-rule/Model/Quote/Discount.php:284 Stack trace: #0 /var/www/html/m242ee/vendor/magento/module-sales-rule/Model/Quote/Discount.php(176): Magento\SalesRule\Model\Quote\Discount->aggregateDiscountPerRule() #1 /var/www/html/m242ee/vendor/magento/module-quote/Model/Quote/TotalsCollector.php(274): Magento\SalesRule\Model\Quote\Discount->collect() #2 /var/www/html/m242ee/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Quote\Model\Quote\TotalsCollector->collectAddressTotals() #3 /var/www/html/m242ee/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Quote\Model\Quote\TotalsCollector\Interceptor->___callParent() #4

Check this. Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.