- This topic has 4 replies, 2 voices, and was last updated 11 years, 3 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › eStore Shortcode in page template
Tagged: Subscribe button, subscription
Hi, I am trying to use the WordPRess function ‘do_shortcode’ in my page template. HEre is the code that I am trying to implement but it just returning the shortcode text.
Example: I am using this in my page template ‘<?php echo do_shortcode (‘[wp_eStore_subscribe:product_id:4:end]’); ?>. But is is not returning the subscribe button. It is only returning ‘[wp_eStore_subscribe:product_id:4:end]’ as a string.
Can you help me with this?
Thanks
Update: I have found a work around. However, I don’t think that this is the most practical way to do things. I have copied all of the form HTML code by using chrome’s element inspector and it is processing to the Paypal checkout page. But again. if there is a way I can use the shortcode that would be great. But if the way I have done it will work then that would be even greater.
Thanks
Wayne Hatter
Hi, you can try using the following function instead of copying the html button code:
<?php echo print_eStore_subscribe_button_form(4); ?>
Also, the text link purchase button feature can be handy too:
Cool, Thank you.
This is how I am utilizing the shortcode function in case there is anyone else wanting to do the same thing:
function sub_button(){
ob_start();
$subscribe = print_eStore_subscribe_button_form(4);
return $subscribe;
}
add_shortcode(‘subscribe’, ‘sub_button’);
Where ‘4’ is equal to the product ID.