How to remove the total row from cart and checkout











up vote
1
down vote

favorite
1












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 );}









share|improve this question






















  • 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















up vote
1
down vote

favorite
1












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 );}









share|improve this question






















  • 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













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





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 );}









share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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












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:




  1. Create Folder in your child theme called woocommerce.

  2. Create two folders inside main woocommerce which you just created called name checkout and cart.

  3. now create file called review-order.php put it inside checkout folder and cart-totals.php put it inside the cart folder then copy the content from the original files which you can find in wp-content/plugins/woocoomerce/templates/checkout/review-order.php and wp-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.






share|improve this answer























  • 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











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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

























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:




  1. Create Folder in your child theme called woocommerce.

  2. Create two folders inside main woocommerce which you just created called name checkout and cart.

  3. now create file called review-order.php put it inside checkout folder and cart-totals.php put it inside the cart folder then copy the content from the original files which you can find in wp-content/plugins/woocoomerce/templates/checkout/review-order.php and wp-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.






share|improve this answer























  • 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















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:




  1. Create Folder in your child theme called woocommerce.

  2. Create two folders inside main woocommerce which you just created called name checkout and cart.

  3. now create file called review-order.php put it inside checkout folder and cart-totals.php put it inside the cart folder then copy the content from the original files which you can find in wp-content/plugins/woocoomerce/templates/checkout/review-order.php and wp-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.






share|improve this answer























  • 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













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:




  1. Create Folder in your child theme called woocommerce.

  2. Create two folders inside main woocommerce which you just created called name checkout and cart.

  3. now create file called review-order.php put it inside checkout folder and cart-totals.php put it inside the cart folder then copy the content from the original files which you can find in wp-content/plugins/woocoomerce/templates/checkout/review-order.php and wp-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.






share|improve this answer














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:




  1. Create Folder in your child theme called woocommerce.

  2. Create two folders inside main woocommerce which you just created called name checkout and cart.

  3. now create file called review-order.php put it inside checkout folder and cart-totals.php put it inside the cart folder then copy the content from the original files which you can find in wp-content/plugins/woocoomerce/templates/checkout/review-order.php and wp-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.







share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin