How can I change a Liquid code operator with JS functions?

Hey There,

I’ve tried to find someting about how to change a Liquid code operator like " {% if product.id == 8841903374659 %} " with a JS script to something like

function changeProductId() {

var ProductId = 32845384252

/* → overwriting the current Liquid code or changing the ID */

}

Thanks for your help !

Hi @yungmuehle ,

I think you can’t change liquid by JS code. because it is 2 different variables

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

hello

as i have checked your code.Can you tell me why you want to change the code?

I mean can’t set liquid variables by JS