【发布时间】:2020-10-05 12:32:37
【问题描述】:
我正在做一个简单的弹出窗口,您可以在其中查看分期付款的产品价格。我写了一个简单的脚本。它按我的意愿工作。产品页面上有一个按钮(弹出窗口)。一切都很好!但是网站的主页给出了致命的错误。为什么会这样,我不知道。请帮忙!我正在使用 WordPress v5.5.1 和 WooCommerce v4.5.2
<?php
$product = wc_get_product( get_the_id());
$price = $product->get_price();
$deadline = 12;
$rate = 25;
$rate_sum = ($price/ 100) * $rate;
$total_sum = $price+ $rate_sum;
$base_per_month = $total_sum / $deadline;
?>
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content position-relative">
<div class="modal-header"><strong>Купить в рассрочку</strong></div>
<div class="modal-body">
<h3>Через MegaDream</h3>
<table class="table">
<thead>
<tr>
<th class="col" style="width: 33%;">Оплата за месяц</th>
<th class="col" style="width: 33%;">Срок (месяц)</th>
<th class="col" style="width: 33%;">Общая сумма</th>
</tr>
</thead>
<tbody>
<tr>
<td><b id="month_credit" style="color: #fe4f19; font-weight: 800;"><?php echo round($base_per_month); ?></b></td>
<td style="text-align: left;"><b style="color: #fe4f19; font-weight: 800;">12</b></td>
<td><b id="total_credit" style="color: #fe4f19; font-weight: 800;"><?php echo round($total_sum); ?></b></td>
</tr>
</tbody>
</table>
По вопросам получения товаров в рассрочку, звоните по номеру <strong>+998(99) 351-71-40</strong>
</div>
<div class="modal-footer"><a class="btn btn-primary" style="background-color: #457f33; color: white;" href="tel:+998993517140" type="button">Позвонить</a></div>
</div>
</div>
【问题讨论】:
-
“为什么我不知道。” - 为什么会这样,你需要去看看!我们无法从外部查看您的系统。每当您收到 500 Internal Server 错误时,您必须做的第一件事就是检查错误日志的内容。
标签: php wordpress woocommerce