October 24, 2024
Chicago 12, Melborne City, USA
PHP

WooCommerce Subscriptions Custom Shortcode for ReOccurring Totals


I need a shortcode to display the reoccurring monthly totals for a WooCommerce subscription order. After checkout, I’m requiring a customer to sign a lease for the rental order they just placed and need a way to show what their first monthly payment will be. Because I prorate, the order subtotals and totals don’t contain the correct info.

I tried using the following, based on the documentation here: https://woocommerce.com/document/subscriptions/develop/functions/

add_shortcode('wdm_recurring_totals', 'wmd_my_custom_function');
function wmd_my_custom_function(){
    WC_Subscription::get_total();
}

These seems to just throw a page error on testing. I’m inexperienced with PHP. Thanks in advance!



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video