Question

I'm adding an additional option and custom price of a product via custom api Call in quote using this code

 $quote->addProduct($_product, 1)
            ->addOption(array(
                'product_id' => $_product->getId(),
                'code' => 'additional_options',
                'value' => $this->serializer->serialize($additionalOptions)
            ))
            ->setCustomPrice($result['sample_price'])
            ->setWeight($result['sample_weight'])
            ->setOriginalCustomPrice($result['sample_price'])
            ->getProduct()->setIsSuperMode(true);
        $quote->collectTotals()->save();

it saves and shows the price and additional option But when the customer as a guest adds the product and try to log in, Magento converts the product price to the normal price and removes the additional option. Any Idea about -how the guest cart and customer cart merge? -How can I keep the additional option saved and transfer it to the customer cart as it is?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top