How to remove shopping cart item after payment done? - shopping-cart

I have clear shopping cart item after payment done. I have tried many code, but its redirect to empty shopping cart. I wouldn't like to redirect the page and remove cart items.
Thank you

try:
foreach( Mage::getSingleton('checkout/session')->getQuote()->getItemsCollection() as $item ){
Mage::getSingleton('checkout/cart')->removeItem( $item->getId() )->save();
}
Or:
Mage::getSingleton(‘checkout/session’)->clear();
In order to redirect it on some page (e.g: success page):
Mage_Core_Controller_Varien_Action::_redirect('/checkout/onepage/success', array('_secure'=>true));

Related

Add to cart button on luna theme big cartel

How do I stop the "add to cart button" on my products page from redirecting people to the shopping cart page. I would much prefer it to just add the item selected and then allow them to continue shopping instead of forcing them to be redirected. Also, is there a way to add a cart preview drop down to the products page. I would like a preview to drop down and show the cart page each time they add something.
Thank you

Django redirect to form page and submit the form?

Right now. I have a search function in my page to search for item id. When I click search, I will render the same page with the result items and show item. And in other pages where I also display the item id, I want to add a link to the id to go to the same page where I search for that id.
Example: id: 123, I want the same page when:
1. search '123' in my search page(my search only accept exact match)
2. In other pages, click '123', go to the search page with results
How should I achieve this, I have tried many ways which don't wok.
You need to make use of the GET method that HTML forms provide. When you perform a search from the first page, you must make sure that you are doing so using the GET method in the form. This will append the form data into the URL.
E.g. If you have a 'name' field in your form which has 'John' inputted. The submission of this form will compose a URL like so:
http://someurl.com/?name=John
This can then be accessed using the Django request object:
name = request.GET['name']
You've probably done something similar already for displaying your search results. So, all you need to do is create a link in your second page that redirects to the search page with GET request variables appended.
E.g.
<a href="{% url 'search_page' %}?searchterm=232> Item 232 </a>

Digital Audio AWS Add To Cart Form Returns Empty Cart

when using AWS Add To Cart form to purchase digital audio, after continuing on Amazons "Add to Shopping Cart" page I am returned an empty shopping cart.
Example URL:
http://www.amazon.com/gp/aws/cart/add.html?AWSAccessKeyId=AKIAJ5D6U3YO5XIR6ZYQ&AssociateTag=scrip04b-20&ASIN.1=B01BZRALVO&Quantity.1=1
The digital album is visable on this page but when you click continue it returns an empty shopping cart. Is this a bug?
EDIT:
I've tried while being logged in and also while being logged out. I've checked my "MP3 Cart" after clicking continue and that is empty too.

OpenCart: 2Checout Logged users gets logged out on success page

I have 2checkout return customers to the URL
http://store.com/index.php?route=checkout/success. Which is correct? Anyway, 2checkout sent me to the homepage after successful payment and showing as a visitor with empty cart., when click on continue button showing logged in and same cart items in cart.and
opencart didn't record the order nor did i receive any order confirmation via email.(Required)
The customer received an order confirmation but product's option (if any) is not shown. Please help!!
Thanks in advance...

how to products list of the cart at Product details page

I want to get the product list of cart in the Product details page. how to get it???
I think cart details are stored in a session.
How to use it on Product details page
i'm using Virtuemart 2.022a and Joomla 2.5.9
Try this,
$cart = VirtueMartCart::getCart();
if(sizeof($cart->products){
echo "<pre/>";
print_r($cart->products);
}
Hope its help you..