Skip to content

Instantly share code, notes, and snippets.

View vvkh's full-sized avatar

Valentin Khomutenko vvkh

View GitHub Profile
@vvkh
vvkh / shopfiy_translate_buy_now_button.html
Last active January 19, 2024 17:00
Translate "buy now" button in Shopify
<script>
// Add this snippet to the page with the "buy now" button.
// If you need dynamic translation to different languages,
// add products.product.buy_now translation to the locales file.
// Otherwise replace {{'products.product.buy_now' | t }} with desired translation.
const intervalTime = 100;
function updateButton() {
const paymentButton = document.querySelector('[data-testid="Checkout-button"]');
if (paymentButton !== null) {