OiO.lk Blog PHP WooCommerce Subscriptions Custom Shortcode for ReOccurring Totals
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

Exit mobile version