- Posts: 202
- Thank you received: 2
Empty Cart Button
Please Log in or Create an account to join the conversation.
<a href="<?php echo hikashop::completeLink('product&task=cleancart'); ?>">Empty Cart</a>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I inserted this in the front-end Checkout->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 or Create an account to join the conversation.
<a href="<?php echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode(hikashop::currentURL('url')))); ?>">Empty Cart</a>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thanks.
Please Log in or Create an account to join the conversation.
Also, make sure that you're doing it for your front end template and not another template.
Please Log in or Create an account to join the conversation.
Thanks.
Please Log in or Create an account to join the conversation.
<input name="Empty Cart" value="Empty Cart" onclick="window.location='<?php echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode(hikashop::currentURL('url')))); ?>';return false;"/>
Please Log in or Create an account to join the conversation.
Really everything is possible. It works perfectly, but I needed to add:
type="submit" class="button" before the name var, so the code looks:
<input type="submit" class="button" name="Empty Cart" value="Empty Cart" onclick="window.location='<?php echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode(hikashop::currentURL('url')))); ?>';return false;"/>
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 or Create an account to join the conversation.
But I still see item in cart until I refresh another time...
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I think SEF was my problem. I disabled it, found the real links, and reactivated it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
fFull-stack
Please Log in or Create an account to join the conversation.
- Posts: 8
- Thank you received: 0
I would want to return to page: www.ev8.shop/#sp-main-body
Please Log in or Create an account to join the conversation.
You can change the line:
Please Log in or Create an account to join the conversation.
- Posts: 8
- Thank you received: 0
[hr]nicolas wrote: Hi,
[hr]
You can change the line:
$lienredir = urlencode(base64_encode('index.php?option=com_hikashop&ctrl=checkout'));
to:
$lienredir = urlencode(base64_encode(' www.ev8.shop/#sp-main-body '));
in the code posted above.
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:
But now I want an extra button somewhere else that brings the user back to ' 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:
Or suggest a tutorial where I can learn about it? I have googled but can't find any suitable.
Please Log in or Create an account to join the conversation.