How to remove the total row from cart and checkout
up vote
1
down vote
favorite
I would like to remove only total row on cart and checkout page not the whole block.
I am not able to find any action or filter to remove the total i still want to leave the subtotal .
I am using the code below but it hides the whole order block and also it does not remove it from the bill that is generated after checkout
add_action( 'woocommerce_checkout_order_review', 'remove_checkout_totals', 1 );
function remove_checkout_totals()
{remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );}
php wordpress woocommerce cart
add a comment |
up vote
1
down vote
favorite
I would like to remove only total row on cart and checkout page not the whole block.
I am not able to find any action or filter to remove the total i still want to leave the subtotal .
I am using the code below but it hides the whole order block and also it does not remove it from the bill that is generated after checkout
add_action( 'woocommerce_checkout_order_review', 'remove_checkout_totals', 1 );
function remove_checkout_totals()
{remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );}
php wordpress woocommerce cart
You need to override the related templates like in this thread… There are no hooks for that on cart and checkout.
– LoicTheAztec
Nov 18 at 20:56
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I would like to remove only total row on cart and checkout page not the whole block.
I am not able to find any action or filter to remove the total i still want to leave the subtotal .
I am using the code below but it hides the whole order block and also it does not remove it from the bill that is generated after checkout
add_action( 'woocommerce_checkout_order_review', 'remove_checkout_totals', 1 );
function remove_checkout_totals()
{remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );}
php wordpress woocommerce cart
I would like to remove only total row on cart and checkout page not the whole block.
I am not able to find any action or filter to remove the total i still want to leave the subtotal .
I am using the code below but it hides the whole order block and also it does not remove it from the bill that is generated after checkout
add_action( 'woocommerce_checkout_order_review', 'remove_checkout_totals', 1 );
function remove_checkout_totals()
{remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );}
php wordpress woocommerce cart
php wordpress woocommerce cart
asked Nov 18 at 20:42
king10
113
113
You need to override the related templates like in this thread… There are no hooks for that on cart and checkout.
– LoicTheAztec
Nov 18 at 20:56
add a comment |
You need to override the related templates like in this thread… There are no hooks for that on cart and checkout.
– LoicTheAztec
Nov 18 at 20:56
You need to override the related templates like in this thread… There are no hooks for that on cart and checkout.
– LoicTheAztec
Nov 18 at 20:56
You need to override the related templates like in this thread… There are no hooks for that on cart and checkout.
– LoicTheAztec
Nov 18 at 20:56
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You will not find any hook specified for the Total row because they are hard coded in the templates the only way to remove the total row from the cart page and checkout pages by modifying those pages template and to do that you need to follow few steps as follow:
- Create Folder in your child theme called
woocommerce
. - Create two folders inside main
woocommerce
which you just created called namecheckout
andcart
. - now create file called
review-order.php
put it insidecheckout
folder andcart-totals.php
put it inside thecart
folder then copy the content from the original files which you can find inwp-content/plugins/woocoomerce/templates/checkout/review-order.php
andwp-content/plugins/woocoomerce/templates/cart/cart-totals.php
Last step:
find the following lines in both files and delete them:
<tr class="order-total">
<th><?php _e('Total', 'woocommerce'); ?></th>
<td><?php wc_cart_totals_order_total_html(); ?></td>
</tr>
Order received page
To Remove the Total from Order received page you can use woocommerce_get_order_item_totals
hook and unset the total as follow:
add_action('woocommerce_get_order_item_totals', 'remove_total', 10, 1);
function remove_total($array)
{
unset($array['order_total']);
return $array;
}
put the code above in your functions.php
That's it.
this is great , it worked , but it still did not solve the second part of the problem , the total is still being showed to the order receipt after placing order.
– king10
Nov 19 at 13:26
@king10 i have updated my answer and included the order received page
– kashalo
Nov 19 at 13:40
yes that one , it still show the total , it seems that the steps above only hide the field , it does not remove it for further process
– king10
Nov 19 at 13:40
@king10 let me know if the updated answer solved your problem
– kashalo
Nov 19 at 13:45
@kasalo yes it did , thanks a million , its perfect !!
– king10
Nov 19 at 13:46
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You will not find any hook specified for the Total row because they are hard coded in the templates the only way to remove the total row from the cart page and checkout pages by modifying those pages template and to do that you need to follow few steps as follow:
- Create Folder in your child theme called
woocommerce
. - Create two folders inside main
woocommerce
which you just created called namecheckout
andcart
. - now create file called
review-order.php
put it insidecheckout
folder andcart-totals.php
put it inside thecart
folder then copy the content from the original files which you can find inwp-content/plugins/woocoomerce/templates/checkout/review-order.php
andwp-content/plugins/woocoomerce/templates/cart/cart-totals.php
Last step:
find the following lines in both files and delete them:
<tr class="order-total">
<th><?php _e('Total', 'woocommerce'); ?></th>
<td><?php wc_cart_totals_order_total_html(); ?></td>
</tr>
Order received page
To Remove the Total from Order received page you can use woocommerce_get_order_item_totals
hook and unset the total as follow:
add_action('woocommerce_get_order_item_totals', 'remove_total', 10, 1);
function remove_total($array)
{
unset($array['order_total']);
return $array;
}
put the code above in your functions.php
That's it.
this is great , it worked , but it still did not solve the second part of the problem , the total is still being showed to the order receipt after placing order.
– king10
Nov 19 at 13:26
@king10 i have updated my answer and included the order received page
– kashalo
Nov 19 at 13:40
yes that one , it still show the total , it seems that the steps above only hide the field , it does not remove it for further process
– king10
Nov 19 at 13:40
@king10 let me know if the updated answer solved your problem
– kashalo
Nov 19 at 13:45
@kasalo yes it did , thanks a million , its perfect !!
– king10
Nov 19 at 13:46
|
show 1 more comment
up vote
1
down vote
accepted
You will not find any hook specified for the Total row because they are hard coded in the templates the only way to remove the total row from the cart page and checkout pages by modifying those pages template and to do that you need to follow few steps as follow:
- Create Folder in your child theme called
woocommerce
. - Create two folders inside main
woocommerce
which you just created called namecheckout
andcart
. - now create file called
review-order.php
put it insidecheckout
folder andcart-totals.php
put it inside thecart
folder then copy the content from the original files which you can find inwp-content/plugins/woocoomerce/templates/checkout/review-order.php
andwp-content/plugins/woocoomerce/templates/cart/cart-totals.php
Last step:
find the following lines in both files and delete them:
<tr class="order-total">
<th><?php _e('Total', 'woocommerce'); ?></th>
<td><?php wc_cart_totals_order_total_html(); ?></td>
</tr>
Order received page
To Remove the Total from Order received page you can use woocommerce_get_order_item_totals
hook and unset the total as follow:
add_action('woocommerce_get_order_item_totals', 'remove_total', 10, 1);
function remove_total($array)
{
unset($array['order_total']);
return $array;
}
put the code above in your functions.php
That's it.
this is great , it worked , but it still did not solve the second part of the problem , the total is still being showed to the order receipt after placing order.
– king10
Nov 19 at 13:26
@king10 i have updated my answer and included the order received page
– kashalo
Nov 19 at 13:40
yes that one , it still show the total , it seems that the steps above only hide the field , it does not remove it for further process
– king10
Nov 19 at 13:40
@king10 let me know if the updated answer solved your problem
– kashalo
Nov 19 at 13:45
@kasalo yes it did , thanks a million , its perfect !!
– king10
Nov 19 at 13:46
|
show 1 more comment
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You will not find any hook specified for the Total row because they are hard coded in the templates the only way to remove the total row from the cart page and checkout pages by modifying those pages template and to do that you need to follow few steps as follow:
- Create Folder in your child theme called
woocommerce
. - Create two folders inside main
woocommerce
which you just created called namecheckout
andcart
. - now create file called
review-order.php
put it insidecheckout
folder andcart-totals.php
put it inside thecart
folder then copy the content from the original files which you can find inwp-content/plugins/woocoomerce/templates/checkout/review-order.php
andwp-content/plugins/woocoomerce/templates/cart/cart-totals.php
Last step:
find the following lines in both files and delete them:
<tr class="order-total">
<th><?php _e('Total', 'woocommerce'); ?></th>
<td><?php wc_cart_totals_order_total_html(); ?></td>
</tr>
Order received page
To Remove the Total from Order received page you can use woocommerce_get_order_item_totals
hook and unset the total as follow:
add_action('woocommerce_get_order_item_totals', 'remove_total', 10, 1);
function remove_total($array)
{
unset($array['order_total']);
return $array;
}
put the code above in your functions.php
That's it.
You will not find any hook specified for the Total row because they are hard coded in the templates the only way to remove the total row from the cart page and checkout pages by modifying those pages template and to do that you need to follow few steps as follow:
- Create Folder in your child theme called
woocommerce
. - Create two folders inside main
woocommerce
which you just created called namecheckout
andcart
. - now create file called
review-order.php
put it insidecheckout
folder andcart-totals.php
put it inside thecart
folder then copy the content from the original files which you can find inwp-content/plugins/woocoomerce/templates/checkout/review-order.php
andwp-content/plugins/woocoomerce/templates/cart/cart-totals.php
Last step:
find the following lines in both files and delete them:
<tr class="order-total">
<th><?php _e('Total', 'woocommerce'); ?></th>
<td><?php wc_cart_totals_order_total_html(); ?></td>
</tr>
Order received page
To Remove the Total from Order received page you can use woocommerce_get_order_item_totals
hook and unset the total as follow:
add_action('woocommerce_get_order_item_totals', 'remove_total', 10, 1);
function remove_total($array)
{
unset($array['order_total']);
return $array;
}
put the code above in your functions.php
That's it.
edited Nov 19 at 13:42
answered Nov 18 at 20:58
kashalo
2,1722618
2,1722618
this is great , it worked , but it still did not solve the second part of the problem , the total is still being showed to the order receipt after placing order.
– king10
Nov 19 at 13:26
@king10 i have updated my answer and included the order received page
– kashalo
Nov 19 at 13:40
yes that one , it still show the total , it seems that the steps above only hide the field , it does not remove it for further process
– king10
Nov 19 at 13:40
@king10 let me know if the updated answer solved your problem
– kashalo
Nov 19 at 13:45
@kasalo yes it did , thanks a million , its perfect !!
– king10
Nov 19 at 13:46
|
show 1 more comment
this is great , it worked , but it still did not solve the second part of the problem , the total is still being showed to the order receipt after placing order.
– king10
Nov 19 at 13:26
@king10 i have updated my answer and included the order received page
– kashalo
Nov 19 at 13:40
yes that one , it still show the total , it seems that the steps above only hide the field , it does not remove it for further process
– king10
Nov 19 at 13:40
@king10 let me know if the updated answer solved your problem
– kashalo
Nov 19 at 13:45
@kasalo yes it did , thanks a million , its perfect !!
– king10
Nov 19 at 13:46
this is great , it worked , but it still did not solve the second part of the problem , the total is still being showed to the order receipt after placing order.
– king10
Nov 19 at 13:26
this is great , it worked , but it still did not solve the second part of the problem , the total is still being showed to the order receipt after placing order.
– king10
Nov 19 at 13:26
@king10 i have updated my answer and included the order received page
– kashalo
Nov 19 at 13:40
@king10 i have updated my answer and included the order received page
– kashalo
Nov 19 at 13:40
yes that one , it still show the total , it seems that the steps above only hide the field , it does not remove it for further process
– king10
Nov 19 at 13:40
yes that one , it still show the total , it seems that the steps above only hide the field , it does not remove it for further process
– king10
Nov 19 at 13:40
@king10 let me know if the updated answer solved your problem
– kashalo
Nov 19 at 13:45
@king10 let me know if the updated answer solved your problem
– kashalo
Nov 19 at 13:45
@kasalo yes it did , thanks a million , its perfect !!
– king10
Nov 19 at 13:46
@kasalo yes it did , thanks a million , its perfect !!
– king10
Nov 19 at 13:46
|
show 1 more comment
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53365253%2fhow-to-remove-the-total-row-from-cart-and-checkout%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need to override the related templates like in this thread… There are no hooks for that on cart and checkout.
– LoicTheAztec
Nov 18 at 20:56