Messed up my json

Topic summary

A user attempted to modify theme files (global.js, product-form.js, product-info.js, product-modal.js, and product-model.js) to prevent variant pre-selection on product pages. The edits broke the variant price update functionality.

Resolution:

  • After trying 15+ theme iterations without success, the user located the original theme files and reverted the code
  • Most website content was preserved, though theme colors and images required reconfiguration

Key Takeaway:

  • Always backup themes before making changes
  • Best practice: duplicate themes before edits with descriptive naming (including date and change reason)
  • JSON files may not show version history, making recovery difficult without backups
Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

I was trying to change something in my theme that would make the page load without any of the variants selected. I messed it up somewhere along the line and now when I select a variant the price doesn’t change. I was going to reinstall the theme and reset some of the files but I can’t seem to find my current theme again to download and I’m not really sure where to go from here. I don’t recall which ones I ended up editing or leaving edited and which ones I reverted to the original code but I was editing:

global.js, product-form.js, product-info.js, product-modal.js, and product-model.js

I also tried to go back to previous versions of the edits but it didn’t show a previous version assuming due to it being a json file.

Sounds like you messed up a great bit. Since you were doing it on your own i believe you understand code, so may be try tracking back from the errors in the console if there are errors showing.

I do know a little code just am quite rusty with it especially on the web development side of things. I spent a fair bit of time working on it, tried 15+ theme iterations to try and fix the pricing problem and couldn’t figure it out. Eventually I found a copy of the original theme (hiding in plain site of course) and reverted as much code as possible back to the original. Fortunately I maintained most of my website content and just had to redo a lot of the theme colours and pictures. Thank you for your response!

Great to hear that. All we can say here I all’s well that ends well right??

But things like these do teach us stuff. We should always take a backup before making even the smallest change when we are unaware of the outcome.

One good practice i have seen one of my client doing is duplicating every time he makes changes along with good naming practice mentioning the date and also the reason for the change when naming the theme.

Anyways, until next time good luck on your store and your business.

Best

Shadab

That’s really good advice. I will take that on board, thank you!

1 Like