Skip to content

Commit 6532e0a

Browse files
creative-andrewAndres A
andauthored
Adds taxes to variation prices. (#717)
Co-authored-by: Andres A <[email protected]>
1 parent 7343ab2 commit 6532e0a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

includes/model/class-product-variation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ protected function init() {
5757
},
5858
'price' => function() {
5959
return ! empty( $this->wc_data->get_price() )
60-
? \wc_graphql_price( $this->wc_data->get_price() )
60+
? \wc_graphql_price( \wc_get_price_to_display( $this->wc_data, [ 'price' => $this->wc_data->get_price() ] ) )
6161
: null;
6262
},
6363
'regularPrice' => function() {
64-
return ! empty( $this->wc_data->get_regular_price() ) ?
65-
\wc_graphql_price( $this->wc_data->get_regular_price() )
64+
return ! empty( $this->wc_data->get_regular_price() )
65+
? \wc_graphql_price( \wc_get_price_to_display( $this->wc_data, [ 'price' => $this->wc_data->get_regular_price() ] ) )
6666
: null;
6767
},
6868
'salePrice' => function() {
6969
return ! empty( $this->wc_data->get_sale_price() )
70-
? \wc_graphql_price( $this->wc_data->get_sale_price() )
70+
? \wc_graphql_price( \wc_get_price_to_display( $this->wc_data, [ 'price' => $this->wc_data->get_sale_price() ] ) )
7171
: null;
7272
},
7373
'dateOnSaleFrom' => function() {

0 commit comments

Comments
 (0)