-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Taxes not applied to the price when displayed with shortcode (#35)
Fixes #34
- Loading branch information
1 parent
6610aa1
commit c9d4cd2
Showing
7 changed files
with
68 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace PriorPrice; | ||
|
||
class Taxes { | ||
|
||
/** | ||
* Apply taxes to the price. | ||
* | ||
* @since 1.6.2 | ||
* | ||
* @param float $price | ||
* @param \WC_Product $wc_product | ||
* | ||
* @return float | ||
*/ | ||
public function apply_taxes( float $price, \WC_Product $wc_product ) : float { | ||
|
||
return 'incl' === get_option( 'woocommerce_tax_display_shop' ) ? | ||
(float) wc_get_price_including_tax( $wc_product, [ 'price' => $price ] ) : | ||
(float) wc_get_price_excluding_tax( $wc_product, [ 'price' => $price ] ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,14 @@ | |
# This file is distributed under the same license as the WC Price History plugin. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: WC Price History 1.5\n" | ||
"Project-Id-Version: WC Price History 1.6.2\n" | ||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wc-price-history\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"POT-Creation-Date: 2023-01-14T14:13:25+01:00\n" | ||
"POT-Creation-Date: 2023-01-17T14:01:36+01:00\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"X-Generator: WP-CLI 2.6.0\n" | ||
"X-Domain: wc-price-history\n" | ||
|
@@ -31,7 +31,7 @@ msgid "Konrad Karpieszuk" | |
msgstr "" | ||
|
||
#. translators: %d product id, %s link to product edit screen. | ||
#: app/PriorPrice/HistoryStorage.php:67 | ||
#: app/PriorPrice/HistoryStorage.php:69 | ||
msgid "Product #%1$d is on sale but has no sale start date. Please edit this product and set starting date for sale: %2$s" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters