@creedon — This worked perfectly! Thank you for your assistance.
A note for any other users with this issue: After adding the code above to the Shop page's Page Header Code Injection and hitting "Save" in the page settings dialog box, I still received the error message that changes to this page could not be saved. However, after hitting "Cancel" and refreshing my browser, it was clear that the code updates had saved appropriately despite the error message.