逐字遵循教程后,ModX SimpleCart One Page Checkout 无法正常工作

ModX SimpleCart One Page Checkout not working after following tutorial verbatim

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

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

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

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

[[!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>

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

我发现这是因为我在结帐表格中缺少送货方式值:

<input type="hidden" name="deliveryMethod" value="[[+fi.deliveryMethod]]" />