0

我正在尝试按照此处的教程为简单购物车网站实施单页结帐:

https://tutorials.modxsimplecart.com/one-page-checkout

虽然我已经这样做了,但当我尝试结帐时出现(SimpeCart 生成)错误。正常的 2 页签出工作正常。

有人知道我能做些什么来解决这个问题吗?我的代码(在 One Page Checkout 模板上)是:

[[!scGetCart]]

    [[!FormItRetriever? &redirectToOnNotFound=`[[*parent]]`]]

[[!FormIt?
    &store=`1`
    &hooks=`spam,scCreateOrder,redirect`
    &submitVar=`checkout`
    &redirectTo=`[[*id:scFirstChild]]`
    &validate=`nospam:blank,
        deliveryMethod:required,
        paymentMethod:required,
        firstname:required,
        lastname:required,
        street:required,
        number:required,
        zip:required,
        city:required,
        country:required,
        email:email:required`
    &orderAddress=`address1:street,address2:number`
]]

<form action="[[~[[*id]]]]" method="post" id="simplecartCheckout">
    <input type="hidden" name="nospam" value="">

    <div>
        <label for="checkout_firstname">[[%simplecart.orderdetails.address.firstname? &namespace=`simplecart`]]: <span>*</span></label>
        <input type="text" name="firstname" id="checkout_firstname" value="[[+fi.firstname]]" />
        <label class="error">[[+fi.error.firstname]]</label>
    </div>

<!--OTHER FORM FIELDS HERE-->

    <div>
        <label for="checkout_email">[[%simplecart.orderdetails.address.email]]: <span>*</span></label>
        <input type="email" name="email" id="checkout_email" value="[[+fi.email]]" />
        <label class="error">[[+fi.error.email]]</label>
    </div>

    [[!scDeliveryMethods]]

    [[!scPaymentMethods? &delivery=`[[+fi.deliveryMethod]]`]]

    <div class="submit">
        <input type="submit" name="checkout" value="[[%simplecart.cart.checkout? &namespace=`simplecart` &topic=`cart`]]" />
    </div>

</form>

我不知道我做错了什么或如何解决这个问题。谁能指出我正确的方向?

4

1 回答 1

0

我发现这是因为我在结帐表单中缺少交付方式值:

<input type="hidden" name="deliveryMethod" value="[[+fi.deliveryMethod]]" />
于 2015-07-27T00:33:00.970 回答