0

I was trying to make an script to reload the page when i delete a product from mini-cart. The reason is because when i delete a product from it, if i am on the onestepcheckout, my summary don´t get reloaded, so i need to reload the full page to get again the price and the new shipping costs.

I see that btn-closeappear on default.phtml on sns_ajaxcart, but with this sencente, i dont know what i have to do the reload after the onclick makes the changes on the cart.

This is my Element <a>

<a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php //echo $this->__('Remove This Item') ?></a>

Any idea?

3
  • this works for me <a href="<?php echo $this->getDeleteUrl() ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" title="<?php echo $this->__('Remove This Item') ?>" class="cart-remove"> <span><?php echo $this->__('Remove'); ?></span> </a> – Ahmed Elawadi Jun 17 '15 at 15:55
  • if the problem with the checkout page why don't you use this : <?php if (!$this->isOnCheckoutPage()): ?> – Ahmed Elawadi Jun 17 '15 at 15:56
  • I just only wants to make a reload of the page on onestepcheckout if the person makes a delete from the mini-cart and it goes successfully How could make with this @AhmedElAwadi – ntzz Jun 18 '15 at 11:31
2

I have tested this on clean RWD template.

Line 158 replace:

<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="removex">
<?php echo $this->__('Remove Item') ?>
</a>

with

<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>

It is working on every page, when you remove an item it refresh the page.

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.