This tutorial goes over how to add custom add to cart links to the single download page template. It also goes over how you can display the digital product price. In this tutorial we will be adding the price and a link to add the product to the shopping cart in the sidebar of the individual products.
Notes from the Video
- Open
sidebar-download.php
- Display the price and a purchase link with the following code:
12345678910111213141516171819<?php/*** The sidebar containing the download sidebar widget area.** @package bootstrapwp*/?><strong>Price: <?php edd_price($post->ID); ?></strong><a href="<?php bloginfo('url'); ?>/checkout?edd_action=add_to_cart&download_id=<?php echo get_the_ID(); ?>">Purchase This</a><div id="secondary" class="widget-area col-md-3 col-lg-3" role="complementary"><?php dynamic_sidebar( 'download' ); ?></div><!-- #secondary --></div> <!-- .row --></div> <!-- .container --> - The Easy Digital Downloads documentation for displaying the price can be found here and the documentation for creating custom add to cart links can be found here.