Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I've used the script bellow to update my metafield data in a variant change event.
But it also refresh when I change product's quantity, returning always quantity = 1.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$(".no-js-hidden").on("click", function(){
var refreshint = setInterval(function(){
location.reload();
}, 1000); }); });
</script>
Can someone help me? Thanks
Hi @guilhermealbino,
I really don't understand your question, but the code you sent is not really good.
I checked and it won't help you to update anything. It will reload the page when you click on any class 'no-js-hidden' so there won't be metafield data.
If you want to catch a block, you need to create a separate class for it.
Hope it helps!
What I'm trying to do is something that updates the div where the metafields are shown when I change a product's variant. What you said already made me understand why it updates when I change the product's quantity. The quantity field is also of the "no-js-hidden" class.
@LitExtension Would you have any way to resolve this issue? I noticed that some fields use the "radio" type;
Thanks
Hi @guilhermealbino,
Please send your site and if your site is password protected, please send me the password. I will check it.
Dealing with similar issue. What was your fix?
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025