我是初学者,请尝试使用Simplecart.js制作模板,并且效果很好。
为了使结账过程看起来更好,我安装了查询步骤,但是发送和接收的电子邮件不完整
这是html文件
<div class="checkout-form">
<form action="checkout.php" id="contact" method="post">
<div>
<h3>Data Order</h3>
<fieldset>
<div id="cart-details">
<div class="simpleCart_items">
</div>
<div class="headerRow">
</div>
</div>
<div style="color: #447294; font-size: 12px;padding-top: 8px;">
Note: bla bla</div>
<br />
<div class="cart-body" id="tableTotal">
<div style="float: left; overflow: hidden; width: 100%;">
<table class="table-total" style="border: none;"> <tbody>
<tr><td>Total Item</td><td>: <span class="simpleCart_quantity" id="jumlah_item">0</span> item(s)</td></tr>
<tr><td>Subtotal</td><td>: <b><span class="simpleCart_total">0.00</span></b></td></tr>
</tbody></table>
</div>
</div>
</fieldset>
<h3>Personal Data</h3>
<fieldset>
<label for="firstname">firstname *</label>
<input id="firstname" name="firstname" type="text" class="required">
<label for="email">Email *</label>
<input id="email" name="email" type="text" class="required email">
<label for="phone">phone</label>
<input id="phone" name="phone" type="text" class="required">
<p>(*) Harap di Lengkapi</p>
</fieldset>
<h3>Shipping data</h3>
<fieldset>
<label for="address1">address1</label>
<input id="address1" name="address1" type="text" class="required">
<label for="address2">address2</label>
<input id="address2" name="address2" type="text" class="required">
<label for="address3">address3</label>
<input id="address3" name="address3" type="text" class="required">
<label for="address4">address4</label>
<input id="address4" name="address4" type="text" class="required">
<p>(*) Harap di Lengkapi</p>
</fieldset>
<h3>Finish</h3>
<fieldset>
<input id="acceptTerms" name="acceptTerms" type="checkbox" class="required"> <label for="acceptTerms">I agree with the Terms and Conditions.</label>
</fieldset>
</div>
<a href="javascript:;" class="simpleCart_checkout" style= "visibility:hidden"><span id="btn">Send Order</span></a>
</form>
</div>
这是我的js
<script>
var form = $("#contact");
form.children("div").steps({
headerTag: "h3",
bodyTag: "fieldset",
transitionEffect: "slideLeft",
onStepChanging: function (event, currentIndex, newIndex)
{
form.validate().settings.ignore = ":disabled,:hidden";
return form.valid();
},
onFinishing: function (event, currentIndex)
{
form.validate().settings.ignore = ":disabled";
return form.valid();
},
onFinished: function (event, currentIndex) {
var form = $(this);
$("#contact").submit();
}
});
</script>
出什么问题了,我应该怎么做才能发送定单数据?
无法交付的php
for($i=1; $i < $content['itemCount'] + 1; $i++) {
$name = 'item_name_'.$i; /* product name variable */
$quantity = 'item_quantity_'.$i; /* product quantity variable */
$price = 'item_price_'.$i; /* product price variable */
$total = $content[$quantity]*$content[$price]; /* product total price variable (price*quantity) */
$grandTotal += $total; /* accumulating the total of all items */
$body .= 'Order #'.$i.': '.$content[$name]."\n".'Qty x '.$content[$quantity].' --- Unit Price $'.number_format($content[$price], 2, '.', '')."\n".'Subtotal $'.number_format($total, 2, '.', '')."\n"; /* creating a semantic format for each ordered product */
$body .= '=================================='."\n";
}
/* ending the loop to get all orders from the stored array */
$body .= 'Order Total: $'.number_format($grandTotal, 2, '.', '')."\n"; /* total amount of the order */
$body .= '=================================='."\n";
先谢谢