Empty Cart Button for WooCommerce plugin lets you add (and customize) “Empty cart” button to WooCommerce cart and checkout pages.
Position Options
Alternatively you can also use [alg_wc_empty_cart_button]
shortcode or do_shortcode( '[alg_wc_empty_cart_button]' );
PHP code to add “empty cart” button anywhere on your site.
- Cart: Button position
- Possible positions are: Do not add; Before cart; After cart; After proceed to checkout button; After cart totals. Possible values: Do not add; Before cart; After cart; After proceed to checkout button; After cart totals.
- Default:
After cart
- Default:
- Cart: Button position priority
- Change this if you want to move the button inside the Position selected above.
- Default:
10
- Default:
- Checkout: Button position
- Possible positions are: Do not add; Before checkout form; After checkout form.
- Default:
Do not add
- Default:
- Checkout: Button position priority
- Change this if you want to move the button inside the Position selected above.
- Default:
10
- Default:
Style Options
Alternatively, if using [alg_wc_empty_cart_button]
shortcode, you can style the button with html_template
, html_style
, html_class
attributes, e.g.:
[alg_wc_empty_cart_button html_template="%button_form%" html_style="" html_class="button"]
- Cart: HTML template
- HTML template for wrapping the button. Replaced value:
%button_form%
- Cart: Button HTML class
- Button HTML class on the cart page.
- Default:
button
- Default:
- Cart: Button HTML style
- Button HTML style on the cart page.
- Default: None
- Checkout: HTML template
- HTML template for wrapping the button. Replaced value:
%button_form%
- Checkout: Button HTML class
- Button HTML class on the checkout page.
- Default:
button
- Default:
- Checkout: Button HTML style
- Button HTML style on the checkout page.
- Default: None
Label Options
- Button label
- Button text.
- Default:
Empty cart
- Default:
Confirmation Options
In this section you can select if you want user to confirm after empty cart button was pressed.
- Confirmation
- Possible values: No confirmation; Confirm by pop up box.
- Default:
No confirmation
- Default:
- Confirmation text
- Ignored if confirmation is not enabled.
- Default:
Are you sure?
- Default:
Redirect Options
In this section you can select if you want to redirect the user to another page after cart is emptied.
- Redirect
- Enables/disables redirect.
- Default:
no
- Default:
- Redirect location
- Ignored if redirect is not enabled.
- Default: None
Alexander Labrie (verified owner) –
Why bother figuring how to do this yourself for the price of 2 lattes? Tom gives fast and great support.
Anton –
Could have probably coded it myself, but still – good work.