Skip to main content
edited title
Link

How to change totals of Magento 2 Quote not saving datacart

added 18 characters in body; edited tags
Source Link
PЯINCƎ
  • 11.7k
  • 3
  • 25
  • 82

$quote = $this->quoteFactory->create()->load($quote_id); $quote->setSubtotalWithDiscount(number_format((float)0, 4, '.', '')); $quote->setBaseSubtotalWithDiscount(number_format((float)0, 4, '.', '')); $quote->setGrandTotal(number_format((float)0, 4, '.', '')); $quote->setBaseGrandTotal(number_format((float)0, 4, '.', '')); if($quote->save()) { echo 'Done';}

 $quote = $this->quoteFactory->create()->load($quote_id);
 $quote->setSubtotalWithDiscount(number_format((float)0, 4, '.', ''));
 $quote->setBaseSubtotalWithDiscount(number_format((float)0, 4, '.', ''));
 $quote->setGrandTotal(number_format((float)0, 4, '.', ''));
 $quote->setBaseGrandTotal(number_format((float)0, 4, '.', ''));
 if($quote->save())
 {
     echo 'Done';
 }

    It echos data but data is not inserting....

$quote = $this->quoteFactory->create()->load($quote_id); $quote->setSubtotalWithDiscount(number_format((float)0, 4, '.', '')); $quote->setBaseSubtotalWithDiscount(number_format((float)0, 4, '.', '')); $quote->setGrandTotal(number_format((float)0, 4, '.', '')); $quote->setBaseGrandTotal(number_format((float)0, 4, '.', '')); if($quote->save()) { echo 'Done';}

It echos data but data is not inserting....
 $quote = $this->quoteFactory->create()->load($quote_id);
 $quote->setSubtotalWithDiscount(number_format((float)0, 4, '.', ''));
 $quote->setBaseSubtotalWithDiscount(number_format((float)0, 4, '.', ''));
 $quote->setGrandTotal(number_format((float)0, 4, '.', ''));
 $quote->setBaseGrandTotal(number_format((float)0, 4, '.', ''));
 if($quote->save())
 {
     echo 'Done';
 }

    It echos data but data is not inserting....
Source Link

Magento 2 Quote not saving data

$quote = $this->quoteFactory->create()->load($quote_id); $quote->setSubtotalWithDiscount(number_format((float)0, 4, '.', '')); $quote->setBaseSubtotalWithDiscount(number_format((float)0, 4, '.', '')); $quote->setGrandTotal(number_format((float)0, 4, '.', '')); $quote->setBaseGrandTotal(number_format((float)0, 4, '.', '')); if($quote->save()) { echo 'Done';}

It echos data but data is not inserting....