Skip to content

Instantly share code, notes, and snippets.

@pramodjodhani
Created January 30, 2026 09:03
Show Gist options
  • Select an option

  • Save pramodjodhani/63f854504e417a99182215080a507dc4 to your computer and use it in GitHub Desktop.

Select an option

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
<?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