All things Shopify and commerce
I have primary & secondary products. I need to get the selections for secondary product displayed only after at least making 1 item selection in the primary product. Is it possible to do that directly from shopify.com or if there are any applicable shopify apps to it. I request a specific response please.
Hi,
First ensure your Shopify product template includes both primary and secondary product selection inputs.
After that use javascript
Example code
<script>
document.addEventListener('DOMContentLoaded', function() {
var primaryProductSelector = document.querySelector('#primary-product-selector');
var secondaryProductSelections = document.querySelector('.secondary-product-selections');
primaryProductSelector.addEventListener('change', function() {
if (primaryProductSelector.value) {
secondaryProductSelections.style.display = 'block';
} else {
secondaryProductSelections.style.display = 'none';
}
});
});
</script>
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025