We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

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 @@ ...@@ -27,6 +27,18 @@
<div class="admin__page-section-item-title"> <div class="admin__page-section-item-title">
<span class="title"><?php echo __('Adyen Payment Link');?></span> <span class="title"><?php echo __('Adyen Payment Link');?></span>
</div> </div>
<a href="<?=$block->getPaymentLinkUrl();?>" target="_blank"> <p id="paymentlink"></p>
<?php echo __('Adyen Payment Link for remaining total due'); ?> <a href="<?=$block->getPaymentLinkUrl();?>" onclick="copyToClipboard(event, '<?=$block->getPaymentLinkUrl();?>')" style="cursor:pointer;">
<?php echo __('Copy payment link to clipboard'); ?>
</a> </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