This commit is contained in:
Oliver
2025-10-12 18:04:27 -03:00
parent e1642f421f
commit 23c78b3d78

View File

@@ -26,10 +26,18 @@
h2 {
text-align: center;
color: #262626;
margin-bottom: 8px;
margin-bottom: 4px;
font-weight: 600;
}
/* New small centered contract name */
.contract-name {
text-align: center;
font-size: 0.85em;
color: #666;
margin-bottom: 25px;
}
.subtitle {
text-align: center;
font-size: 0.9em;
@@ -114,11 +122,18 @@
.action-btn.secondary:hover {
background-color: #5a636a;
}
.action-btn:disabled {
background-color: #ccc;
cursor: not-allowed;
transform: none;
}
</style>
</head>
<body>
<div class="summary-container">
<h2>Check and Upgrade Your Plan</h2>
<div class="contract-name" id="contractName">Loading...</div>
<div class="subtitle">
Choose an upgrade. With this upgade you only pay for the <b>remaining days</b> of your current contract. Due to technical reasons, the <b>total price</b> will be included in the payment link sent to your email. If you dont want to upgrade, simply dont complete the payment. Current yearly prices are listed on our homepage, and new features will apply when you extend your contract next time.
</div>
@@ -173,7 +188,6 @@
</div>
<script>
// Configuration
const webhookUrl = "https://002-001-5dd6e535-4d1c-46bc-9bd9-42ad4bc5f082.odoo4projects.com/webhook/0c8536be-d175-4740-8e78-123159193b23";
const webhook_buy = "https://002-001-5dd6e535-4d1c-46bc-9bd9-42ad4bc5f082.odoo4projects.com/webhook/2366cc41-bfd9-41c0-b9b4-bea1e60726f1";
@@ -204,6 +218,15 @@
document.getElementById("workersValue").textContent = data.workers || "-";
document.getElementById("hddValue").textContent = data.hdd ? `${data.hdd} MB` : "-";
document.getElementById("expiresValue").textContent = data.expires || "-";
document.getElementById("contractName").textContent = data.contract_name || "-";
// Disable buttons based on contract_name
if (data.contract_name === "On the Rise") {
document.getElementById("upgradeRiseBtn").disabled = true;
} else if (data.contract_name === "Powerhouse") {
document.getElementById("upgradeRiseBtn").disabled = true;
document.getElementById("upgradePowerhouseBtn").disabled = true;
}
} catch (err) {
console.error(err);
@@ -234,7 +257,6 @@
}
}
// Button event listeners with product_id mapping
document.getElementById("upgradeRiseBtn").addEventListener("click", () => buyProduct("ontherise"));
document.getElementById("upgradePowerhouseBtn").addEventListener("click", () => buyProduct("powerhouse"));
document.getElementById("addDomainBtn").addEventListener("click", () => buyProduct("1-domain"));