{"id":18319,"date":"2024-07-09T08:36:50","date_gmt":"2024-07-09T08:36:50","guid":{"rendered":"https:\/\/drjohannes.com\/membership-checkout\/"},"modified":"2024-08-29T06:40:53","modified_gmt":"2024-08-29T06:40:53","slug":"membership-checkout","status":"publish","type":"page","link":"https:\/\/drjohannes.com\/en\/membership-checkout\/","title":{"rendered":"Membership Checkout"},"content":{"rendered":"<p>[pmpro_checkout]<\/p>\n<p><script>\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n    \/\/ Function to add space between \"NOK\" and the price\n    function addSpaceAfterNOK() {\n        \/\/ Select all paragraph elements with the class `pmpro_level_cost_text`\n        var paragraphs = document.querySelectorAll('.pmpro_level_cost_text p');<\/p>\n<p>        \/\/ Iterate over all found paragraphs\n        paragraphs.forEach(function(paragraph) {\n            \/\/ Select the strong element within the paragraph\n            var strongElement = paragraph.querySelector('strong');<\/p>\n<p>            if (strongElement) {\n                \/\/ Get the text content of the strong element\n                var textContent = strongElement.textContent;<\/p>\n<p>                \/\/ Replace \"NOK\" followed immediately by any digits with \"NOK \" and the digits\n                strongElement.textContent = textContent.replace(\/NOK(\\d+)\/, 'NOK $1');\n            }\n        });\n    }<\/p>\n<p>    \/\/ Call the function initially in case content is already loaded\n    addSpaceAfterNOK();<\/p>\n<p>    \/\/ Create a MutationObserver to monitor changes in the DOM\n    var observer = new MutationObserver(function(mutations) {\n        mutations.forEach(function(mutation) {\n            if (mutation.type === 'childList') {\n                \/\/ Re-run the function to add space after content is updated\n                addSpaceAfterNOK();\n            }\n        });\n    });<\/p>\n<p>    \/\/ Observe the entire document for changes in the DOM tree\n    observer.observe(document.body, {\n        childList: true,\n        subtree: true\n    });\n});<\/p>\n<p><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[pmpro_checkout]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"pmpro_default_level":"","footnotes":""},"class_list":["post-18319","page","type-page","status-publish","hentry","pmpro-has-access"],"acf":[],"_links":{"self":[{"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/pages\/18319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/comments?post=18319"}],"version-history":[{"count":16,"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/pages\/18319\/revisions"}],"predecessor-version":[{"id":20740,"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/pages\/18319\/revisions\/20740"}],"wp:attachment":[{"href":"https:\/\/drjohannes.com\/en\/wp-json\/wp\/v2\/media?parent=18319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}