I want to get cart item id using product id. For example, my product id is 600 and item id is 250.

using product id , want to get cart item id.

How to get it ?

please help me..

1 Answer 1

$productid = 600;
$quote = $this->checkoutHelper->getQuote();

foreach ($quote->getAllVisibleItems() as $_item) {
  $cartproductid = $_item->getProductId();
    your_item_id = $_item->getId();
  • 1
    One thing also... can you tell me about how to mini cart reload/refresh.. Jun 16, 2017 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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