Shopify themes, liquid, logos, and UX
i Wanna Make Thius Code Copied In 1 Click..
URL: https://mrzkj1nl2c81f39s-55495491628.shopifypreview.com
Hello @Emiway
Are you want to copy the code in green color when user click on it ?
Am i right ?
If yes, then you only need to follow below steps:
1. Go to admin > Online Store > edit code.
2. In code directory, find the file named "theme.liquid" and open it.
3. Scroll down to and of the page and paste below code above body tag ends like this </body>.
<script>
function copyText(element) {
var text = element.textContent;
navigator.clipboard.writeText(text).then(function() {
console.log('Text copied to clipboard');
})
}
var element = document.querySelector('.text-with-icon span.text-sm');
element.addEventListener('click', function() {
copyText(this);
});
</script>
4. Don't forget to save the file after making changes.
Hope this code works for your issue.
If this code helpful to you, then just like and mark this solution as solved.
Not Working
Can you please share the store url so i can check what's the exact issue ?
where do you place above mentioned code in your theme ?
in theme.liquid
Then just remove that code from theme.liquid and paste in main-product.liquid file before schema starts.
not working
Can you please attach the actual screenshot of the code where you placed ?
I've checked and It is working fine on mobile and desktop.
It might be some cache issues. Try by clear all caches and try again
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024