Merge pull request #17414 from woocommerce/fix/17412

Cart totals: don't add shipping unless show_shipping is true.
This commit is contained in:
Claudio Sanches 2017-10-27 16:02:02 -02:00 committed by GitHub
commit 58d7a3fd3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,10 @@ final class WC_Cart_Totals {
protected function get_shipping_from_cart() {
$this->shipping = array();
if ( ! $this->cart->show_shipping() ) {
return;
}
foreach ( $this->cart->calculate_shipping() as $key => $shipping_object ) {
$shipping_line = $this->get_default_shipping_props();
$shipping_line->object = $shipping_object;