<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Creating a “Clear cart” button in PrestaShop 1.7</title>
	<atom:link href="https://nemops.com/prestashop-1-7-clear-cart-button/feed/" rel="self" type="application/rss+xml" />
	<link>https://nemops.com/prestashop-1-7-clear-cart-button/</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Fri, 10 Mar 2023 23:25:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>By: Carlo Sbordoni</title>
		<link>https://nemops.com/prestashop-1-7-clear-cart-button/comment-page-1/#comment-46855</link>
		<dc:creator><![CDATA[Carlo Sbordoni]]></dc:creator>
		<pubDate>Thu, 20 May 2021 15:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=3093#comment-46855</guid>
		<description><![CDATA[Can you help me for prestashop 1.7.7.x ?]]></description>
		<content:encoded><![CDATA[<p>Can you help me for prestashop 1.7.7.x ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: W4U Tours</title>
		<link>https://nemops.com/prestashop-1-7-clear-cart-button/comment-page-1/#comment-46834</link>
		<dc:creator><![CDATA[W4U Tours]]></dc:creator>
		<pubDate>Thu, 16 Apr 2020 13:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=3093#comment-46834</guid>
		<description><![CDATA[Hi Nemo and thank you for your tutorial :)
Just a detail, i think it&#039;s better to use prestashop.urls.pages.cart var for the ajax url (url: prestashop.urls.base_url + &quot;cart&quot;)...

&lt;code&gt;
$(document).ready(function() {
        $(&#039;#removeAll&#039;).click(function(e) {
            e.preventDefault()
            $.ajax({
                type: &#039;POST&#039;,
                headers: { &quot;cache-control&quot;: &quot;no-cache&quot; },
                url: prestashop.urls.pages.cart,
                async: true,
                cache: false,
                data: &#039;deleteAll=1&amp;token=&#039; + prestashop.token + &#039;&amp;ajax=true&#039;,
                success: function(data){    
                    window.location.reload();
                }
            })
        });
    });
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>Hi Nemo and thank you for your tutorial <img src="https://nemops.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /><br />
Just a detail, i think it&#8217;s better to use prestashop.urls.pages.cart var for the ajax url (url: prestashop.urls.base_url + &#8220;cart&#8221;)&#8230;</p>
<p><code><br />
$(document).ready(function() {<br />
        $('#removeAll').click(function(e) {<br />
            e.preventDefault()<br />
            $.ajax({<br />
                type: 'POST',<br />
                headers: { "cache-control": "no-cache" },<br />
                url: prestashop.urls.pages.cart,<br />
                async: true,<br />
                cache: false,<br />
                data: 'deleteAll=1&amp;token=' + prestashop.token + '&amp;ajax=true',<br />
                success: function(data){<br />
                    window.location.reload();<br />
                }<br />
            })<br />
        });<br />
    });<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ganesh</title>
		<link>https://nemops.com/prestashop-1-7-clear-cart-button/comment-page-1/#comment-46826</link>
		<dc:creator><![CDATA[ganesh]]></dc:creator>
		<pubDate>Sun, 23 Feb 2020 14:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=3093#comment-46826</guid>
		<description><![CDATA[Thanks a lot brother,
It did work like a charm, but override did not work,
So I changed the actual cart_controller]]></description>
		<content:encoded><![CDATA[<p>Thanks a lot brother,<br />
It did work like a charm, but override did not work,<br />
So I changed the actual cart_controller</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Columbo</title>
		<link>https://nemops.com/prestashop-1-7-clear-cart-button/comment-page-1/#comment-46683</link>
		<dc:creator><![CDATA[Columbo]]></dc:creator>
		<pubDate>Tue, 28 Nov 2017 23:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=3093#comment-46683</guid>
		<description><![CDATA[Hi, nice small Tutorial, thank you for this.
But I#ve one question: I don&#039;t use an ajax request, because in my project there is only one priduct allowed in the cart at the same time.
So I used to change the updateCart() method in the CartController.php and modified the &quot;add&quot;-Block with this content:

$this-&gt;context-&gt;cart-&gt;delete();
$this-&gt;processChangeProductInCart();
Tools::redirect( &#039;cart&#039; );

This works mostly fine except that I&#039;ve to add a new product twice having it in the cart.

For example:
I put one product in the cart, all is fine.
I put another product in the cart, the cart is empty!
I put the product once again in the cart, all is fine!

Why is the cart first time empty, when I put another Product in there?

Thanks for help.]]></description>
		<content:encoded><![CDATA[<p>Hi, nice small Tutorial, thank you for this.<br />
But I#ve one question: I don&#8217;t use an ajax request, because in my project there is only one priduct allowed in the cart at the same time.<br />
So I used to change the updateCart() method in the CartController.php and modified the &#8220;add&#8221;-Block with this content:</p>
<p>$this-&gt;context-&gt;cart-&gt;delete();<br />
$this-&gt;processChangeProductInCart();<br />
Tools::redirect( &#8216;cart&#8217; );</p>
<p>This works mostly fine except that I&#8217;ve to add a new product twice having it in the cart.</p>
<p>For example:<br />
I put one product in the cart, all is fine.<br />
I put another product in the cart, the cart is empty!<br />
I put the product once again in the cart, all is fine!</p>
<p>Why is the cart first time empty, when I put another Product in there?</p>
<p>Thanks for help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
