One click clear cart button needed

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

One click clear cart button needed

Postby aseanxpress@.....com » Thu Apr 09, 2015 8:49 am

Hello,

I am using Joomla 3.4.0 and Virtuemart 3.0.6.2 along with OPC: 2.0.285.120315.
I am using clean_simple2 theme and i want a clear cart button which on click clears all the items in cart and takes you to empty cart or virtuemart frontpage. Please let me know how to do this. I can edit files as per your instructions.

Thanks in advance.
aseanxpress@.....com
 
Posts: 4
Joined: Thu Apr 09, 2015 8:39 am

Re: One click clear cart button needed

Postby admin » Thu Apr 09, 2015 5:57 pm

hello, i created a function in OPC controller that is accessible with:

index.php?option=com_onepage&view=opc&task=clearcart

now you can use a button with :
Code: Select all
<a href="<?php echo JRoute::_('index.php?option=com_onepage&view=opc&task=clearcart'); ?> >Clear Cart</a>


i can further add support for <button or <input type="button via javascript but they would still do a redirect to this URL.

let me know if this helps you.

To insert the button/link onto your site, you can edit /components/com_onepage/themes/YOUR OPC THEME/onepage.unlogged (and logged).tpl.php
OR
/overrides/basket.html.php

to use this with a button, you can do this:

Code: Select all
<button onclick="javascript: return window.location='<?php echo JRoute::_('index.php?option=com_onepage&view=opc&task=clearcart'); ?>';">Clear Cart Button</button>


best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: One click clear cart button needed

Postby admin » Thu Apr 09, 2015 5:58 pm

this function does not delete the user's addresses, it only clears the products data.
best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: One click clear cart button needed

Postby aseanxpress@.....com » Tue Apr 14, 2015 1:03 pm

i will try this solution but

500 - View not found [name, type, prefix]: virtuemart, html, virtuemartView

this will occur. Please let me know

Thanks
aseanxpress@.....com
 
Posts: 4
Joined: Thu Apr 09, 2015 8:39 am

Re: One click clear cart button needed

Postby aseanxpress@.....com » Wed Apr 15, 2015 8:39 am

Hello,

Please reply

Thanks
aseanxpress@.....com
 
Posts: 4
Joined: Thu Apr 09, 2015 8:39 am

Re: One click clear cart button needed

Postby admin » Thu Apr 16, 2015 6:00 pm

hello, are you running opc 2.0.286 version or later ?

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: One click clear cart button needed

Postby admin » Thu Apr 16, 2015 6:04 pm

hello, you are right, i updated my joomla to 3.4.1 and i also get this error.

i updated it within the next opc version, i am sending you an update.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: One click clear cart button needed

Postby aseanxpress@.....com » Fri Apr 17, 2015 9:09 am

Please send us update of opc.

Thank you very much
aseanxpress@.....com
 
Posts: 4
Joined: Thu Apr 09, 2015 8:39 am

Re: One click clear cart button needed

Postby admin » Mon May 11, 2015 3:23 pm

hello, let us know if it works well for you.

best regards,stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x

cron