2

I need to convert a quote from one store in GBP to another website store in EUR dynamically on the fly, but i can save the item with the new store_Id and the quote with the correct store_id but collectTotals is not recalculating to get the store level prices.

       $quote = $this->quoteRepository->getActive($cartId);

        $quote->setStore($store);

        $items =  $this->quoteRepository->getActive($cartId)->getAllItems();
        foreach($items as $item)
        {
            $item = $quote->getItemById($item->getId());
            $item->setData('store_id',$storeId);
            $item->calcRowTotal();
            $item->getProduct()->setIsSuperMode(true);
            $item->save();
        }

        $quote->setTotalsCollectedFlag(false)->collectTotals()->save();

Any advice? Or any ideas would be appreciated.

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.