-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Adição do botao gerar link de pagamento, alteração no texto de l…
…ink de pagamento para ver link de pagamento, botão na coluna link de pagamento agora é edit pedido, css no padding do botao link de pagamento
- Loading branch information
1 parent
ec2a989
commit ea18edc
Showing
8 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
jQuery(document).ready(function ($) { | ||
const copyLinkPostEditButtons = document.querySelectorAll('.btnCopyPostLink'); | ||
copyLinkPostEditButtons.forEach(button => { | ||
button.addEventListener('click', function (e) { | ||
e.preventDefault(); | ||
const link = e.currentTarget.href; | ||
const tempInput = document.createElement('input'); | ||
tempInput.value = link; | ||
document.body.appendChild(tempInput); | ||
tempInput.select(); | ||
document.execCommand('copy'); | ||
document.body.removeChild(tempInput); | ||
}); | ||
}); | ||
let url = window.location.href; | ||
let side = document.querySelector(".page-title-action"); | ||
if (side && (url.includes("post_type=shop_order") || url.includes("action=edit"))) { | ||
let button = document.createElement('a'); | ||
button.className = 'button button-primary'; | ||
button.style.marginLeft = '10px'; | ||
button.style.marginTop = '10px'; | ||
button.setAttribute("target", "_blank"); | ||
button.innerText = "Gerar Link de Pagamento"; | ||
button.setAttribute("href", `${location.origin}/wp-admin/post-new.php?post_type=shop_order&vindi-payment-link=true`); | ||
side.after(button); | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters