{"id":1822,"date":"2024-02-22T10:34:43","date_gmt":"2024-02-22T09:34:43","guid":{"rendered":"https:\/\/a04y9kbwzan.preview.infomaniak.website\/my-account\/"},"modified":"2025-02-17T16:36:26","modified_gmt":"2025-02-17T15:36:26","slug":"my-account","status":"publish","type":"page","link":"https:\/\/life-plantation.ch\/en\/my-account\/","title":{"rendered":"My account"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1822\" class=\"elementor elementor-1822 elementor-198\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-58f7450 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"58f7450\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-0e2a900\" data-id=\"0e2a900\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8f98f9c elementor-widget elementor-widget-wc-elements\" data-id=\"8f98f9c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wc-elements.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"woocommerce\"><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-120012e elementor-widget elementor-widget-shortcode\" data-id=\"120012e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><input type=\"hidden\" id=\"user-login-status\" value=\"\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-44043ad elementor-widget elementor-widget-html\" data-id=\"44043ad\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<style type=\"text\/css\">\n.d-none {\n    display: none;\n}\n#table-title {\n    text-align: center\n}\n.table-gain {\n\tbox-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;\n\tborder-radius: 10px;\n\tmax-width: 1000px;\n\tmargin: auto;\n\ntable {\n  border-collapse: separate;\n  border-spacing: 0;\n  overflow: hidden;\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  table-layout: fixed;\n\n}\n\n\/* required css to make rounded table (below) *\/\ntr:first-child th:first-child {\n  border-top-left-radius: 10px;\n}\ntr:first-child th:last-child {\n  border-top-right-radius: 10px;\n}\ntr:last-child td:first-child {\n  border-bottom-left-radius: 10px;\n}\ntr:last-child td:last-child {\n  border-bottom-right-radius: 10px;\n}\n\ntable caption {\n  font-size: 1.5em;\n  margin: .5em 0 .75em;\n}\n\ntable tr {\n  border: 1px solid #ddd;\n  padding: .35em;\n}\n\ntable th,\ntable td {\n  padding: 1em 2em;\n  text-align: start;\n\n}\nthead {\n\tbackground: #e8f1d8;\n}\n\ntable th {\n  font-size: .85em;\n  letter-spacing: .1em;\n  text-transform: uppercase;\n}\n\n@media screen and (max-width: 600px) {\n\tbox-shadow : unset;\n  table {\n    border: 0;\n  }\n\n  table caption {\n    font-size: 1.3em;\n  }\n  \n  table thead {\n    border: none;\n    clip: rect(0 0 0 0);\n    height: 1px;\n    margin: -1px;\n    overflow: hidden;\n    padding: 0;\n    position: absolute;\n    width: 1px;\n  }\n  \n  table tr {\n    border-bottom: 3px solid #ddd;\n    display: block;\n    margin-bottom: .625em;\n  }\n  \n  table td {\n    border-bottom: 1px solid #ddd;\n    display: block;\n    font-size: .8em;\n    text-align: right;\n  }\n\n  table td::before {\n    content: attr(data-label);\n    float: left;\n    font-weight: bold;\n    text-transform: uppercase;\n  }\n  tr td:first-child {\n  \tbackground-color:#e8f1d8; \n  }\n  \n  table td:last-child {\n    border-bottom: 0;\n  }\n}\n<\/style>\n<link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/4.7.0\/css\/font-awesome.min.css\">\n\n<div id=\"table-container\">\n    <h3 id=\"table-title\">Here are the results of your contribution:<\/h3>  \n\n    <input type=\"hidden\" id=\"number-cmd\" value=\"0\">\n    <div class=\"table-gain\">\n        <table>\n            <thead>\n                <tr>\n                    <th scope=\"col\">Date<\/th>\n                    <th scope=\"col\">Quantity<\/th>\n                    <th scope=\"col\"><sub>CO2<\/sub> Saved (kg)<\/th>\n                    <th scope=\"col\">Available wood (<sup>m3)<\/sup><\/th>\n                    <th scope=\"col\" id=\"gains\">Estimated earnings<span class=\"currency-display\">(CHF<\/span>)<\/th>\n                    <th scope=\"col\"><sub>CO2<\/sub> saved equivalent to<\/th>\n                <\/tr>\n            <\/thead>\n            <tbody>\n                <!-- Table rows will be dynamically added here -->\n            <\/tbody>\n        <\/table>\n    <\/div>\n<\/div>\n\n<script>\n\n   \/\/ Constants\nconst CONSTANTS = {\n    CO2_PER_TREE_PER_YEAR: 48,\n    KM_PER_TREE_PER_YEAR: 189.6,\n    INITIAL_TREE_VALUE: 240,\n    GROWTH_MULTIPLIER: 2.4,\n    DEFAULT_YEARS: 5\n};\n\n\/\/ Helper Functions\nfunction isUserFromSwitzerland() {\n    const userCountry = document.getElementById('user_country').value;\n    return userCountry ? userCountry === 'CH' : true;\n}\n\nfunction calculateGrowth(initialValue, numberOfYears) {\n    return initialValue * CONSTANTS.GROWTH_MULTIPLIER;\n}\n\nfunction createTableCell(label, content) {\n    const cell = document.createElement('td');\n    cell.setAttribute('data-label', label);\n    cell.textContent = content;\n    return cell;\n}\n\nfunction createCO2EquivalentCell(kmResultCar) {\n    const cell = document.createElement('td');\n    cell.setAttribute('data-label', 'CO2 Econimis\u00e9s equivalent \u00e0');\n\n    const carContent = document.createElement('b');\n    carContent.id = 'car';\n    carContent.textContent = `${kmResultCar.toFixed(0)} km en `;\n\n    const carIcon = document.createElement('i');\n    carIcon.className = 'fa fa-car';\n    carIcon.style.fontSize = '16px';\n    carIcon.style.marginLeft = '4px';\n\n    cell.appendChild(carContent);\n    cell.appendChild(carIcon);\n\n    return cell;\n}\n\nfunction calculate(quantity, numberOfYears, newRow) {\n    const kg_result = quantity * CONSTANTS.CO2_PER_TREE_PER_YEAR * numberOfYears;\n    const km_result_car = quantity * numberOfYears * CONSTANTS.KM_PER_TREE_PER_YEAR;\n    const initialResult = quantity * CONSTANTS.INITIAL_TREE_VALUE;\n    const euro_result = calculateGrowth(initialResult, numberOfYears);\n\n    \/\/ Add cells to row\n    newRow.appendChild(createTableCell('CO2 Economis\u00e9 (kg)', kg_result));\n    newRow.appendChild(createTableCell('Bois disponible (m3)', quantity));\n    newRow.appendChild(createTableCell('Gains Estim\u00e9 (CHF)', euro_result.toFixed(2)));\n    newRow.appendChild(createCO2EquivalentCell(km_result_car));\n}\n\n\/\/ Initialize everything when DOM is loaded\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Update currency display\n    const currencyElements = document.querySelectorAll('.currency-display');\n    const currency = isUserFromSwitzerland() ? \"CHF\" : \"EUR\";\n    currencyElements.forEach(element => {\n        element.textContent = currency;\n    });\n\n    \/\/ Handle table visibility based on login status\n    const userLoginStatus = document.getElementById('user-login-status').value;\n    const tableContainer = document.getElementById('table-container');\n    if (tableContainer) {\n        tableContainer.classList.toggle('d-none', !userLoginStatus);\n    }\n\n    \/\/ Generate table rows from order dates\n    const tableBody = document.querySelector('.table-gain tbody');\n    if (tableBody) {\n        document.querySelectorAll('.order-date').forEach(function(span) {\n            const date = span.getAttribute('data-date');\n            const count = parseInt(span.getAttribute('data-count'));\n\n            const newRow = document.createElement('tr');\n            \n            \/\/ Add date and quantity cells\n            newRow.appendChild(createTableCell('Date', date));\n            newRow.appendChild(createTableCell('Quantit\u00e9', count));\n\n            \/\/ Calculate and add remaining cells\n            calculate(count, CONSTANTS.DEFAULT_YEARS, newRow);\n\n            tableBody.appendChild(newRow);\n        });\n    }\n\n    \/\/ Update user greeting if needed\n    const fullNameElement = document.getElementById('current-user-fullname');\n    if (fullNameElement) {\n        const fullName = fullNameElement.value;\n        const greetingParagraph = document.querySelector('.woocommerce-MyAccount-content > p:first-of-type');\n        \n        if (greetingParagraph && fullName) {\n            const updatedText = greetingParagraph.innerHTML.replace(\n                \/<strong>.*?<\\\/strong>\/g, \n                `<strong>${fullName}<\/strong>`\n            );\n            greetingParagraph.innerHTML = updatedText;\n        }\n    }\n});\n<\/script>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2a050ca elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2a050ca\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-fb15b01\" data-id=\"fb15b01\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Here are the results of your contribution: Date Quantity CO2 Saved (kg) Available wood (m3) Estimated earnings(CHF) CO2 saved equivalent to<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1822","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>My account - Life Plantation<\/title>\n<meta name=\"description\" content=\"Contribuez d\u00e8s maintenant \u00e0 un avenir plus durable.Achetez votre premier arbre de type Paulownias \u201cElongata\u201d en Europe...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/life-plantation.ch\/en\/my-account\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"My account - Life Plantation\" \/>\n<meta property=\"og:description\" content=\"Contribuez d\u00e8s maintenant \u00e0 un avenir plus durable.Achetez votre premier arbre de type Paulownias \u201cElongata\u201d en Europe...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/life-plantation.ch\/en\/my-account\/\" \/>\n<meta property=\"og:site_name\" content=\"Life Plantation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-17T15:36:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/life-plantation.ch\/wp-content\/uploads\/2024\/02\/logo-site-web.png\" \/>\n\t<meta property=\"og:image:width\" content=\"987\" \/>\n\t<meta property=\"og:image:height\" content=\"457\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/life-plantation.ch\/en\/my-account\/\",\"url\":\"https:\/\/life-plantation.ch\/en\/my-account\/\",\"name\":\"My account - Life Plantation\",\"isPartOf\":{\"@id\":\"https:\/\/life-plantation.ch\/en\/#website\"},\"datePublished\":\"2024-02-22T09:34:43+00:00\",\"dateModified\":\"2025-02-17T15:36:26+00:00\",\"description\":\"Contribuez d\u00e8s maintenant \u00e0 un avenir plus durable.Achetez votre premier arbre de type Paulownias \u201cElongata\u201d en Europe...\",\"breadcrumb\":{\"@id\":\"https:\/\/life-plantation.ch\/en\/my-account\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/life-plantation.ch\/en\/my-account\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/life-plantation.ch\/en\/my-account\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/life-plantation.ch\/en\/life-plantation-home\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"My account\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/life-plantation.ch\/en\/#website\",\"url\":\"https:\/\/life-plantation.ch\/en\/\",\"name\":\"Life Plantation\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/life-plantation.ch\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/life-plantation.ch\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/life-plantation.ch\/en\/#organization\",\"name\":\"Life Plantation\",\"url\":\"https:\/\/life-plantation.ch\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/life-plantation.ch\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/life-plantation.ch\/wp-content\/uploads\/2024\/02\/logo-site-web.png\",\"contentUrl\":\"https:\/\/life-plantation.ch\/wp-content\/uploads\/2024\/02\/logo-site-web.png\",\"width\":987,\"height\":457,\"caption\":\"Life Plantation\"},\"image\":{\"@id\":\"https:\/\/life-plantation.ch\/en\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"My account - Life Plantation","description":"Contribuez d\u00e8s maintenant \u00e0 un avenir plus durable.Achetez votre premier arbre de type Paulownias \u201cElongata\u201d en Europe...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/life-plantation.ch\/en\/my-account\/","og_locale":"en_US","og_type":"article","og_title":"My account - Life Plantation","og_description":"Contribuez d\u00e8s maintenant \u00e0 un avenir plus durable.Achetez votre premier arbre de type Paulownias \u201cElongata\u201d en Europe...","og_url":"https:\/\/life-plantation.ch\/en\/my-account\/","og_site_name":"Life Plantation","article_modified_time":"2025-02-17T15:36:26+00:00","og_image":[{"width":987,"height":457,"url":"https:\/\/life-plantation.ch\/wp-content\/uploads\/2024\/02\/logo-site-web.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/life-plantation.ch\/en\/my-account\/","url":"https:\/\/life-plantation.ch\/en\/my-account\/","name":"My account - Life Plantation","isPartOf":{"@id":"https:\/\/life-plantation.ch\/en\/#website"},"datePublished":"2024-02-22T09:34:43+00:00","dateModified":"2025-02-17T15:36:26+00:00","description":"Contribuez d\u00e8s maintenant \u00e0 un avenir plus durable.Achetez votre premier arbre de type Paulownias \u201cElongata\u201d en Europe...","breadcrumb":{"@id":"https:\/\/life-plantation.ch\/en\/my-account\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/life-plantation.ch\/en\/my-account\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/life-plantation.ch\/en\/my-account\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/life-plantation.ch\/en\/life-plantation-home\/"},{"@type":"ListItem","position":2,"name":"My account"}]},{"@type":"WebSite","@id":"https:\/\/life-plantation.ch\/en\/#website","url":"https:\/\/life-plantation.ch\/en\/","name":"Life Plantation","description":"","publisher":{"@id":"https:\/\/life-plantation.ch\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/life-plantation.ch\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/life-plantation.ch\/en\/#organization","name":"Life Plantation","url":"https:\/\/life-plantation.ch\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/life-plantation.ch\/en\/#\/schema\/logo\/image\/","url":"https:\/\/life-plantation.ch\/wp-content\/uploads\/2024\/02\/logo-site-web.png","contentUrl":"https:\/\/life-plantation.ch\/wp-content\/uploads\/2024\/02\/logo-site-web.png","width":987,"height":457,"caption":"Life Plantation"},"image":{"@id":"https:\/\/life-plantation.ch\/en\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/pages\/1822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/comments?post=1822"}],"version-history":[{"count":16,"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/pages\/1822\/revisions"}],"predecessor-version":[{"id":4231,"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/pages\/1822\/revisions\/4231"}],"wp:attachment":[{"href":"https:\/\/life-plantation.ch\/en\/wp-json\/wp\/v2\/media?parent=1822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}