0

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
$productid = 600;
$quote = $this->checkoutHelper->getQuote();

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

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.