3

What is the purpose of using quote_id_mask Table ?enter image description here

1

Unknown users cannot obtain private information of your registered customers. It doesn’t include the cart_id_mask value in the quote_id_mask table, it makes difficult for hackers to obtain information of your registered users.

1

I am not sure but I think this table comes in action when any guest customer add product in their cart. Magento saves masked id with quote id. masked_id is stored in local storage as well.

check below code

webapi.xml

<route url="/V1/guest-carts/:cartId" method="GET">
    <service class="Magento\Quote\Api\GuestCartRepositoryInterface" method="get"/>
    <resources>
        <resource ref="anonymous" />
    </resources>
</route>

GuestCartRepositoryInterface.php

public function get($cartId)
{
    /** @var $quoteIdMask QuoteIdMask */
    $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
    return $this->quoteRepository->get($quoteIdMask->getQuoteId());
}

magento use masked_id to fetch quote id then fetch quote using quote_id for guest customer.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.