문제

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?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top