[Skip to main content](#vessel-content)

#   Empty Cart Button

##

- **[momentis](/forum/user/364-momentis "View momentis's Profile")**
- [![momentis's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar364.jpg)](/forum/user/364-momentis "View momentis's Profile") Topic Author
- [ Offline](/forum/user/364-momentis)

Less More

- Posts: 202
- Thank you received: 2
-
-

15 years 6 months ago [\#14276](#14276) by [momentis](/forum/user/364-momentis "View momentis's Profile")  *[Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#14276 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")* was created by *[momentis](/forum/user/364-momentis "View momentis's Profile")*

Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 6 months ago [\#14277](#14277) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#14277 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Sure:
&lt;a href="&lt;?php echo hikashop::completeLink('product&amp;task=cleancart'); ?&gt;"&gt;Empty Cart&lt;/a&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[momentis](/forum/user/364-momentis "View momentis's Profile")**
- [![momentis's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar364.jpg)](/forum/user/364-momentis "View momentis's Profile") Topic Author
- [ Offline](/forum/user/364-momentis)

Less More

- Posts: 202
- Thank you received: 2
-
-

15 years 6 months ago [\#14278](#14278) by [momentis](/forum/user/364-momentis "View momentis's Profile")  Replied by *[momentis](/forum/user/364-momentis "View momentis's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#14278 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Thanks!!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[momentis](/forum/user/364-momentis "View momentis's Profile")**
- [![momentis's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar364.jpg)](/forum/user/364-momentis "View momentis's Profile") Topic Author
- [ Offline](/forum/user/364-momentis)

Less More

- Posts: 202
- Thank you received: 2
-
-

15 years 6 months ago [\#14322](#14322) by [momentis](/forum/user/364-momentis "View momentis's Profile")  Replied by *[momentis](/forum/user/364-momentis "View momentis's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#14322 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Nicolas,

I inserted this in the front-end Checkout-&gt;Cart file. It adds the link and is certainly clearing the cart. However, when the page refreshes the cart items still show on that screen, but browsing to another page (where the cart module is displayed) shows an empty cart. Is there a way to have the cart itself refresh and clear?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 6 months ago [\#14324](#14324) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#14324 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

In that case, you need to add a return parameter to the URL:
&lt;a href="&lt;?php echo hikashop::completeLink('product&amp;task=cleancart&amp;return_url='. urlencode(base64_encode(hikashop::currentURL('url')))); ?&gt;"&gt;Empty Cart&lt;/a&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[momentis](/forum/user/364-momentis "View momentis's Profile")**
- [![momentis's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar364.jpg)](/forum/user/364-momentis "View momentis's Profile") Topic Author
- [ Offline](/forum/user/364-momentis)

Less More

- Posts: 202
- Thank you received: 2
-
-

15 years 6 months ago [\#14325](#14325) by [momentis](/forum/user/364-momentis "View momentis's Profile")  Replied by *[momentis](/forum/user/364-momentis "View momentis's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#14325 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Man, you are truly amazing!! Thanks!!!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")**
- [![lanzanet's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7823.png)](/forum/user/7823-lanzanet "View lanzanet's Profile")
- [ Offline](/forum/user/7823-lanzanet)

Less More

- Posts: 107
- Thank you received: 3
-
-

14 years 4 months ago [\#54343](#54343) by [lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")  Replied by *[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#54343 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Hi. Where exatly may I put this code? I tried to put it in Views-&gt;Checkout-&gt;Cart ot the Frontend, but nothing happens. Could you help me please?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

14 years 4 months ago [\#54370](#54370) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#54370 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

That view file is for the cart on the checkout. If you want the cart module, it should be the file "cart" of the view "product".
Also, make sure that you're doing it for your front end template and not another template.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")**
- [![lanzanet's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7823.png)](/forum/user/7823-lanzanet "View lanzanet's Profile")
- [ Offline](/forum/user/7823-lanzanet)

Less More

- Posts: 107
- Thank you received: 3
-
-

14 years 4 months ago [\#54376](#54376) by [lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")  Replied by *[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#54376 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Thanks Nicolas. Yes, It was for the checkout module. Now I have my 'Empty Cart' link, but Is there a way for that link to appears like a button (like the 'Checkout' button)?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

14 years 4 months ago [\#54440](#54440) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#54440 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Everything is possible. You could use that code instead for that:

&lt;input name="Empty Cart" value="Empty Cart" onclick="window.location='&lt;?php echo hikashop::completeLink('product&amp;task=cleancart&amp;return_url='. urlencode(base64_encode(hikashop::currentURL('url')))); ?&gt;';return false;"/&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")**
- [![lanzanet's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7823.png)](/forum/user/7823-lanzanet "View lanzanet's Profile")
- [ Offline](/forum/user/7823-lanzanet)

Less More

- Posts: 107
- Thank you received: 3
-
-

14 years 4 months ago [\#54469](#54469) by [lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")  Replied by *[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#54469 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

WOWWWW!! Amazing!

Really everything is possible. It works perfectly, but I needed to add:

type="submit" class="button" before the name var, so the code looks:

&lt;input type="submit" class="button" name="Empty Cart" value="Empty Cart" onclick="window.location='&lt;?php echo hikashop::completeLink('product&amp;task=cleancart&amp;return_url='. urlencode(base64_encode(hikashop::currentURL('url')))); ?&gt;';return false;"/&gt;

and it works exactly as I wanted.

I think it's the fastest and the best support for the price I've ever had for a software bought. I don't know how you manage to answer so many posts so fast.

Thanks again Nicolas.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile")
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 9 months ago -  12 years 9 months ago [\#141464](#141464) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  Replied by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#141464 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

When I use this code in templates/../html/checkout/cart.php and I click the new link, I know that the cart is empty.
Code:

&lt;a href="&lt;?php echo hikashop::completeLink('product&amp;task=cleancart&amp;return_url='. urlencode(base64_encode(hikashop::currentURL('url')))); ?&gt;"&gt;Empty Cart&lt;/a&gt;

But I still see item in cart until I refresh another time...

Last edit: 12 years 9 months ago by [Flooder](/forum/user/23280-flooder "View Flooder's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

12 years 9 months ago [\#141569](#141569) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#141569 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Hi there,

You should try with hikashop_completeLink instead of hikashop::completeLink.
If if doesn't work, please give us a link to the page where we could test it.

The following user(s) said Thank You: [Flooder](/forum/user/23280-flooder "View Flooder's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile")
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 9 months ago [\#141695](#141695) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  Replied by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#141695 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

your account is created and you received a private message. Thks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile")
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 9 months ago [\#141719](#141719) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  Replied by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#141719 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

This problem is solved for me with : Code:

$lienredir = urlencode(base64_encode('index.php?option=com_hikashop&amp;ctrl=checkout')); $url = 'index.php?option=com_hikashop&amp;ctrl=product&amp;task=cleancart&amp;return_url='. $lienredir; ?&gt; &lt;a class="btn button" href="&lt;?php echo $url; ?&gt;"&gt;Vider le panier&lt;/a&gt;

I think SEF was my problem. I disabled it, found the real links, and reactivated it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

12 years 9 months ago [\#141821](#141821) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#141821 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

I'm glad you fixed it, thanks for sharing your solution!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[happiexy](/forum/user/33007-happiexy "View happiexy's Profile")**
- [![happiexy's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/quiet.jpg)](/forum/user/33007-happiexy "View happiexy's Profile")
- [ Offline](/forum/user/33007-happiexy "I'm a full-stack developer developer from Nairobi Kenya, who just takes longer to get to solutions.  Visit https://patric.xyz for more.  ")
- ^\_^

Less More

- Posts: 15
- Thank you received: 0
-
-
-
- [](http://patric.xyz)
-

12 years 4 months ago [\#161191](#161191) by [happiexy](/forum/user/33007-happiexy "View happiexy's Profile")  Replied by *[happiexy](/forum/user/33007-happiexy "View happiexy's Profile")* on topic *[Re: Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#161191 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

incase the above fails, as it did with mine, just delete from the database via a query. works best

---

![:)](/media/kunena/emoticons/3.png ":)")

fFull-stack

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[loovanloon](/forum/user/76172-loovanloon "View loovanloon's Profile")**
- [![loovanloon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/76172-loovanloon "View loovanloon's Profile")
- [ Offline](/forum/user/76172-loovanloon)

Less More

- Posts: 8
- Thank you received: 0
-
-

3 years 5 months ago [\#351948](#351948) by [loovanloon](/forum/user/76172-loovanloon "View loovanloon's Profile")  Replied by *[loovanloon](/forum/user/76172-loovanloon "View loovanloon's Profile")* on topic *[Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#351948 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

How would this code look if I want to return to a specifiek page after emptying the cart?
Code:

&lt;a href="&lt;?php echo hikashop::completeLink('product&amp;task=cleancart'); ?&gt;"&gt;

I would want to return to page: [ www.ev8.shop/#sp-main-body](https://www.ev8.shop/#sp-main-body)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

3 years 5 months ago [\#351952](#351952) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#351952 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

Hi,

You can change the line: Code:

$lienredir = urlencode(base64_encode('index.php?option=com_hikashop&amp;ctrl=checkout'));

to: Code:

$lienredir = urlencode(base64_encode('https://www.ev8.shop/#sp-main-body'));

in the code posted above.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[loovanloon](/forum/user/76172-loovanloon "View loovanloon's Profile")**
- [![loovanloon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/76172-loovanloon "View loovanloon's Profile")
- [ Offline](/forum/user/76172-loovanloon)

Less More

- Posts: 8
- Thank you received: 0
-
-

3 years 5 months ago -  3 years 5 months ago [\#351973](#351973) by [loovanloon](/forum/user/76172-loovanloon "View loovanloon's Profile")  Replied by *[loovanloon](/forum/user/76172-loovanloon "View loovanloon's Profile")* on topic *[Empty Cart Button](/forum/4-how-to/14276-empty-cart-button#351973 "Is there a way to add a button into the cart view that will allow a user to clear all the contents of the cart with one click?")*

> nicolas wrote: Hi,
> \[hr\]
> You can change the line:
> *$lienredir = urlencode(base64\_encode('index.php?option=com\_hikashop&amp;ctrl=checkout'));*
> *to:
> $lienredir = urlencode(base64\_encode('[ www.ev8.shop/#sp-main-body](https://www.ev8.shop/#sp-main-body)'));*
> in the code posted above.

[hr]

Thank you. Can you help me just one step further? As I do not know how to do this. What I want is a custom button to empty the card, and then return to a specifiec page. I managed to empty the cart with this code: Code:

&lt;a class="btnbtn-rich" href="&lt;?php echo hikashop::completeLink('product&amp;amp;task=cleancart'); ?&gt;"&gt;Start over&lt;/a&gt;

But now I want an extra button somewhere else that brings the user back to '[ www.ev8.shop/#sp-main-body](https://www.ev8.shop/#sp-main-body)' after pressing the custom 'empty cart button".

I just do not understand how to integrate your suggested code into the code. Can you add the return url for me into: Code:

&lt;a class="btnbtn-rich" href="&lt;?php echo hikashop::completeLink('product&amp;amp;task=cleancart'); ?&gt;"&gt;Start over&lt;/a&gt;

Or suggest a tutorial where I can learn about it? I have googled but can't find any suitable.

Last edit: 3 years 5 months ago by [loovanloon](/forum/user/76172-loovanloon "View loovanloon's Profile"). Reason: clarifications and typo's

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE0Mjc2LWVtcHR5LWNhcnQtYnV0dG9uP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.089 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
