Hi everyone,
I’m trying to add a custom “Pay with Crypto” button to both my product page and cart page that:
-
Matches the current design and placement of the existing payment buttons (just below “Add to Cart” or “Checkout”).
-
Dynamically grabs the product or cart total price (in USD).
-
Redirects the customer to a NOWPayments crypto checkout page using their API.
Here’s what I need help with:
How can I reliably target the product price and cart total using JavaScript in the Rebel theme?
Where exactly should I insert the button and script to avoid Shopify’s form submission errors (especially when an item is sold out)?
Any tips on keeping the styling consistent and Shopify-safe while triggering the external payment redirect?
I’ve tried adding the button to main-product.liquid and calling the NOWPayments API via JS, but I get a “Payment creation failed” error — likely because the script isn’t reading the price correctly.
Any help or sample code would be hugely appreciated!
Thanks in advance.
Best,
Rowan