I sell online Gift Cards using Woocommerce on Wordpress. On the thank you page it displays the download image (containing the Gift Card Key) as a button.
I would like it to display the image itself to be downloaded in full size above the the download link.
Screenshot of the Thank You Page
Here's the part that displays the download section in PHP:
<?php break;
case 'download-file' : ?>
<a href="<?php echo esc_url( $download['download_url'] ); ?>" class="woocommerce-MyAccount-downloads-file">
<?php echo esc_html( $download['file']['name'] ); ?>
</a>
Can you help me out plz?
Try this code. you have to download
attribute to <a>
tag
<?php
break;
case 'download-file' : ?>
<a href="<?php echo esc_url( $download['download_url'] ); ?>"
class="woocommerce-MyAccount-downloads-file" download>
<?php echo esc_html( $download['file']['name'] ); ?>
</a>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.