Created
January 30, 2026 09:03
-
-
Save pramodjodhani/63f854504e417a99182215080a507dc4 to your computer and use it in GitHub Desktop.
Orderable addons: shortcode to display the total price of the product with addons
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 | |
| /** | |
| * Orderable addons: shortcode to display the total price of the product with addons | |
| */ | |
| function orderable_addons_price_total() { | |
| global $product; | |
| $price = $product->get_price(); | |
| return sprintf('<div class="orderable-product__actions-price">%s</div>', wc_price($price)); | |
| } | |
| add_shortcode( 'orderable_addons_price_total', 'orderable_addons_price_total' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment