Created
February 25, 2022 15:26
-
-
Save wpflames/23083ee937cb014703072094531d0cfa to your computer and use it in GitHub Desktop.
Display Product Price with VAT in Single Product WooCommerce
This file contains hidden or 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
| <?php | |
| // ========================================================================= | |
| // DISPLAY PRODUCT PRICE WITH VAT | |
| // ========================================================================= | |
| function display_product_price_with_vat(){ | |
| global $product; | |
| $brutto_ar = wc_get_price_to_display( $product ); | |
| $netto_ar = $brutto_ar/127*100; | |
| $netto_ar_rounded = round($netto_ar); | |
| $netto_ar_plus_afa = $netto_ar_rounded .' Ft + 27% áfa'; | |
| echo '<div class="afa">'.$netto_ar_plus_afa.'</div>'; | |
| } | |
| add_action('woocommerce_single_product_summary', 'display_product_price_with_vat'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment