Commit 514f7bda authored by Maikel Koek's avatar Maikel Koek

Automatically copies payment link to clipboard

When not supported by browser, the link can still be copied manually
parent ea9146e8
......@@ -27,6 +27,18 @@
<div class="admin__page-section-item-title">
<span class="title"><?php echo __('Adyen Payment Link');?></span>
</div>
<a href="<?=$block->getPaymentLinkUrl();?>" target="_blank">
<?php echo __('Adyen Payment Link for remaining total due'); ?>
<p id="paymentlink"></p>
<a href="<?=$block->getPaymentLinkUrl();?>" onclick="copyToClipboard(event, '<?=$block->getPaymentLinkUrl();?>')" style="cursor:pointer;">
<?php echo __('Copy payment link to clipboard'); ?>
</a>
<script type="text/javascript">
function copyToClipboard(e, text) {
e.preventDefault();
var $temp = jQuery("<input>");
jQuery("body").append($temp);
$temp.val(text).select();
document.execCommand("copy");
$temp.remove();
}
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment