Hi
Is there some standard code we can use to get variant pricing and pass it to our js script?
Currently for our app we are asking the shopowner to copy/paste some code into theme.js or global.js but how do we define EXACTLY where to paste the code?
Example of our current code is:
updateFinanceCalculator() {
let input = document.getElementById(“myPrice”);
let lastValue = input.value;
input.value = (this.currentVariant.price)/100;
let event = new Event(‘input’, { bubbles: true });
event.simulated = true;
let tracker = input._valueTracker;
if (tracker) {
tracker.setValue(lastValue);
}
input.dispatchEvent(event);
}