On my webshop I have to see a button with a link to ad pdf file. For every product that button need to have a different link and a different button title name.
I built the webshop with woocommerce where I used Advanced Custom fields to show the buttons with a pdf link. In ACF I used a link array. On the product page I can change the title text of the link manually.
But. There are more than 1000 products. So it's not possible to do this manually. I imported a csv with the right header names. And importing the columns with links to the buttons works properly.
In the php code I used this standard acf code:
<?php
$link = get_field('link');
if( $link ):
$link_url = $link['url'];
$link_title = $link['title'];
$link_target = $link['target'] ? $link['target'] : '_self';
?>
<a class="button" href="<?php echo esc_url( $link_url ); ?>" target="<?php echo esc_attr( $link_target ); ?>"><?php echo esc_html( $link_title ); ?></a>
<?php endif; ?>
So, what meta data I have to give in my csv file to fill in the link title? --> The title on the button.