All things Shopify and commerce
Hi I would like when I click on the different variations then the title should be different - Is this possible?
This would also be good for google ads!
Thank you very much
Any advice is appreciated.
Hi,
Adding JavaScript Functionality can help
Code example
<script>
document.addEventListener('DOMContentLoaded', function() {
var variantSelector = document.querySelector('#product-selectors');
var titleElement = document.querySelector('.product-title');
variantSelector.addEventListener('change', function() {
var selectedVariant = variantSelector.value;
var variantTitle = document.querySelector(`option[value="${selectedVariant}"]`).text;
titleElement.textContent = variantTitle;
});
});
</script>
If you need more help on this you can contact us
What theme are you using? Could you share your store URL so we can check?
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025