Hi Josh,
I hope you are well today and thank you for your question.
Is there a way of setting up a shortcode to pull the subscription name and description?
You can use the following shortcodes to display subscription name and description.
[subscriptiontitle subscription="2"] – The title of the subscription.
[subscriptiondetails subscription="2"] – The Subscription plan details.
Along with above shortcodes you can also use the following shortcodes which displays subscription plan price and button.
[subscriptionprice subscription="2"] – The subscription plan price.
[subscriptionbutton subscription="2"] - And the subscription plan button
Replace the number with the ID of the subscription.
Best Regards,
WPMU DEV
Hi,
That works almost perfectly!
I’m having a problem with the subscription price shortcode. No matter what info I enter into the price box on the Subscriptions admin screen, it will only show ‘Free’.
Am I missing something?
Thanks
Hi Josh,
Thank you for your reply.
I could reproduce the same issue on my test site subscription price shortcode therefore i have notified the plugin developer to fix it.
In the meanwhile to fix this issue just try editing the following Membership plugin file on line number 1986
Membership plugin file:
membership/membershipincluds/classes/membershippublic.php
Before Editing:
$first = $sub->get_level_at_position(1);
if(!empty($first)) {
$price = $first->level_price;
if($price == 0) {
$price = "Free";
} else {
$M_options = get_option('membership_options', array());
switch( $M_options['paymentcurrency'] ) {
case "USD": $price = "$" . $price;
break;
case "GBP": $price = "£" . $price;
break;
case "EUR": $price = "€" . $price;
break;
default: $price = apply_filters('membership_currency_symbol_' . $M_options['paymentcurrency'], $M_options['paymentcurrency']) . $price;
}
}
}
After Editing:
$price = $sub->sub_pricetext();
if( empty($price) || $price == '0' || $price == '') {
$price = "Free";
} else {
$M_options = get_option('membership_options', array());
switch( $M_options['paymentcurrency'] ) {
case "USD": $price = "$" . $price;
break;
case "GBP": $price = "£" . $price;
break;
case "EUR": $price = "€" . $price;
break;
default: $price = apply_filters('membership_currency_symbol_' . $M_options['paymentcurrency'], $M_options['paymentcurrency']) . $price;
}
}
Note: You are making changes in the plugin file and these changes will be overwritten and lost when you update the plugin and you will have to make these again after plugin updation.
Best Regards,
WPMU DEV
That works perfectly, thanks very much for your help!
You are most welcome, if I can be of any further assistance please don’t hesitate to ask 🙂