4

I am having UI issues with the mini-cart and the RWD theme.

Test 1:

Add Item to cart, then click on Mini-Cart in top right corner and select "View Shopping Cart".

Once on the shopping cart, use the actual shopping cart page to delete the item you just added (not the mini-cart, but the actual features on the shopping cart page.

Result: Mini-Cart updates and the item is cleared out of Mini Cart and Shopping Cart is Empty.

That's probably because the page reloads when you remove that item. That seems to work fine.

Test 2:

Add Item to cart, then click on Mini-Cart in top right corner and select "View Shopping Cart".

Once on the shopping cart,use the mini-cart and click on "Remove Item" to remove the item out of the mini-cart.

Result: Mini-Cart removes the item and mini-cart says "You have no items in your shopping cart", however since we are on the actual shopping cart page, and the page didn't refresh, the shopping cart still shows the item in the cart.


Is there any way to tell the mini-cart to reload the page if we are on the actual shopping cart page (and perhaps on the checkout page may be a good thing as well), so that if someone were to remove an item in the checkout process using the mini-cart, that the page reloads and then displays the "Your shopping cart is empty" page.

Does anyone have a solution for that, preferably non invasive. I have set up a custom theme inside the RWD theme folder (there is a Default folder, and I created another folder in that level where I could copy files in to and which would be pulled before Default takes over.)

I like to make it as easy as possible for consumers, and this is something that really bothers me.

2

on RWD default/template/checkout/cart/mincart/default.phtml line 158 replace this

            <a href="<?php echo $this->getAjaxDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>"
               data-confirm="<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>"
               class="remove">
                <?php echo $this->__('Remove Item') ?>
            </a>

with

            <?php if (strpos(Mage::helper('core/http')->getHttpReferer(), 'checkout/cart') !== false) { ?>
                <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>" onclick="return confirm('<?php echo Mage::helper('core')->quoteEscape($this->__('Are you sure you would like to remove this item from the shopping cart?'), true) ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a>
            <?php }else{ ?>
                <a href="<?php echo $this->getAjaxDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>"
                   data-confirm="<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>"
                   class="remove">
                    <?php echo $this->__('Remove Item') ?>
                </a>
            <?php } ?>

this will refresh cart page when you delete item from minicart

2

Thanks (Abdelrahman El Awadi) for the reply, however that does not work for me for some reason. Your if/else code is working, however it is not reloading the shopping cart page when an item is removed out of the mini cart when on the shopping cart page.

So at this time I have abandoned the idea of reloading of the page, and I am opting for simply disabling the "Remove" link in the mini cart when on the actual shopping cart page. And that seems to work fine.

I used part of your idea and am checking if we are or the cart page or not, and then I either remove the remove or gray out the link or leave it. That seems to work for me:

        <?php if (Mage::app()->getFrontController()->getAction()->getFullActionName() != 'checkout_cart_index') { ?>
        <a href="<?php echo $this->getAjaxDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>"
           data-confirm="<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>"
           class="remove">
            <?php echo $this->__('Remove Item') ?>
        </a>
        <?php }else{ ?>
            <?php echo $this->__('Remove Item') ?>
        <?php } ?>

Thank you so much for your help. Martin

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.