#๐Ÿš€ Help Needed: Optimizing Custom Sticker Price Calculator in JavaScript! ๐ŸŽจ

9 messages ยท Page 1 of 1 (latest)

elfin dove
#

โœ๏ธ What I Need
Iโ€™m looking for JavaScript pros who can:

Review the pricing and discount logic for accuracy.
Help optimize the code to make it more efficient and maintainable.
Offer suggestions for cleaner ways to handle UI updates and discount calculations.

Can send repo its on github! its a DJANGO project!

but the JS is vanilla javascript!

fleet breachBOT
elfin dove
#

take a look at the code plz dyno man

humble minnow
#
  • there should be no need to listen for the DOMContentLoaded event. defer loading of your script or use modules instead.
  • while probably safe here, it's generally best to avoid innerHTML. this appears to be a good place to use HTML templates instead.
  • instead of reassigning quantities inside determineQuantities(), make it a const and push the values you want
  • look into event delegation for the tile click event handler and input event handler

(I didn't review the pricing logic, just the code)

elfin dove
#

could you help me with the pricing logic, i mean its working but just not outputting correct maths and the savings are huge to the base price of the sticker im not sure how i can adjust these

humble minnow
#

what specifically is wrong? start logging things after each step and see where your calculation goes wrong

elfin dove