0

I'm trying to replicate the cart on another page and I'm using 'checkout / cart' to retrieve item info, but I need to replicate the remove cart button and I just don't know how. Here's my code example:

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
    $productName = $item->getProduct()->getName();
    $productPrice = $item->getProduct()->getPrice();
}

<a href="" class="remove"><strong>Remove Item cart</strong></a>

What is the get url for cart remover?

1 Answer 1

0

$cartHelper = Mage::helper('checkout/cart'); $cartItemId = 123; $cartHelper->getCart()->removeItem($cartItemId)->save();

You can pass Cart Item Id there and it will be remove.

Happy Coding. :)

2

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.