Page 1 of 1

One click clear cart button needed

PostPosted: Thu Apr 09, 2015 8:49 am
by aseanxpress@.....com
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.

Re: One click clear cart button needed

PostPosted: Thu Apr 09, 2015 5:57 pm
by admin
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

Re: One click clear cart button needed

PostPosted: Thu Apr 09, 2015 5:58 pm
by admin
this function does not delete the user's addresses, it only clears the products data.
best regards, stan

Re: One click clear cart button needed

PostPosted: Tue Apr 14, 2015 1:03 pm
by aseanxpress@.....com
i will try this solution but

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

this will occur. Please let me know

Thanks

Re: One click clear cart button needed

PostPosted: Wed Apr 15, 2015 8:39 am
by aseanxpress@.....com
Hello,

Please reply

Thanks

Re: One click clear cart button needed

PostPosted: Thu Apr 16, 2015 6:00 pm
by admin
hello, are you running opc 2.0.286 version or later ?

best regards, stan

Re: One click clear cart button needed

PostPosted: Thu Apr 16, 2015 6:04 pm
by admin
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

Re: One click clear cart button needed

PostPosted: Fri Apr 17, 2015 9:09 am
by aseanxpress@.....com
Please send us update of opc.

Thank you very much

Re: One click clear cart button needed

PostPosted: Mon May 11, 2015 3:23 pm
by admin
hello, let us know if it works well for you.

best regards,stan